1 Star 0 Fork 25

Jason011125/procps-ng

forked from src-openEuler/procps-ng 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-vmstat-Update-memory-statistics.patch 1.41 KB
一键复制 编辑 原始数据 按行查看 历史
hd_zhoujie 提交于 2023-07-12 17:24 +08:00 . vmstat: Update memory statistics
From 7e24816538b777fe0b3f709df3b9c1824681461c Mon Sep 17 00:00:00 2001
From: Ingo Saitz <ingo@hannover.ccc.de>
Date: Fri, 6 Jan 2023 13:30:39 +1100
Subject: [PATCH] vmstat: Update memory statistics
vmstat <n> 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 <csmall@dropbear.xyz>
---
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
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/Jason_828e/procps-ng.git
git@gitee.com:Jason_828e/procps-ng.git
Jason_828e
procps-ng
procps-ng
master

搜索帮助