freebsd-src/cddl
Mark Johnston 247ea4381b 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

(cherry picked from commit bdd101c4d4)
2022-10-18 09:58:11 -04:00
..
compat/opensolaris Delete obsolete Solaris compat files 2021-06-17 12:40:00 -06:00
contrib/opensolaris dtrace: Add a "regs" variable 2022-10-18 09:58:11 -04:00
lib zfs: merge openzfs/zfs@6a6bd4939 (zfs-2.1-release) into stable/13 2022-10-04 17:52:45 +02:00
sbin zfs: merge openzfs/zfs@c3b60eded (zfs-2.1-release) into stable/13 2021-06-13 05:43:03 +02:00
share zfs: merge openzfs/zfs@7d9f3ef0e (zfs-2.1-release) into stable/13 2021-06-08 17:01:18 +02:00
tests
usr.bin ctf: Link CTF toolchain man pages to ctf.5 2022-04-27 20:34:30 -04:00
usr.libexec zfs: attach zpool_influxdb to build 2021-07-10 12:26:42 +02:00
usr.sbin pkgbase: Create a FreeBSD-dwatch package 2022-01-05 18:23:49 +01:00
Makefile zfs: attach zpool_influxdb to build 2021-07-10 12:26:42 +02:00
Makefile.inc Do a sweep and remove most WARNS=6 settings 2020-10-01 01:10:51 +00:00