From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <199706131528.RAA01034@alpha.franken.de> Date: Fri, 13 Jun 1997 17:28:51 +0200 (MEST) From: Thomas Bogendoerfer Subject: Re: procinfo AXP In-Reply-To: > Out of everything, I believe only the uptime is correct. I compiled the > GIMP overnight on it, but it didn't take 15.75 hours to do it! And the > idle time is just an outright lie! :) try the patch below, it's against procinfo-0.11. I've already sent this patch to the author of procinfo, and will probably show up in the next release. Thomas. diff -ru orig/procinfo-0.11/procinfo.c procinfo-0.11/procinfo.c --- orig/procinfo-0.11/procinfo.c Wed May 28 14:21:50 1997 +++ procinfo-0.11/procinfo.c Thu May 29 23:10:17 1997 @@ -94,7 +94,7 @@ fclose (uptimefp); uptimefp = myfopen (PROC_DIR "uptime"); #endif fgets (line, sizeof (line), uptimefp); - new.uptime = (long) (atof (strtok (line, " ")) * 100.0); + new.uptime = (long) (atof (strtok (line, " ")) * HZ); /*=== /proc/meminfo ===*/ @@ -264,13 +264,16 @@ elapsed = new.uptime; +#ifndef __alpha__ if (irq_array) { if (fs && old.uptime) elapsed = DIFF (intr[0]); - } else { + } else +#endif + { if (fs && old.uptime) /* This won't be exact... */ - elapsed = 100 * sl; + elapsed = DIFF (uptime); } printf ("user : %s %s", diff -ru orig/procinfo-0.11/routines.c procinfo-0.11/routines.c --- orig/procinfo-0.11/routines.c Wed May 28 14:21:53 1997 +++ procinfo-0.11/routines.c Thu May 29 23:14:53 1997 @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -57,6 +58,7 @@ int d, h, m, s; static char buf[22]; + t = t * 100 / HZ; d = (int) (t / 8640000); t = t - (long) (d * 8640000); h = (int) (t / 360000); -- See, you not only have to be a good coder to create a system like Linux, you have to be a sneaky bastard too ;-) [Linus Torvalds in <4rikft$7g5@linux.cs.Helsinki.FI>] -- To unsubscribe: send e-mail to axp-list-request@redhat.com with 'unsubscribe' as the subject. Do not send it to axp-list@redhat.com