mirror of
https://github.com/opnsense/src.git
synced 2026-06-04 14:26:03 -04:00
dtrace/profile: Set t_dtrace_trapframe for profile probes
profile provider probes fire in the context of a timer interrupt. Thus, the "regs" action can make use of the interrupt trap frame to get register values when the interrupt happened in kernel mode. Make that trap frame available when possible so that "regs" works more or less as it already does with the fbt and kinst providers. MFC after: 1 week
This commit is contained in:
parent
e5b33e6eef
commit
7d35b38972
1 changed files with 6 additions and 1 deletions
|
|
@ -57,6 +57,8 @@
|
|||
#include <sys/dtrace.h>
|
||||
#include <sys/dtrace_bsd.h>
|
||||
|
||||
#include <cddl/dev/dtrace/dtrace_cddl.h>
|
||||
|
||||
#define PROF_NAMELEN 15
|
||||
|
||||
#define PROF_PROFILE 0
|
||||
|
|
@ -245,12 +247,15 @@ profile_probe(profile_probe_t *prof, hrtime_t late)
|
|||
if (frame != NULL) {
|
||||
if (TRAPF_USERMODE(frame))
|
||||
upc = TRAPF_PC(frame);
|
||||
else
|
||||
else {
|
||||
pc = TRAPF_PC(frame);
|
||||
td->t_dtrace_trapframe = frame;
|
||||
}
|
||||
} else if (TD_IS_IDLETHREAD(td))
|
||||
pc = (uintfptr_t)&cpu_idle;
|
||||
|
||||
dtrace_probe(prof->prof_id, pc, upc, late, 0, 0);
|
||||
td->t_dtrace_trapframe = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
Loading…
Reference in a new issue