Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Nov 1998 17:50:53 +0900
From:      Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp>
To:        freebsd-alpha@FreeBSD.ORG
Subject:   ps and top on alpha
Message-ID:  <19981124175053E.simokawa@sat.t.u-tokyo.ac.jp>

next in thread | raw e-mail | index | archive | help
Hi,

CPU, MEM of ps and CPU, loadavg of top seems wrong on alpha.
Here is a fix for that.
I thinks this change wouldn't break anything on i386.

/\ Hidetoshi Shimokawa
\/  simokawa@sat.t.u-tokyo.ac.jp
PGP public key: finger -l simokawa@sat.t.u-tokyo.ac.jp

Index: machdep.c
===================================================================
RCS file: /pub/FreeBSD-CVS/src/sys/alpha/alpha/machdep.c,v
retrieving revision 1.23
diff -u -r1.23 machdep.c
--- machdep.c	1998/11/18 23:51:40	1.23
+++ machdep.c	1998/11/24 08:20:14
@@ -198,6 +198,8 @@
 
 vm_offset_t phys_avail[10];
 
+SYSCTL_INT(_hw, OID_AUTO, availpages, CTLFLAG_RD, &physmem, 0, "");
+
 /* must be 2 less so 0 0 can signal end of chunks */
 #define PHYS_AVAIL_ARRAY_END ((sizeof(phys_avail) / sizeof(vm_offset_t)) - 2)
 
Index: print.c
===================================================================
RCS file: /pub/FreeBSD-CVS/src/bin/ps/print.c,v
retrieving revision 1.32
diff -u -r1.32 print.c
--- print.c	1998/09/14 08:32:20	1.32
+++ print.c	1998/11/24 03:44:49
@@ -503,8 +503,8 @@
 	if (p->p_swtime == 0 || (p->p_flag & P_INMEM) == 0)
 		return (0.0);
 	if (rawcpu)
-		return (10000.0 / sysconf(_SC_CLK_TCK) * fxtofl(p->p_pctcpu));
-	return (10000.0 / sysconf(_SC_CLK_TCK) * fxtofl(p->p_pctcpu) /
+		return (100.0 * fxtofl(p->p_pctcpu));
+	return (100.0 * fxtofl(p->p_pctcpu) /
 		(1.0 - exp(p->p_swtime * log(fxtofl(ccpu)))));
 }
 
Index: machine.c
===================================================================
RCS file: /pub/FreeBSD-CVS/src/usr.bin/top/machine.c,v
retrieving revision 1.15
diff -u -r1.15 machine.c
--- machine.c	1998/09/11 14:38:12	1.15
+++ machine.c	1998/11/24 04:32:15
@@ -628,8 +628,8 @@
 	    status,
 	    smpmode ? PP(pp, p_lastcpu) : 0,
 	    format_time(cputime),
-	    10000.0 * weighted_cpu(pct, pp) / hz,
-	    10000.0 * pct / hz,
+	    100.0 * weighted_cpu(pct, pp),
+	    100.0 * pct,
 	    cmdlength,
 	    printable(PP(pp, p_comm)));
 
Index: loadavg.h
===================================================================
RCS file: /pub/FreeBSD-CVS/src/contrib/top/loadavg.h,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 loadavg.h
--- loadavg.h	1997/03/23 18:51:21	1.1.1.1
+++ loadavg.h	1998/11/24 08:35:23
@@ -47,7 +47,7 @@
 #endif
 
 #ifdef FIXED_LOADAVG
-  typedef long load_avg;
+  typedef fixpt_t load_avg;
 # define loaddouble(la) ((double)(la) / FIXED_LOADAVG)
 # define intload(i) ((int)((i) * FIXED_LOADAVG))
 #else

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-alpha" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19981124175053E.simokawa>