opnsense-src/sys/cddl/dev
Mark Johnston bdd101c4d4 dtrace: Add a "regs" variable
This allows invop-based providers (i.e., fbt and kinst) to expose the
register file of the CPU at the point where the probe fired.  It does
not work for SDT providers because their probes are implemented as plain
function calls and so don't save registers.  It's not clear what
semantics "regs" should have for them anyway.

This is akin to "uregs", which nominally provides access to the
userspace registers.  In fact, DIF already had a DIF_VAR_REGS variable
defined, it was simply unimplemented.

Usage example: print the contents of %rdi upon each call to
amd64_syscall():

    fbt::amd64_syscall:entry {printf("%x", regs[R_RDI]);}

Note that the R_* constants are defined in /usr/lib/dtrace/regs_x86.d.
Currently there are no similar definitions for non-x86 platforms.

Reviewed by:	christos
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D36799
2022-10-04 13:05:54 -04:00
..
dtmalloc Adjust dtmalloc_unload() definition to avoid clang 15 warning 2022-07-19 20:37:08 +02:00
dtrace dtrace: Add a "regs" variable 2022-10-04 13:05:54 -04:00
fbt fbt/x86: Extract arg1 for return probes from the trapframe 2022-08-09 18:34:01 -04:00
profile Adjust profile_unload() definition to avoid clang 15 warning 2022-07-19 20:42:52 +02:00
sdt sdt: Create providers and probes in separate passes when loading sdt.ko 2020-12-03 17:10:00 +00:00
systrace kern: drop remaining references to removed makesyscalls.sh 2021-09-09 19:40:54 -05:00
prototype.c Adjust prototype_unload() definition to avoid clang 15 warning 2022-07-20 17:13:49 +02:00