summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2004-07-30 10:02:43 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2004-07-30 10:02:43 +0000
commit7a7314f77e046698c24f2abc4288112f94df7276 (patch)
treee246e7796fbb353c2d14a0107b72e8da05ae237c /sys/arch
parent6d24776ed0ad83ce600312ba8e20432f4e1375df (diff)
Might count timer interrupts as well (oops).
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/mvme68k/dev/clock.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/sys/arch/mvme68k/dev/clock.c b/sys/arch/mvme68k/dev/clock.c
index 5d93b1a6f47..734a6ec84fa 100644
--- a/sys/arch/mvme68k/dev/clock.c
+++ b/sys/arch/mvme68k/dev/clock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: clock.c,v 1.11 2004/07/03 14:36:19 miod Exp $ */
+/* $OpenBSD: clock.c,v 1.12 2004/07/30 10:02:42 miod Exp $ */
/*
* Copyright (c) 1995 Theo de Raadt
@@ -67,6 +67,7 @@
#include <sys/device.h>
#include <sys/kernel.h>
#include <sys/systm.h>
+#include <sys/evcount.h>
#include <machine/psl.h>
#include <machine/autoconf.h>
@@ -102,7 +103,9 @@ int statmin; /* statclock interval - 1/2*variance */
struct clocksoftc {
struct device sc_dev;
struct intrhand sc_profih;
+ struct evcount sc_profcnt;
struct intrhand sc_statih;
+ struct evcount sc_statcnt;
};
void clockattach(struct device *, struct device *, void *);
@@ -180,6 +183,11 @@ clockattach(parent, self, args)
#endif
}
+ evcount_attach(&sc->sc_statcnt, "stat", (void *)&sc->sc_statih.ih_ipl,
+ &evcount_intr);
+ evcount_attach(&sc->sc_profcnt, "clock", (void *)&sc->sc_profih.ih_ipl,
+ &evcount_intr);
+
printf("\n");
}
@@ -190,6 +198,8 @@ int
clockintr(arg)
void *arg;
{
+ struct clocksoftc *sc = clock_cd.cd_devs[0];
+
switch (clockbus) {
#if NPCC > 0
case BUS_PCC:
@@ -207,6 +217,8 @@ clockintr(arg)
break;
#endif
}
+
+ sc->sc_profcnt.ec_count++;
hardclock(arg);
return (1);
}
@@ -301,6 +313,7 @@ int
statintr(cap)
void *cap;
{
+ struct clocksoftc *sc = clock_cd.cd_devs[0];
register u_long newint, r, var;
switch (clockbus) {
@@ -321,6 +334,7 @@ statintr(cap)
#endif
}
+ sc->sc_statcnt.ec_count++;
statclock((struct clockframe *)cap);
/*