1 Star 0 Fork 9

jeff200902/procinfo

forked from src-openEuler/procinfo 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
procinfo-18-acct.patch 1.76 KB
一键复制 编辑 原始数据 按行查看 历史
Grooooot 提交于 2020-02-19 10:01 . init the package
diff -urN procinfo-18.save/procinfo.c procinfo-18/procinfo.c
--- procinfo-18.save/procinfo.c 2001-02-25 06:29:16.000000000 -0500
+++ procinfo-18/procinfo.c 2003-07-29 22:10:07.000000000 -0400
@@ -249,6 +249,9 @@
new.cpu_nice = VAL;
new.cpu_sys = VAL;
new.cpu_idle = VAL;
+ new.cpu_iowait = VAL;
+ new.cpu_irq = VAL;
+ new.cpu_softirq = VAL;
/*
* according to bug #1959, sometimes the cpu_idle
* seems to go backwards(!) on SMP boxes. This may
@@ -373,7 +376,9 @@
putchar ('\n');
printf ("system: %s %s",
- hms (bDIFF (cpu_sys)), perc (bDIFF (cpu_sys), elapsed, nr_cpus));
+ hms (bDIFF (cpu_sys) + bDIFF (cpu_irq) + bDIFF (cpu_softirq)),
+ perc (bDIFF (cpu_sys) + bDIFF (cpu_irq) + bDIFF (cpu_softirq),
+ elapsed, nr_cpus));
printf (" swap in :%9lu", bDIFF (swin));
if (new.disk_r[2])
printf (" disk 3: %8lur%8luw\n", bDIFF (disk_r[2]),
@@ -384,7 +389,8 @@
putchar ('\n');
printf ("idle : %s %s",
- hms (bDIFF (cpu_idle)), perc (bDIFF (cpu_idle), elapsed, nr_cpus));
+ hms (bDIFF (cpu_idle) + bDIFF (cpu_iowait)),
+ perc (bDIFF (cpu_idle) + bDIFF (cpu_iowait), elapsed, nr_cpus));
printf (" swap out:%9lu", bDIFF (swout));
if (new.disk_r[3])
printf (" disk 4: %8lur%8luw\n", bDIFF (disk_r[3]),
diff -urN procinfo-18.save/procinfo.h procinfo-18/procinfo.h
--- procinfo-18.save/procinfo.h 2001-02-24 18:30:45.000000000 -0500
+++ procinfo-18/procinfo.h 2003-07-29 22:10:09.000000000 -0400
@@ -82,6 +82,7 @@
long m_to, m_us, m_fr, m_sh, m_bu, m_ca;
long s_to, s_us, s_fr;
unsigned long cpu_user, cpu_nice, cpu_sys, cpu_idle;
+ unsigned long cpu_iowait, cpu_irq, cpu_softirq;
unsigned long disk[5];
unsigned long disk_r[5];
unsigned long disk_w[5];
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/jeff200902/procinfo.git
git@gitee.com:jeff200902/procinfo.git
jeff200902
procinfo
procinfo
master

搜索帮助