fixup CPU usage calculation on 2.6 kernels (patch by Benoit Dejean

* cpu.c: (glibtop_get_cpu_s): fixup CPU usage calculation on 2.6
        kernels (patch by Benoit Dejean <bnet@ifrance.com>) (Closes: #134252) (again)
This commit is contained in:
Benoît Dejean
2004-03-10 00:15:39 +00:00
parent f3be4b50a9
commit 89e79ee51f

View File

@@ -104,6 +104,11 @@ glibtop_get_cpu_s (glibtop *server, glibtop_cpu *buf)
buf->xcpu_sys [i] = strtoull (p, &p, 0);
buf->xcpu_idle [i] = strtoull (p, &p, 0);
/* 2.6 kernel */
buf->xcpu_idle [i] += strtoull(p, &p, 0); /* "iowait" */
buf->xcpu_sys [i] += strtoull(p, &p, 0); /* "irq" */
buf->xcpu_sys [i] += strtoull(p, &p, 0); /* "softirq" */
total = buf->xcpu_user [i];
total += buf->xcpu_nice [i];
total += buf->xcpu_sys [i];