From: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Subject: Re: procinfo AXP
Date: Fri, 13 Jun 1997 17:28:51 +0200 (MEST) [thread overview]
Message-ID: <199706131528.RAA01034@alpha.franken.de> (raw)
In-Reply-To: <Pine.LNX.3.95.970613082848.16924A-100000@balintrc.ppp.udayton.edu>
> 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 <unistd.h>
#include <termios.h>
#include <termcap.h>
+#include <sys/param.h.h>
#include <errno.h>
#include <stdlib.h>
#include <sys/ioctl.h>
@@ -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
next parent reply other threads:[~1997-06-13 15:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Pine.LNX.3.95.970613082848.16924A-100000@balintrc.ppp.udayton.edu>
1997-06-13 15:28 ` Thomas Bogendoerfer [this message]
1997-06-13 16:19 ` procinfo AXP Woodstock
[not found] <Pine.LNX.3.95.970613121731.17685A-100000@balintrc.ppp.udayton.edu>
1997-06-13 22:21 ` Thomas Bogendoerfer
[not found] <33A10FD8.41C67EA6@iis.fhg.de>
1997-06-13 12:31 ` Woodstock
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox