Hi,

Apparently, procps 3.2.5 corrected this somewhat, but it still truncates
CPU usage to 99.9%, which does not make sense in Irix mode (the
default). Here is a patch to correct truncation to 99.9%*#CPUs and fix
format as appropriate. Please apply.

Regards,
Samuel
--- procps-3.2.5/top.c  2005-01-26 06:15:18.000000000 +0100
+++ procps-mine/top.c   2005-06-03 16:21:13.352516764 +0200
@@ -1558,13 +1558,16 @@ static void before (char *me)
    pcpu_max_value = 99.9;
    Fieldstab[P_CPN].head = " P";
    Fieldstab[P_CPN].fmts = " %1u";
+   if(Rc.mode_irixps && smp_num_cpus>1){
+      pcpu_max_value *= smp_num_cpus;
+      Fieldstab[P_CPU].fmts = " %5.1f";
+   }
    if(smp_num_cpus>9){
       Fieldstab[P_CPN].head = "  P";
       Fieldstab[P_CPN].fmts = " %2u";
       if(Rc.mode_irixps){
          // this will do for up to 999; hopefully a 1024-node box
          // will have at least 2.4% idle time
-         pcpu_max_value = 9999.0;
          Fieldstab[P_CPU].fmts = " %4.0f";
       }
    }

Reply via email to