From 092a543ec3d276e48da09538ae29c736fdce4631 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Tue, 28 Feb 2023 11:09:26 -0500 Subject: [PATCH] dtrace_kinst.4: Demonstrate usage of the "regs" variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Suggested by: Mina Galić 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