From f90bdf7c4e5274a40cdbe64f73411f86840f45e3 Mon Sep 17 00:00:00 2001 From: zhoujie Date: Wed, 12 Jul 2023 17:24:32 +0800 Subject: [PATCH] vmstat: Update memory statistics --- ...port-vmstat-Update-memory-statistics.patch | 46 +++++++++++++++++++ procps-ng.spec | 6 ++- 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 backport-vmstat-Update-memory-statistics.patch diff --git a/backport-vmstat-Update-memory-statistics.patch b/backport-vmstat-Update-memory-statistics.patch new file mode 100644 index 0000000..5802a11 --- /dev/null +++ b/backport-vmstat-Update-memory-statistics.patch @@ -0,0 +1,46 @@ +From 7e24816538b777fe0b3f709df3b9c1824681461c Mon Sep 17 00:00:00 2001 +From: Ingo Saitz +Date: Fri, 6 Jan 2023 13:30:39 +1100 +Subject: [PATCH] vmstat: Update memory statistics + +vmstat would update most fields, but the memory statistics +were only fetched the first time. + +References: + https://bugs.debian.org/1027963 + +Signed-off-by: Craig Small +--- + NEWS | 1 + + src/vmstat.c | 3 +++ + 2 files changed, 4 insertions(+) + +diff --git a/NEWS b/NEWS +index 2d13978..fade38f 100644 +--- a/NEWS ++++ b/NEWS +@@ -2,6 +2,7 @@ procps-ng-NEXT + --------------- + * docs: Don't install English manpages twice + * skill: Match on -p again Debian #1025915 ++ * vmstat: Referesh memory statistics Debian #1027963 + procps-ng-4.0.2 + --------------- + * library revision - 0:1:0 +diff --git a/src/vmstat.c b/src/vmstat.c +index 8610983..acb7b80 100644 +--- a/src/vmstat.c ++++ b/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 ); +-- +2.33.0 + diff --git a/procps-ng.spec b/procps-ng.spec index c6b5ff2..3471820 100644 --- a/procps-ng.spec +++ b/procps-ng.spec @@ -1,6 +1,6 @@ Name: procps-ng Version: 4.0.2 -Release: 7 +Release: 8 Summary: Utilities that provide system information. License: GPL+ and GPLv2 and GPLv2+ and GPLv3+ and LGPLv2+ URL: https://sourceforge.net/projects/procps-ng/ @@ -19,6 +19,7 @@ Patch7: backport-top-lessen-summary-cpu-distortions-with-first-displa.patch Patch8: backport-pmap-Increase-memory-allocation-failure-judgment.patch Patch9: backport-top-added-guest-tics-when-multiple-cpus-were-merged.patch Patch10: backport-library-restore-the-proper-main-thread-tics-valuation.patch +Patch11: backport-vmstat-Update-memory-statistics.patch BuildRequires: ncurses-devel libtool autoconf automake gcc gettext-devel systemd-devel @@ -101,6 +102,9 @@ ln -s %{_bindir}/pidof %{buildroot}%{_sbindir}/pidof %{_mandir}/man* %changelog +* Wed Jul 12 2023 zhoujie - 4.0.2-8 +- vmstat: Update memory statistics + * Tue Jul 11 2023 Xi Fnegfei - 4.0.2-7 - library: restore the proper main thread tics valuation -- Gitee