Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/sparc64 add per ivec event counters
details: https://anonhg.NetBSD.org/src/rev/9412d484219f
branches: trunk
changeset: 767503:9412d484219f
user: macallan <macallan%NetBSD.org@localhost>
date: Wed Jul 20 12:06:00 2011 +0000
description:
add per ivec event counters
diffstat:
sys/arch/sparc64/dev/ebus.c | 6 +++---
sys/arch/sparc64/dev/psycho.c | 6 ++++--
sys/arch/sparc64/dev/sbus.c | 5 +++--
sys/arch/sparc64/dev/schizo.c | 4 +++-
sys/arch/sparc64/include/cpu.h | 5 ++++-
sys/arch/sparc64/sparc64/genassym.cf | 3 ++-
sys/arch/sparc64/sparc64/intr.c | 20 ++++++++++++++++++--
sys/arch/sparc64/sparc64/locore.s | 7 ++++++-
8 files changed, 43 insertions(+), 13 deletions(-)
diffs (203 lines):
diff -r 1a85991459b6 -r 9412d484219f sys/arch/sparc64/dev/ebus.c
--- a/sys/arch/sparc64/dev/ebus.c Wed Jul 20 12:00:04 2011 +0000
+++ b/sys/arch/sparc64/dev/ebus.c Wed Jul 20 12:06:00 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ebus.c,v 1.58 2011/07/01 18:48:36 dyoung Exp $ */
+/* $NetBSD: ebus.c,v 1.59 2011/07/20 12:06:00 macallan Exp $ */
/*
* Copyright (c) 1999, 2000, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ebus.c,v 1.58 2011/07/01 18:48:36 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ebus.c,v 1.59 2011/07/20 12:06:00 macallan Exp $");
#include "opt_ddb.h"
@@ -285,7 +285,7 @@
ea->ea_reg[i].lo,
ea->ea_reg[i].lo + ea->ea_reg[i].size - 1);
for (i = 0; i < ea->ea_nintr; i++)
- aprint_normal(" ipl %d", ea->ea_intr[i]);
+ aprint_normal(" ipl %x", ea->ea_intr[i]);
return (UNCONF);
}
diff -r 1a85991459b6 -r 9412d484219f sys/arch/sparc64/dev/psycho.c
--- a/sys/arch/sparc64/dev/psycho.c Wed Jul 20 12:00:04 2011 +0000
+++ b/sys/arch/sparc64/dev/psycho.c Wed Jul 20 12:06:00 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: psycho.c,v 1.108 2011/07/01 18:48:37 dyoung Exp $ */
+/* $NetBSD: psycho.c,v 1.109 2011/07/20 12:06:00 macallan Exp $ */
/*
* Copyright (c) 1999, 2000 Matthew R. Green
@@ -55,7 +55,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: psycho.c,v 1.108 2011/07/01 18:48:37 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: psycho.c,v 1.109 2011/07/20 12:06:00 macallan Exp $");
#include "opt_ddb.h"
@@ -1228,6 +1228,8 @@
if (ih == NULL)
return (NULL);
+ ih->ih_ivec = ihandle;
+
/*
* Hunt through all the interrupt mapping regs to look for our
* interrupt vector.
diff -r 1a85991459b6 -r 9412d484219f sys/arch/sparc64/dev/sbus.c
--- a/sys/arch/sparc64/dev/sbus.c Wed Jul 20 12:00:04 2011 +0000
+++ b/sys/arch/sparc64/dev/sbus.c Wed Jul 20 12:06:00 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sbus.c,v 1.88 2011/07/01 18:48:37 dyoung Exp $ */
+/* $NetBSD: sbus.c,v 1.89 2011/07/20 12:06:00 macallan Exp $ */
/*
* Copyright (c) 1999-2002 Eduardo Horvath
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sbus.c,v 1.88 2011/07/01 18:48:37 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sbus.c,v 1.89 2011/07/20 12:06:00 macallan Exp $");
#include "opt_ddb.h"
@@ -578,6 +578,7 @@
ih->ih_fun = handler;
ih->ih_arg = arg;
ih->ih_number = vec;
+ ih->ih_ivec = 0;
ih->ih_pil = (1<<ipl);
intr_establish(ipl, level != IPL_VM, ih);
return (ih);
diff -r 1a85991459b6 -r 9412d484219f sys/arch/sparc64/dev/schizo.c
--- a/sys/arch/sparc64/dev/schizo.c Wed Jul 20 12:00:04 2011 +0000
+++ b/sys/arch/sparc64/dev/schizo.c Wed Jul 20 12:06:00 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: schizo.c,v 1.24 2011/07/20 10:39:43 macallan Exp $ */
+/* $NetBSD: schizo.c,v 1.25 2011/07/20 12:06:00 macallan Exp $ */
/* $OpenBSD: schizo.c,v 1.55 2008/08/18 20:29:37 brad Exp $ */
/*
@@ -768,6 +768,8 @@
DPRINTF(SDB_INTR, ("%s: intr %x: %p mapoff %" PRIx64 " clroff %"
PRIx64 "\n", __func__, ino, intrlev[ino], mapoff, clroff));
+ ih->ih_ivec = ihandle;
+
intrregs = (uintptr_t)bus_space_vaddr(pbm->sp_regt, pbm->sp_intrh);
intrmapptr = (uint64_t *)(uintptr_t)(intrregs + mapoff);
intrclrptr = (uint64_t *)(uintptr_t)(intrregs + clroff);
diff -r 1a85991459b6 -r 9412d484219f sys/arch/sparc64/include/cpu.h
--- a/sys/arch/sparc64/include/cpu.h Wed Jul 20 12:00:04 2011 +0000
+++ b/sys/arch/sparc64/include/cpu.h Wed Jul 20 12:06:00 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.h,v 1.96 2011/04/13 03:40:00 mrg Exp $ */
+/* $NetBSD: cpu.h,v 1.97 2011/07/20 12:06:00 macallan Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -331,6 +331,9 @@
struct intrhand *ih_pending; /* interrupt queued */
volatile uint64_t *ih_map; /* Interrupt map reg */
volatile uint64_t *ih_clr; /* clear interrupt reg */
+ struct evcnt ih_cnt; /* counter for vmstat */
+ uint32_t ih_ivec;
+ char ih_name[32]; /* name for the above */
};
extern struct intrhand *intrhand[];
extern struct intrhand *intrlev[MAXINTNUM];
diff -r 1a85991459b6 -r 9412d484219f sys/arch/sparc64/sparc64/genassym.cf
--- a/sys/arch/sparc64/sparc64/genassym.cf Wed Jul 20 12:00:04 2011 +0000
+++ b/sys/arch/sparc64/sparc64/genassym.cf Wed Jul 20 12:06:00 2011 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: genassym.cf,v 1.65 2011/06/18 18:51:18 nakayama Exp $
+# $NetBSD: genassym.cf,v 1.66 2011/07/20 12:06:00 macallan Exp $
#
# Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -246,6 +246,7 @@
define IH_NEXT offsetof(struct intrhand, ih_next)
define IH_MAP offsetof(struct intrhand, ih_map)
define IH_CLR offsetof(struct intrhand, ih_clr)
+define IH_CNT offsetof(struct intrhand, ih_cnt)
# mbuf fields of import
define M_NEXT offsetof(struct mbuf, m_next)
diff -r 1a85991459b6 -r 9412d484219f sys/arch/sparc64/sparc64/intr.c
--- a/sys/arch/sparc64/sparc64/intr.c Wed Jul 20 12:00:04 2011 +0000
+++ b/sys/arch/sparc64/sparc64/intr.c Wed Jul 20 12:06:00 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: intr.c,v 1.63 2011/06/18 18:51:18 nakayama Exp $ */
+/* $NetBSD: intr.c,v 1.64 2011/07/20 12:06:00 macallan Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.63 2011/06/18 18:51:18 nakayama Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.64 2011/07/20 12:06:00 macallan Exp $");
#include "opt_ddb.h"
#include "opt_multiprocessor.h"
@@ -69,6 +69,8 @@
void strayintr(const struct trapframe64 *, int);
int intr_list_handler(void *);
+extern struct evcnt intr_evcnts[];
+
/*
* Stray interrupt handler. Clear it if possible.
* If not, and if we get 10 interrupts in 10 seconds, panic.
@@ -175,6 +177,20 @@
ih->ih_pil = level; /* XXXX caller should have done this before */
ih->ih_pending = 0; /* XXXX caller should have done this before */
ih->ih_next = NULL;
+#ifdef DEBUG
+ printf("%s: level %x ivec %x\n", __func__, level, ih->ih_ivec);
+#endif
+ /*
+ * no need for a separate counter if ivec == 0, in that case there's
+ * either only one device using the interrupt level and there's already
+ * a counter for it or it's something special like psycho's error
+ * interrupts
+ */
+ if (ih->ih_ivec != 0) {
+ snprintf(ih->ih_name, sizeof(ih->ih_name), "%x", ih->ih_ivec);
+ evcnt_attach_dynamic(&ih->ih_cnt, EVCNT_TYPE_INTR,
+ &intr_evcnts[level], "ivec", ih->ih_name);
+ }
#ifdef MULTIPROCESSOR
if (!mpsafe) {
diff -r 1a85991459b6 -r 9412d484219f sys/arch/sparc64/sparc64/locore.s
--- a/sys/arch/sparc64/sparc64/locore.s Wed Jul 20 12:00:04 2011 +0000
+++ b/sys/arch/sparc64/sparc64/locore.s Wed Jul 20 12:06:00 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.s,v 1.335 2011/07/12 07:51:34 mrg Exp $ */
+/* $NetBSD: locore.s,v 1.336 2011/07/20 12:06:00 macallan Exp $ */
/*
* Copyright (c) 2006-2010 Matthew R. Green
@@ -3452,6 +3452,11 @@
add %l5, %o0, %l5
stx %g0, [%l1] ! Clear intr source
membar #Sync ! Should not be needed
+
+ ! increment per-ivec counter
+ ldx [%l2 + IH_CNT], %l1
+ add %l1, 1, %l1
+ stx %l1, [%l2 + IH_CNT]
0:
cmp %l7, -1
bne,pn CCCR, 2b ! 'Nother?
Home |
Main Index |
Thread Index |
Old Index