git: 092a543ec3d2 - main - dtrace_kinst.4: Demonstrate usage of the "regs" variable

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Tue, 28 Feb 2023 16:10:23 UTC
The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=092a543ec3d276e48da09538ae29c736fdce4631

commit 092a543ec3d276e48da09538ae29c736fdce4631
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2023-02-28 16:09:26 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2023-02-28 16:10:04 +0000

    dtrace_kinst.4: Demonstrate usage of the "regs" variable
    
    Suggested by:   Mina Galić <freebsd@igalic.co>
    Reviewed by:    christos
    Differential Revision:  https://reviews.freebsd.org/D38823
---
 share/man/man4/dtrace_kinst.4 | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/share/man/man4/dtrace_kinst.4 b/share/man/man4/dtrace_kinst.4
index 0987ba493e55..349cb1aab1dd 100644
--- a/share/man/man4/dtrace_kinst.4
+++ b/share/man/man4/dtrace_kinst.4
@@ -57,7 +57,7 @@ The provider is currently implemented only for amd64.
 .Sh EXAMPLES
 Find the offset corresponding to the third instruction in
 .Fn vm_fault
-and trace it:
+and trace it, printing the contents of the RSI register:
 .Bd -literal -offset indent
 # kgdb
 (kgdb) disas /r vm_fault
@@ -66,12 +66,12 @@ Dump of assembler code for function vm_fault:
    0xffffffff80876df1 <+1>:     48 89 e5        mov    %rsp,%rbp
    0xffffffff80876df4 <+4>:     41 57   push   %r15
 
-# dtrace -n 'kinst::vm_fault:4'
-  2  81500                       vm_fault:4
-  2  81500                       vm_fault:4
-  2  81500                       vm_fault:4
-  2  81500                       vm_fault:4
-  0  81500                       vm_fault:4
+# dtrace -n 'kinst::vm_fault:4 {printf("%#x", regs[R_RSI]);}'
+  2  81500                       vm_fault:4 0x827c56000
+  2  81500                       vm_fault:4 0x827878000
+  2  81500                       vm_fault:4 0x1fab9bef0000
+  2  81500                       vm_fault:4 0xe16cf749000
+  0  81500                       vm_fault:4 0x13587c366000
   ...
 .Ed
 .Pp