Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/xen Attach xen IPI event counters.



details:   https://anonhg.NetBSD.org/src/rev/f1c15bd6489c
branches:  trunk
changeset: 1008802:f1c15bd6489c
user:      ad <ad%NetBSD.org@localhost>
date:      Fri Apr 03 22:20:36 2020 +0000

description:
Attach xen IPI event counters.

diffstat:

 sys/arch/xen/include/intrdefs.h |   7 ++++++-
 sys/arch/xen/x86/xen_intr.c     |  18 +++++++++++++++---
 2 files changed, 21 insertions(+), 4 deletions(-)

diffs (70 lines):

diff -r 9fc95189ce4e -r f1c15bd6489c sys/arch/xen/include/intrdefs.h
--- a/sys/arch/xen/include/intrdefs.h   Fri Apr 03 21:55:07 2020 +0000
+++ b/sys/arch/xen/include/intrdefs.h   Fri Apr 03 22:20:36 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: intrdefs.h,v 1.14 2019/11/23 19:40:38 ad Exp $ */
+/* $NetBSD: intrdefs.h,v 1.15 2020/04/03 22:20:36 ad Exp $ */
 
 /* This file co-exists, and is included via machine/intrdefs.h */
 
@@ -21,4 +21,9 @@
 /* The number of 'irqs' that XEN understands */
 #define NUM_XEN_IRQS           256
 
+#define XEN_IPI_NAMES {  "halt IPI", "FPU synch IPI", \
+                        "DDB IPI", "xcall IPI", \
+                        "HVCB IPI", "generic IPI", \
+                        "AST IPI" }
+
 #endif /* _XEN_INTRDEFS_H_ */
diff -r 9fc95189ce4e -r f1c15bd6489c sys/arch/xen/x86/xen_intr.c
--- a/sys/arch/xen/x86/xen_intr.c       Fri Apr 03 21:55:07 2020 +0000
+++ b/sys/arch/xen/x86/xen_intr.c       Fri Apr 03 22:20:36 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xen_intr.c,v 1.18 2019/12/23 13:35:37 thorpej Exp $    */
+/*     $NetBSD: xen_intr.c,v 1.19 2020/04/03 22:20:36 ad Exp $ */
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -30,13 +30,15 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xen_intr.c,v 1.18 2019/12/23 13:35:37 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xen_intr.c,v 1.19 2020/04/03 22:20:36 ad Exp $");
+
+#include "opt_multiprocessor.h"
 
 #include <sys/param.h>
 #include <sys/kernel.h>
 #include <sys/kmem.h>
-
 #include <sys/cpu.h>
+#include <sys/device.h>
 
 #include <xen/evtchn.h>
 #include <xen/xenfunc.h>
@@ -67,6 +69,10 @@
 #include <dev/pci/ppbreg.h>
 #endif
 
+#if defined(MULTIPROCESSOR)
+static const char *xen_ipi_names[XEN_NIPIS] = XEN_IPI_NAMES;
+#endif
+
 /*
  * Restore a value to cpl (unmasking interrupts).  If any unmasked
  * interrupts are pending, call Xspllower() to process them.
@@ -369,6 +375,12 @@
            INTRSTACKSIZE - 33 * sizeof(register_t);
 #endif
 
+#ifdef MULTIPROCESSOR
+       for (i = 0; i < XEN_NIPIS; i++)
+               evcnt_attach_dynamic(&ci->ci_ipi_events[i], EVCNT_TYPE_MISC,
+                   NULL, device_xname(ci->ci_dev), xen_ipi_names[i]);
+#endif
+
        ci->ci_idepth = -1;
 }
 



Home | Main Index | Thread Index | Old Index