diff options
author | fsmp <fsmp@FreeBSD.org> | 1997-12-08 23:00:24 +0000 |
---|---|---|
committer | fsmp <fsmp@FreeBSD.org> | 1997-12-08 23:00:24 +0000 |
commit | 6dd7dcc53b675eb0167c348bd2a4b6f527ec387c (patch) | |
tree | 8ceb88629b524e26e069a9a105e202d2131596e3 /sys/kern/kern_clock.c | |
parent | c29fe145047eadea9dcee01d907b3a990906a6af (diff) | |
download | FreeBSD-src-6dd7dcc53b675eb0167c348bd2a4b6f527ec387c.zip FreeBSD-src-6dd7dcc53b675eb0167c348bd2a4b6f527ec387c.tar.gz |
The improvements to clock statistics by Tor Egge
Wrappered and enabled by the define BETTER_CLOCK (on by default in smpyests.h)
Reviewed by: smp@csn.net
Submitted by: Tor Egge <Tor.Egge@idi.ntnu.no>
Diffstat (limited to 'sys/kern/kern_clock.c')
-rw-r--r-- | sys/kern/kern_clock.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c index 5f138615..220e4b5 100644 --- a/sys/kern/kern_clock.c +++ b/sys/kern/kern_clock.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)kern_clock.c 8.5 (Berkeley) 1/21/94 - * $Id: kern_clock.c,v 1.44 1997/11/18 12:24:22 bde Exp $ + * $Id: kern_clock.c,v 1.45 1997/11/24 15:15:27 bde Exp $ */ /* Portions of this software are covered by the following: */ @@ -80,6 +80,10 @@ #include <sys/gmon.h> #endif +#if defined(SMP) && defined(BETTER_CLOCK) +#include <machine/smp.h> +#endif + static void initclocks __P((void *dummy)); SYSINIT(clocks, SI_SUB_CLOCKS, SI_ORDER_FIRST, initclocks, NULL) @@ -91,7 +95,11 @@ struct callout_tailq *callwheel; /* Some of these don't belong here, but it's easiest to concentrate them. */ +#if defined(SMP) && defined(BETTER_CLOCK) +long cp_time[CPUSTATES]; +#else static long cp_time[CPUSTATES]; +#endif long dk_seek[DK_NDRIVE]; static long dk_time[DK_NDRIVE]; /* time busy (in statclock ticks) */ long dk_wds[DK_NDRIVE]; @@ -471,6 +479,9 @@ hardclock(frame) psignal(p, SIGPROF); } +#if defined(SMP) && defined(BETTER_CLOCK) + forward_hardclock(pscnt); +#endif /* * If no separate statistics clock is available, run it from here. */ @@ -971,6 +982,10 @@ statclock(frame) p = curproc; if (p->p_flag & P_PROFIL) addupc_intr(p, CLKF_PC(frame), 1); +#if defined(SMP) && defined(BETTER_CLOCK) + if (stathz != 0) + forward_statclock(pscnt); +#endif if (--pscnt > 0) return; /* @@ -996,6 +1011,10 @@ statclock(frame) } } #endif +#if defined(SMP) && defined(BETTER_CLOCK) + if (stathz != 0) + forward_statclock(pscnt); +#endif if (--pscnt > 0) return; /* |