Diff for /wikisrc/tutorials/how_to_enable_and_run_dtrace.mdwn between versions 1.8 and 1.13

version 1.8, 2014/09/10 14:04:44 version 1.13, 2015/11/28 19:23:12
Line 19  You can currently run a hello world DScr Line 19  You can currently run a hello world DScr
   
 ## TODO for netbsd-7  ## TODO for netbsd-7
   
 * Rename provider modules to `dtrace_*.kmod`: `dtrace_fbt.kmod`, &c.  
 * Measure effect of `options KDTRACE_HOOKS` on system performance.  * Measure effect of `options KDTRACE_HOOKS` on system performance.
 * Determine whether the profile module works and list it here.  * Determine whether the profile module works and list it here.
 * Put a dtrace target in /dev/MAKEDEV.  
 * Integrate [[riz|users/riz]]'s syscall provider patch.  * Integrate [[riz|users/riz]]'s syscall provider patch.
   
 ## TODO for netbsd-6  ## TODO for netbsd-6
Line 39  Candidates: Line 37  Candidates:
 You need the following options in your kernel:   You need the following options in your kernel: 
           
     options         INSECURE      options         INSECURE
     options         KDTRACE_HOOKS   # DTrace support      options         KDTRACE_HOOKS   # kernel DTrace hooks
     options         MODULAR      options         MODULAR
           
   
 You also need to build distribution with the options MKDTRACE=yes.  You also need to build distribution with the options `MKDTRACE=yes` and `MKCTF=yes`.
   
 ##  Running hello world   ##  Running hello world 
   
Line 51  Load the solaris and dtrace modules, and Line 49  Load the solaris and dtrace modules, and
           
     modload solaris      modload solaris
     modload dtrace      modload dtrace
     modload sdt      modload dtrace_sdt
     modload fbt      modload dtrace_fbt
           
   
 Make the dtrace device node:   Make the dtrace device node: 
           
     mkdir /dev/dtrace      cd /dev
     mknod /dev/dtrace/dtrace c dtrace 0      sh MAKEDEV dtrace
           
   
 List the dtrace probes   List the dtrace probes 
Line 88  List the dtrace probes  Line 86  List the dtrace probes 
       
   
   
 Put the following into the file hello.d   Put the following into the file hello.d:
           
     BEGIN      BEGIN
     {      {
Line 106  Run the hello world script:  Line 104  Run the hello world script: 
       0      1                           :BEGIN   Hello world        0      1                           :BEGIN   Hello world
           
   
 A more complex example that traces the execution of a sleep operation in the kernel:   A more complex example that traces the execution of a sleep operation
   in the kernel. Put it in sleep.d:
           
     #pragma D option flowindent      #pragma D option flowindent
           
Line 117  A more complex example that traces the e Line 116  A more complex example that traces the e
             printf("fd: %d", arg0);              printf("fd: %d", arg0);
     }      }
           
     fbt:::      fbt::syscall:entry /self->traceme/ {}
     /self->traceme/  
     {}  
           
     fbt::syscall:return      fbt::syscall:return
     /self->traceme/      /self->traceme/
Line 129  A more complex example that traces the e Line 126  A more complex example that traces the e
     }      }
           
   
 Start the script running (dtrace -s <scriptname.d>) and then execute a sleep 2 in another shell.   Start the script running (dtrace -s sleep.d) and then execute a "sleep 2" in another shell. 

Removed from v.1.8  
changed lines
  Added in v.1.13


CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb