Source-Changes-HG archive

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

[src/trunk]: src/external/cddl/osnet/dev/fbt/aarch64 Count the number of arti...



details:   https://anonhg.NetBSD.org/src/rev/2caed908ec5f
branches:  trunk
changeset: 969211:2caed908ec5f
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Wed Feb 12 01:10:25 2020 +0000

description:
Count the number of artificial frames in aarch64 fbt probe correctly.

diffstat:

 external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c |  15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diffs (39 lines):

diff -r 6ae6e8213547 -r 2caed908ec5f external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c
--- a/external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c     Wed Feb 12 01:10:16 2020 +0000
+++ b/external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c     Wed Feb 12 01:10:25 2020 +0000
@@ -52,6 +52,17 @@
 #define        FBT_ENTRY       "entry"
 #define        FBT_RETURN      "return"
 
+/*
+ * How many artificial frames appear between dtrace_probe and the
+ * interrupted function call?
+ *
+ *     fbt_invop
+ *     dtrace_invop
+ *     dtrace_invop_start
+ *     el1_trap_exit
+ */
+#define        FBT_AFRAMES     4
+
 int
 fbt_invop(uintptr_t addr, struct trapframe *frame, uintptr_t r0)
 {
@@ -152,7 +163,7 @@
 #endif
        fbt->fbtp_name = name;
        fbt->fbtp_id = dtrace_probe_create(fbt_id, modname,
-           name, FBT_ENTRY, 3, fbt);
+           name, FBT_ENTRY, FBT_AFRAMES, fbt);
        fbt->fbtp_patchpoint = instr;
 #ifdef __FreeBSD__
        fbt->fbtp_ctl = lf;
@@ -206,7 +217,7 @@
        fbt->fbtp_name = name;
        if (retfbt == NULL) {
                fbt->fbtp_id = dtrace_probe_create(fbt_id, modname,
-                   name, FBT_RETURN, 3, fbt);
+                   name, FBT_RETURN, FBT_AFRAMES, fbt);
        } else {
                retfbt->fbtp_next = fbt;
                fbt->fbtp_id = retfbt->fbtp_id;



Home | Main Index | Thread Index | Old Index