Package: procps
Version: 2:4.0.2-3
Severity: normal
Tags: patch

Dear Maintainer,

running vmstat to produce a continuous output (eg. "vmstat 3") does not
update the values in the memory columns any more. The "main loop" just
does not fetch those values.

The attached patch fixes the output by fetching the memory stats on the
main loop, too.

-- System Information:
Debian Release: bookworm/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.1.0-spatz20221212 (SMP w/4 CPU threads)
Kernel taint flags: TAINT_FIRMWARE_WORKAROUND
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US:en
Shell: /bin/sh linked to /usr/bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages procps depends on:
ii  init-system-helpers  1.65.2
ii  libc6                2.36-7
ii  libncursesw6         6.4-1
ii  libproc2-0           2:4.0.2-3.~0ingo1
ii  libtinfo6            6.4-1

Versions of packages procps recommends:
ii  psmisc  23.6-1

procps suggests no packages.

-- Configuration Files:
/etc/sysctl.conf changed [not included]

-- no debconf information
Description: vmstat: refresh memory display
 Update the memory columns on repeated outputs
Author: Ingo Saitz <i...@hannover.ccc.de>
Bug: $this_one
Last-Update: 2023-01-05
Index: procps-4.0.2/src/vmstat.c
===================================================================
--- procps-4.0.2.orig/src/vmstat.c
+++ procps-4.0.2/src/vmstat.c
@@ -468,6 +468,9 @@ static void new_format(void)
         pswpin[tog] = VMSTAT_GET(vm_info, VMSTAT_PSWPIN, ul_int);
         pswpout[tog] = VMSTAT_GET(vm_info, VMSTAT_PSWPOUT, ul_int);
 
+        if (!(mem_stack = procps_meminfo_select(mem_info, Mem_items, MAX_mem)))
+                xerrx(EXIT_FAILURE, _("Unable to select memory information"));
+
         if (t_option) {
             (void) time( &the_time );
             tm_ptr = localtime( &the_time );

Reply via email to