fixup CPU usage calculation on 2.6 kernels (patch by Benoit Dejean
2004-03-09 Bastien Nocera <hadess@hadess.net> * cpu.c: (glibtop_get_cpu_s): fixup CPU usage calculation on 2.6 kernels (patch by Benoit Dejean <bnet@ifrance.com>) (Closes: #134252)
This commit is contained in:
committed by
Bastien Nocera
parent
ab1d1077d6
commit
f3be4b50a9
@@ -80,6 +80,11 @@ glibtop_get_cpu_s (glibtop *server, glibtop_cpu *buf)
|
||||
buf->sys = strtoull (p, &p, 0);
|
||||
buf->idle = strtoull (p, &p, 0);
|
||||
|
||||
/* 2.6 kernel */
|
||||
buf->idle += strtoull(p, &p, 0); /* "iowait" */
|
||||
buf->sys += strtoull(p, &p, 0); /* "irq" */
|
||||
buf->sys += strtoull(p, &p, 0); /* "softirq" */
|
||||
|
||||
total = buf->user;
|
||||
total += buf->nice;
|
||||
total += buf->sys;
|
||||
|
||||
Reference in New Issue
Block a user