Dtrace on Linux (Ubuntu)  


So I needed to use on Dtrace on Linux. I picked the April 2012 release of the software.

Followed these instructions from Mustali Kachwala’s blog:

$ bunzip2 < dtrace-*.bz2 | tar xvf -
$ sudo apt-get install bison
$ sudo apt-get install flex
$ sudo apt-get install zlib1g-dev
$ sudo apt-get install libelf-dev 
$ cd dtrace-[TAB]
$ make all 

$ make install failed to find gnu/stubs-32.h. As suggested on Stackoverflow, I did sudo apt-get install libc6-dev-i386. Note that sudo apt-get install libc6-dev did not work; probably Timothy’s comment in the same SO thread is a pertinent explanation. make all was successful, but notified me that build/ctfconverter did not exist, so no linux*.ctf files were produced; but that did not seem an error; just a warning.

# First, I needed to comment out the lines 
# that attempted to install *.ctf files.
$ sudo make install 
$ sudo make load

Notice that the install script installed dtrace at /usr/sbin, and not /usr/bin. This distinction is important since there is a default version of dtrace at /usr/bin/dtrace, which does NOT take most of the options that the newly compiled version of dtrace accepts.

Then & only then did the options & examples on the wiki begin to work.