Diff for /wikisrc/tutorials/how_to_enable_and_run_dtrace.mdwn between versions 1.5 and 1.9

version 1.5, 2014/04/03 11:55:12 version 1.9, 2014/09/10 20:42:10
Line 17  DTrace is a work-in-progress effort and  Line 17  DTrace is a work-in-progress effort and 
   
 You can currently run a hello world DScript.   You can currently run a hello world DScript. 
   
   ## TODO for netbsd-7
   
   * Rename provider modules to `dtrace_*.kmod`: `dtrace_fbt.kmod`, &c.
   * Measure effect of `options KDTRACE_HOOKS` on system performance.
   * 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.
   
   ## TODO for netbsd-6
   
   Need to identify changes to pull up to netbsd-6 and pull them up.
   Candidates:
   
   * Profile provider.
   
 # How to use  # How to use
   
 ##  Building DTrace   ##  Building DTrace 
Line 28  You need the following options in your k Line 43  You need the following options in your k
     options         MODULAR      options         MODULAR
           
   
 You also need to build distribution with the options MKMODULAR=yes and MKDTRACE=yes.   You also need to build distribution with the options MKDTRACE=yes.
   
 ##  Running hello world   ##  Running hello world 
   
Line 73  List the dtrace probes  Line 88  List the dtrace probes 
       
   
   
 Put the following into the file hello.d   Put the following into the file hello.d:
           
     BEGIN      BEGIN
     {      {
Line 91  Run the hello world script:  Line 106  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 102  A more complex example that traces the e Line 118  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 114  A more complex example that traces the e Line 128  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.5  
changed lines
  Added in v.1.9


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