Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/pic arm/pic: Sprinkle dtrace probes on interrup...



details:   https://anonhg.NetBSD.org/src/rev/36b08695c66a
branches:  trunk
changeset: 372199:36b08695c66a
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Oct 30 10:20:45 2022 +0000

description:
arm/pic: Sprinkle dtrace probes on interrupt handlers like x86.

diffstat:

 sys/arch/arm/pic/pic.c |  25 ++++++++++++++++++++-----
 1 files changed, 20 insertions(+), 5 deletions(-)

diffs (71 lines):

diff -r cd7bd516d72a -r 36b08695c66a sys/arch/arm/pic/pic.c
--- a/sys/arch/arm/pic/pic.c    Sun Oct 30 10:00:16 2022 +0000
+++ b/sys/arch/arm/pic/pic.c    Sun Oct 30 10:20:45 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pic.c,v 1.84 2022/10/29 15:13:27 riastradh Exp $       */
+/*     $NetBSD: pic.c,v 1.85 2022/10/30 10:20:45 riastradh Exp $       */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
 #include "opt_multiprocessor.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pic.c,v 1.84 2022/10/29 15:13:27 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pic.c,v 1.85 2022/10/30 10:20:45 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -47,6 +47,7 @@
 #include <sys/kmem.h>
 #include <sys/mutex.h>
 #include <sys/once.h>
+#include <sys/sdt.h>
 #include <sys/xcall.h>
 
 #include <arm/armreg.h>
@@ -94,6 +95,16 @@
 
 static int pic_init(void);
 
+SDT_PROBE_DEFINE3(sdt, kernel, intr, entry,
+    "void (*)(void *)"/*func*/,
+    "void *"/*arg*/,
+    "struct intrsource *"/*is*/);
+SDT_PROBE_DEFINE4(sdt, kernel, intr, return,
+    "void (*)(void *)"/*func*/,
+    "void *"/*arg*/,
+    "struct intrsource *"/*is*/,
+    "int"/*handled*/);
+
 #ifdef __HAVE_PIC_SET_PRIORITY
 void
 pic_set_priority(struct cpu_info *ci, int newipl)
@@ -333,7 +344,7 @@
 {
        int (*func)(void *) = is->is_func;
        void *arg = is->is_arg;
-       int ocpl, ncpl;
+       int ocpl, ncpl, handled __unused;
 
        if (__predict_false(arg == NULL)) {
                if (__predict_false(frame == NULL)) {
@@ -353,12 +364,16 @@
                KERNEL_LOCK(1, NULL);
                const u_int ci_blcnt __diagused = curcpu()->ci_biglock_count;
                const u_int l_blcnt __diagused = curlwp->l_blcnt;
-               (void)(*func)(arg);
+               SDT_PROBE3(sdt, kernel, intr, entry,  func, arg, is);
+               handled = (*func)(arg);
+               SDT_PROBE4(sdt, kernel, intr, return,  func, arg, is, handled);
                KASSERT(ci_blcnt == curcpu()->ci_biglock_count);
                KASSERT(l_blcnt == curlwp->l_blcnt);
                KERNEL_UNLOCK_ONE(NULL);
        } else {
-               (void)(*func)(arg);
+               SDT_PROBE3(sdt, kernel, intr, entry,  func, arg, is);
+               handled = (*func)(arg);
+               SDT_PROBE4(sdt, kernel, intr, return,  func, arg, is, handled);
        }
        ncpl = curcpu()->ci_cpl;
        KASSERTMSG(ocpl <= ncpl, "pic %s irq %u intrsource %s:"



Home | Main Index | Thread Index | Old Index