diff options
author | phk <phk@FreeBSD.org> | 1998-05-28 09:30:28 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1998-05-28 09:30:28 +0000 |
commit | d3d65c6b2e376ac074f3ca386b6f5b70ea37636f (patch) | |
tree | 6beef0d8c93f6063bf0b9870b87a8c1ef8267cd4 /usr.bin/top | |
parent | 3654f28d394a609d42e7000c62963c45e3bba3db (diff) | |
download | FreeBSD-src-d3d65c6b2e376ac074f3ca386b6f5b70ea37636f.zip FreeBSD-src-d3d65c6b2e376ac074f3ca386b6f5b70ea37636f.tar.gz |
Some cleanups related to timecounters and weird ifdefs in <sys/time.h>.
Clean up (or if antipodic: down) some of the msgbuf stuff.
Use an inline function rather than a macro for timecounter delta.
Maintain process "on-cpu" time as 64 bits of microseconds to avoid
needless second rollover overhead.
Avoid calling microuptime the second time in mi_switch() if we do
not pass through _idle in cpu_switch()
This should reduce our context-switch overhead a bit, in particular
on pre-P5 and SMP systems.
WARNING: Programs which muck about with struct proc in userland
will have to be fixed.
Reviewed, but found imperfect by: bde
Diffstat (limited to 'usr.bin/top')
-rw-r--r-- | usr.bin/top/machine.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/top/machine.c b/usr.bin/top/machine.c index d715210..c87b00e 100644 --- a/usr.bin/top/machine.c +++ b/usr.bin/top/machine.c @@ -17,7 +17,7 @@ * Steven Wallace <swallace@freebsd.org> * Wolfram Schneider <wosch@FreeBSD.org> * - * $Id: machine.c,v 1.8 1997/10/05 21:20:56 fsmp Exp $ + * $Id: machine.c,v 1.9 1998/02/14 13:34:59 peter Exp $ */ @@ -565,7 +565,7 @@ char *(*get_userid)(); /* This does not produce the correct results */ cputime = PP(pp, p_uticks) + PP(pp, p_sticks) + PP(pp, p_iticks); #endif - cputime = PP(pp, p_rtime).tv_sec; /* This does not count interrupts */ + cputime = PP(pp, p_runtime) / 1000000; /* This does not count interrupts */ /* calculate the base for cpu percentages */ pct = pctdouble(PP(pp, p_pctcpu)); @@ -736,7 +736,7 @@ struct proc **pp2; if ((lresult = PP(p2, p_pctcpu) - PP(p1, p_pctcpu)) == 0) { /* use lifetime CPU usage to break the tie */ - if ((result = PP(p2, p_rtime).tv_sec - PP(p1, p_rtime).tv_sec) == 0) + if ((result = PP(p2, p_runtime) - PP(p1, p_runtime)) == 0) { /* use process state to break the tie */ if ((result = sorted_state[(unsigned char) PP(p2, p_stat)] - |