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:
Bastien Nocera
2004-03-09 23:44:12 +00:00
committed by Bastien Nocera
parent ab1d1077d6
commit f3be4b50a9
2 changed files with 10 additions and 0 deletions

View File

@@ -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;