Hi.

The new procps package contains a bug still not fixed by author. We
discussed it in kernel list. Follow the thread at:

http://marc.theaimsgroup.com/?l=linux-kernel&m=103408421017292&w=2

At the end of the tread, you will find this patch for top.c, I posted it there
and WorksForMe(TM) (while awating the author includes a fix in next package)

--- top.c.orig  2002-10-08 15:28:10.000000000 +0200
+++ top.c       2002-10-08 17:21:24.000000000 +0200
@@ -1691,6 +1691,8 @@
                                                                i, __LINE__);
                                                        break;
                                                } else {
+                                                       int u_delta, s_delta, n_delta, 
+io_delta, i_delta, un_delta;
+
                                                        t_ticks = (u_ticks + s_ticks + 
i_ticks + n_ticks + io_ticks)
                                                            - (u_ticks_o[i] + 
s_ticks_o[i] + i_ticks_o[i] + n_ticks_o[i] + io_ticks_o[i]);
                                                        if (Irixmode)
@@ -1699,25 +1701,21 @@
                                                                cpumap =
                                                                    cpu_mapping
                                                                    [i];
+                                                       u_delta  = (trimzero(u_ticks - 
+u_ticks_o[i])*1000)/t_ticks;
+                                                       s_delta  = (trimzero(s_ticks - 
+s_ticks_o[i])*1000)/t_ticks;
+                                                       n_delta  = (trimzero(n_ticks - 
+n_ticks_o[i])*1000)/t_ticks;
+                                                       io_delta = (trimzero(io_ticks 
+- io_ticks_o[i])*1000)/t_ticks;
+                                                       i_delta  = (trimzero(i_ticks - 
+i_ticks_o[i])*1000)/t_ticks;
+                                                       un_delta  = (trimzero(u_ticks 
+- u_ticks_o[i]+n_ticks - n_ticks_o[i])*1000)/t_ticks;
                                                        printf
-                                                           ("CPU%d states: %2d%s%-d%% 
user, %2d%s%-d%% system,"
-                                                            " %2d%s%-d%% nice, 
%2d%s%-d%% iowait, %2d%s%-d%% idle",
+                                                           ("CPU%d: %3d%s%-d%% user 
+%3d%s%-d%% system"
+                                                            " %3d%s%-d%% nice 
+%3d%s%-d%% iowait %3d%s%-d%% idle",
                                                             cpumap,
-                                                            trimzero(u_ticks - 
u_ticks_o [i] + n_ticks - n_ticks_o [i]) * 100 / t_ticks,
-                                                            decimal_point,
-                                                            trimzero(u_ticks - 
u_ticks_o [i]) * 100 % t_ticks / 100,
-                                                            trimzero(s_ticks - 
s_ticks_o [i]) * 100 / t_ticks,
-                                                            decimal_point,
-                                                            trimzero(s_ticks - 
s_ticks_o [i]) * 100 % t_ticks / 100,
-                                                            trimzero(n_ticks - 
n_ticks_o [i]) * 100 / t_ticks,
-                                                            decimal_point,
-                                                            trimzero(n_ticks - 
n_ticks_o [i]) * 100 % t_ticks / 100,
-                                                            trimzero(io_ticks - 
io_ticks_o [i]) * 100 / t_ticks,
-                                                            decimal_point,
-                                                            trimzero(io_ticks - 
io_ticks_o [i]) * 100 % t_ticks / 100,
-                                                            trimzero(i_ticks - 
i_ticks_o [i]) * 100 / t_ticks,
-                                                            decimal_point,
-                                                            trimzero(i_ticks - 
i_ticks_o [i]) * 100 % t_ticks / 100);
+                                                            un_delta/ 10, 
+decimal_point, un_delta% 10,
+                                                            s_delta / 10, 
+decimal_point, s_delta % 10,
+                                                            n_delta / 10, 
+decimal_point, n_delta % 10,
+                                                            io_delta/ 10, 
+decimal_point, io_delta% 10,
+                                                            i_delta / 10, 
+decimal_point, i_delta % 10);
                                                        s_ticks_o[i] = s_ticks;
                                                        u_ticks_o[i] = u_ticks;
                                                        n_ticks_o[i] = n_ticks;

-- 
J.A. Magallon <[EMAIL PROTECTED]>      \                 Software is like sex:
werewolf.able.es                         \           It's better when it's free
Mandrake Linux release 9.1 (Cooker) for i586
Linux 2.4.20-pre10-jam1 (gcc 3.2 (Mandrake Linux 9.0 3.2-2mdk))

Reply via email to