diff --git a/sysdeps/linux/ChangeLog b/sysdeps/linux/ChangeLog index 5be66700..e71ba1d4 100644 --- a/sysdeps/linux/ChangeLog +++ b/sysdeps/linux/ChangeLog @@ -1,3 +1,8 @@ +2004-03-09 Bastien Nocera + + * cpu.c: (glibtop_get_cpu_s): fixup CPU usage calculation on 2.6 + kernels (patch by Benoit Dejean ) (Closes: #134252) + 2004-03-04 Bastien Nocera * ppp.c: use a config.h define instead of copying the values in diff --git a/sysdeps/linux/cpu.c b/sysdeps/linux/cpu.c index 4669f6f3..80088a2d 100644 --- a/sysdeps/linux/cpu.c +++ b/sysdeps/linux/cpu.c @@ -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;