Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/alpha Count individual interprocessor interrupts --...



details:   https://anonhg.NetBSD.org/src/rev/c1e5a1e1df18
branches:  trunk
changeset: 499378:c1e5a1e1df18
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sat Nov 18 19:25:35 2000 +0000

description:
Count individual interprocessor interrupts -- it's good to know where
they all come from.

diffstat:

 sys/arch/alpha/alpha/cpu.c       |   7 +++----
 sys/arch/alpha/alpha/interrupt.c |  11 +++++++----
 sys/arch/alpha/alpha/ipifuncs.c  |  37 +++++++++++++++++++++++++++++++++++--
 sys/arch/alpha/include/cpuvar.h  |   3 ++-
 sys/arch/alpha/include/intr.h    |   5 ++++-
 5 files changed, 51 insertions(+), 12 deletions(-)

diffs (154 lines):

diff -r c0d56bc78cec -r c1e5a1e1df18 sys/arch/alpha/alpha/cpu.c
--- a/sys/arch/alpha/alpha/cpu.c        Sat Nov 18 18:13:38 2000 +0000
+++ b/sys/arch/alpha/alpha/cpu.c        Sat Nov 18 19:25:35 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.57 2000/11/18 17:45:31 thorpej Exp $ */
+/* $NetBSD: cpu.c,v 1.58 2000/11/18 19:25:35 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.57 2000/11/18 17:45:31 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.58 2000/11/18 19:25:35 thorpej Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -382,8 +382,7 @@
        evcnt_attach_dynamic(&sc->sc_evcnt_device, EVCNT_TYPE_INTR,
            NULL, sc->sc_dev.dv_xname, "device");
 #if defined(MULTIPROCESSOR)
-       evcnt_attach_dynamic(&sc->sc_evcnt_ipi, EVCNT_TYPE_INTR,
-           NULL, sc->sc_dev.dv_xname, "ipi");
+       alpha_ipi_init(ci);
 #endif
 }
 
diff -r c0d56bc78cec -r c1e5a1e1df18 sys/arch/alpha/alpha/interrupt.c
--- a/sys/arch/alpha/alpha/interrupt.c  Sat Nov 18 18:13:38 2000 +0000
+++ b/sys/arch/alpha/alpha/interrupt.c  Sat Nov 18 19:25:35 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: interrupt.c,v 1.51 2000/09/04 00:31:59 thorpej Exp $ */
+/* $NetBSD: interrupt.c,v 1.52 2000/11/18 19:25:36 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -72,7 +72,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.51 2000/09/04 00:31:59 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.52 2000/11/18 19:25:36 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -129,9 +129,12 @@
                sc->sc_evcnt_ipi.ev_count++;
 
                pending_ipis = atomic_loadlatch_ulong(&ci->ci_ipis, 0);
-               for (bit = 0; bit < ALPHA_NIPIS; bit++)
-                       if (pending_ipis & (1UL << bit))
+               for (bit = 0; bit < ALPHA_NIPIS; bit++) {
+                       if (pending_ipis & (1UL << bit)) {
+                               sc->sc_evcnt_which_ipi[bit].ev_count++;
                                (*ipifuncs[bit])();
+                       }
+               }
 
                /*
                 * Handle inter-console messages if we're the primary
diff -r c0d56bc78cec -r c1e5a1e1df18 sys/arch/alpha/alpha/ipifuncs.c
--- a/sys/arch/alpha/alpha/ipifuncs.c   Sat Nov 18 18:13:38 2000 +0000
+++ b/sys/arch/alpha/alpha/ipifuncs.c   Sat Nov 18 19:25:35 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ipifuncs.c,v 1.19 2000/09/04 00:31:59 thorpej Exp $ */
+/* $NetBSD: ipifuncs.c,v 1.20 2000/11/18 19:25:36 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: ipifuncs.c,v 1.19 2000/09/04 00:31:59 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipifuncs.c,v 1.20 2000/11/18 19:25:36 thorpej Exp $");
 
 /*
  * Interprocessor interrupt handlers.
@@ -84,6 +84,39 @@
        alpha_ipi_pause,
 };
 
+const char *ipinames[ALPHA_NIPIS] = {
+       "halt ipi",
+       "tbia ipi",
+       "tbiap ipi",
+       "shootdown ipi",
+       "imb ipi",
+       "ast ipi",
+       "synch fpu ipi",
+       "discard fpu ipi",
+       "pause ipi",
+};
+
+/*
+ * Initialize IPI state for a CPU.
+ *
+ * Note: the cpu_info softc pointer must be valid.
+ */
+void
+alpha_ipi_init(struct cpu_info *ci)
+{
+       struct cpu_softc *sc = ci->ci_softc;
+       int i;
+
+       evcnt_attach_dynamic(&sc->sc_evcnt_ipi, EVCNT_TYPE_INTR,
+           NULL, sc->sc_dev.dv_xname, "ipi");
+
+       for (i = 0; i < ALPHA_NIPIS; i++) {
+               evcnt_attach_dynamic(&sc->sc_evcnt_which_ipi[i],
+                   EVCNT_TYPE_INTR, NULL, sc->sc_dev.dv_xname,
+                   ipinames[i]);
+       }
+}
+
 /*
  * Send an interprocessor interrupt.
  */
diff -r c0d56bc78cec -r c1e5a1e1df18 sys/arch/alpha/include/cpuvar.h
--- a/sys/arch/alpha/include/cpuvar.h   Sat Nov 18 18:13:38 2000 +0000
+++ b/sys/arch/alpha/include/cpuvar.h   Sat Nov 18 19:25:35 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpuvar.h,v 1.1 2000/06/05 21:47:18 thorpej Exp $ */
+/* $NetBSD: cpuvar.h,v 1.2 2000/11/18 19:25:37 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -42,5 +42,6 @@
        struct evcnt sc_evcnt_device;   /* device interrupts */
 #if defined(MULTIPROCESSOR)
        struct evcnt sc_evcnt_ipi;      /* interprocessor interrupts */
+       struct evcnt sc_evcnt_which_ipi[ALPHA_NIPIS];
 #endif
 };
diff -r c0d56bc78cec -r c1e5a1e1df18 sys/arch/alpha/include/intr.h
--- a/sys/arch/alpha/include/intr.h     Sat Nov 18 18:13:38 2000 +0000
+++ b/sys/arch/alpha/include/intr.h     Sat Nov 18 19:25:35 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: intr.h,v 1.34 2000/08/22 19:46:26 thorpej Exp $ */
+/* $NetBSD: intr.h,v 1.35 2000/11/18 19:25:37 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -168,6 +168,9 @@
 typedef void (*ipifunc_t)(void);
 extern ipifunc_t ipifuncs[ALPHA_NIPIS];
 
+struct cpu_info;
+
+void   alpha_ipi_init(struct cpu_info *);
 void   alpha_send_ipi(unsigned long, unsigned long);
 void   alpha_broadcast_ipi(unsigned long);
 void   alpha_multicast_ipi(unsigned long, unsigned long);



Home | Main Index | Thread Index | Old Index