Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Googling suggests that DTrace is available on Linux but I can't find instructions as how to install it.

DTrace is a comprehensive dynamic tracing framework. It is designed to give operational insights that allow users to tune and troubleshoot applications and the OS itself. Special consideration has been taken to make it safe to use in a production environment. For example, there is minimal probe effect when tracing is underway, and no performance impact associated with any disabled probe; this is important since there are tens of thousands of DTrace probes that can be enabled.

share|improve this question

2 Answers 2

up vote 8 down vote accepted

You can download several versions of dtrace here. The latest version is dtrace-20110120.tar.bz2 and I found these Installation instructions:

bunzip2 < dtrace-20110120.tar.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-20110120
make all 
sudo make install
sudo make load

untested; all the packages to install there are available for Natty though

Sidenote: A comment on brainstorm claims you could do the same with these 3:

share|improve this answer
    
interesting question - this weblink says that dtrace is not available for "debian" (aka ubuntu?) - its more up-to-date than your linked instruction. webcache.googleusercontent.com/… –  fossfreedom Sep 11 '11 at 13:10
    
See the last comment on brainstorm here: brainstorm.ubuntu.com/idea/4971 No deb but it is useable on Ubuntu. –  Rinzwind Sep 11 '11 at 13:13
    
ok - hopefully the OP will test this out - +1 from me. –  fossfreedom Sep 11 '11 at 13:14
    
I also found this one brainstorm.ubuntu.com/idea/11463 ptrace, utrace and systemtap edited in as an alternative (did not try these too btw ;) ) –  Rinzwind Sep 11 '11 at 13:26

1

I found the sytemtap-sdt-dev package. From a terminal type:

sudo apt-get install systemtap-sdt-dev

This package provides dtrace.

Please note that although it's named dtrace for a reason, it's not exactly the same as the original from Solaris. You can probably do some stuff, but not all.

2

If you don't mind compiling, a more feature-complete version of dtrace is the port by Paul Fox:
ftp://crisp.dyndns-server.com/pub/release/website/dtrace/

It's pretty easy to build, see README.

3

There's also an Oracle port. But I haven't tested it and wouldn't recommend it. Apparently, it only has about 0,1 percent of the probes the Paul Fox port.

$ dtrace -l | wc -l
394267

Which is ironic, because Oracle was formerly Sun, original authors of dtrace for Solaris.

4

Note that Linux-dtrace lacks some userspace functionality that the (original) Solaris-dtrace provides. So certain uses for dtrace, such as profiling Node.js, will be complicated, if not impossible, using either clone, fork or immitation of dtrace.

share|improve this answer
    
Indeed, the version in "systemtap-sdt-dev" does not support the "-n" option –  Erel Segal Halevi Mar 12 at 18:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.