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

version 1.9, 2014/09/10 20:42:10 version 1.16, 2017/03/22 15:56:53
Line 1 Line 1
 DTrace is a Dynamic Tracing framework developed by Sun and ported to NetBSD. It enables extensive instrumentation of the kernel and user space. See the [DTrace Community Page](http://dtrace.org) for more information. Also see [DTrace Introduction](http://dtrace.org/guide/preface.html).   DTrace is a Dynamic Tracing framework developed by Sun and ported to NetBSD. It enables extensive instrumentation of the kernel and user space. See the [DTrace Community Page](http://dtrace.org) for more information.
   Also see [DTrace Introduction](http://dtrace.org/guide/preface.html), Brendan Gregg's [DTrace one liners](http://www.brendangregg.com/DTrace/dtrace_oneliners.txt) and his notes for [DTrace on FreeBSD](https://wiki.freebsd.org/DTrace/).
   
 # Current status  # Current status
   
Line 7  DTrace is a Dynamic Tracing framework de Line 8  DTrace is a Dynamic Tracing framework de
 DTrace is a work-in-progress effort and it is for x86 systems and some arm boards.  DTrace is a work-in-progress effort and it is for x86 systems and some arm boards.
   
 * i386 and amd64  * i386 and amd64
 * evbarm  * earm* (evbarm and armv4 based ports (armv4 side requires further testing but system is built with CTF)
     * BEAGLEBONE and SHEEVAPLUG  
   
 ## Supported providers  ## Supported providers
   
 * SDT: Statically Defined Tracing  * SDT: Statically Defined Tracing
 * FBT: Function Boundary Tracing  * FBT: Function Boundary Tracing
   * Lockstat: Kernel Lock Statistics
 You can currently run a hello world DScript.   * Profile: Time based interrupt event source for Profiling
   * Syscall: System Calls
   * Syscall Linux (32bit & 64 bit): System calls via the Linux binary emulation layer
   
 ## 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 38  Candidates: Line 38  Candidates:
   
 You need the following options in your kernel:   You need the following options in your kernel: 
           
     options         INSECURE      options         KDTRACE_HOOKS   # kernel DTrace hooks
     options         KDTRACE_HOOKS   # DTrace support  
     options         MODULAR      options         MODULAR
       
   
 You also need to build distribution with the options MKDTRACE=yes.  Optionally:
   
 ##  Running hello world       options         INSECURE   # permit modules to loaded from user space once system has gone multiuser and securelevel has been raised.
   
 Load the solaris and dtrace modules, and the SDT (Statically Defined Tracing) and FBT (Function Boundary Tracing) modules:   A Distribution needs to be built with the options `MKDTRACE=yes` and `MKCTF=yes`, this is taken care of automatically and doesn't need to be specified manually. The list of platforms it is applied to automatically is set in `src/share/mk/bsd.own.mk`
       
     modload solaris  
     modload dtrace  
     modload sdt  
     modload fbt  
       
   
 Make the dtrace device node:   Set the system to load the solaris and dtrace related modules in `/etc/modules.conf`, for a list of available modules, see `/stand/$MACHINE/$VERSION/modules/`
           
     mkdir /dev/dtrace      solaris
     mknod /dev/dtrace/dtrace c dtrace 0      dtrace
       dtrace_sdt
       dtrace_fbt
       dtrace_lockstat
       dtrace_profile
       dtrace_syscall
       
   A `dtrace` device node is created automatically in `/dev/dtrace` when the modules are loaded into place.
           
   
 List the dtrace probes   List the dtrace probes 
           
     dtrace -l      dtrace -l
Line 83  List the dtrace probes  Line 81  List the dtrace probes 
         .          .
     29140       proc                                                     lwp_start      29140       proc                                                     lwp_start
     29141       proc                                                     lwp_exit      29141       proc                                                     lwp_exit
       
   
     
   
   ##  Running hello world 
   
 Put the following into the file hello.d:  Put the following into the file hello.d:
           

Removed from v.1.9  
changed lines
  Added in v.1.16


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