Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/sparc/sparc add per-cpu event counters for lev10 an...
details: https://anonhg.NetBSD.org/src/rev/883a5cd4babb
branches: trunk
changeset: 750193:883a5cd4babb
user: mrg <mrg%NetBSD.org@localhost>
date: Sun Dec 20 03:40:03 2009 +0000
description:
add per-cpu event counters for lev10 and lev14 interrupts.
add some disabled MP code to poke other cpus on level 14 interrupts.
diffstat:
sys/arch/sparc/sparc/timer_sun4m.c | 20 ++++++++++++++++++--
1 files changed, 18 insertions(+), 2 deletions(-)
diffs (55 lines):
diff -r 5403c6bee6db -r 883a5cd4babb sys/arch/sparc/sparc/timer_sun4m.c
--- a/sys/arch/sparc/sparc/timer_sun4m.c Sun Dec 20 03:38:59 2009 +0000
+++ b/sys/arch/sparc/sparc/timer_sun4m.c Sun Dec 20 03:40:03 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: timer_sun4m.c,v 1.17 2009/03/10 23:58:20 martin Exp $ */
+/* $NetBSD: timer_sun4m.c,v 1.18 2009/12/20 03:40:03 mrg Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -58,7 +58,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: timer_sun4m.c,v 1.17 2009/03/10 23:58:20 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: timer_sun4m.c,v 1.18 2009/12/20 03:40:03 mrg Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -110,6 +110,7 @@
* panic
* so for now just bail when cold
*/
+ cpuinfo.ci_lev10.ev_count++;
if (cold)
return 0;
/* read the limit register to clear the interrupt */
@@ -128,6 +129,14 @@
struct clockframe *frame = cap;
u_long newint;
+ cpuinfo.ci_lev14.ev_count++;
+
+#if defined(MULTIPROCESSOR) && 0
+ if (!(curcpu()->master)) {
+ raise_ipi(&cpuinfo, 10);
+ }
+#endif
+
/* read the limit register to clear the interrupt */
*((volatile int *)&counterreg4m->t_limit);
@@ -221,6 +230,13 @@
cpi->counterreg_4m = (struct counter_4m *)bh;
}
+ /* Install timer/statclock event counters, per cpu */
+ for (CPU_INFO_FOREACH(n, cpi)) {
+ snprintf(cpi->ci_cpuname, sizeof(cpi->ci_cpuname), "cpu/%d", n);
+ evcnt_attach_dynamic(&cpi->ci_lev10, EVCNT_TYPE_INTR, NULL, cpi->ci_cpuname, "lev10");
+ evcnt_attach_dynamic(&cpi->ci_lev14, EVCNT_TYPE_INTR, NULL, cpi->ci_cpuname, "lev14");
+ }
+
/* Put processor counter in "timer" mode */
timerreg4m->t_cfg = 0;
Home |
Main Index |
Thread Index |
Old Index