freebsd-dev/cddl
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
..
compat/opensolaris Delete obsolete Solaris compat files 2021-05-24 08:48:47 -06:00
contrib/opensolaris dtrace: Add a "regs" variable 2022-10-04 13:05:54 -04:00
lib libzpool: Disable -Wuse-after-free for dbuf.c. 2022-10-03 16:10:43 -07:00
sbin cddl/*: add a WITH(OUT)_DTRACE option 2022-07-06 14:03:48 +01:00
share cddl/*: add a WITH(OUT)_DTRACE option 2022-07-06 14:03:48 +01:00
tests
usr.bin zfs: merge openzfs/zfs@cb01da680 2022-07-08 00:02:36 +02:00
usr.libexec cddl/*: add a WITH(OUT)_DTRACE option 2022-07-06 14:03:48 +01:00
usr.sbin In man page cross refs to sudo, indicate it comes from ports/security/sudo. 2022-08-14 11:44:43 +02:00
Makefile zfs: attach zpool_influxdb to build 2021-07-07 20:15:12 +02:00
Makefile.inc Do a sweep and remove most WARNS=6 settings 2020-10-01 01:10:51 +00:00