DTrace limited on Centos/Fedora

kainaw asked:

I wanted to work on a problem on a Centos 6 box. I ran dtrace and it failed. It doesn’t accept -n or -l or -P or any command line options. It claims to ONLY accept -h, -G, -C, -I, -s, and -o. I figured this must be some weird Centos thing, so I went to verify on a Fedora 22 box. Same issue. It only accepts a very limited number of command line options. I went to try an Oracle box, which is very much RedHat like Centos and similar to Fedora. It worked fine. I was able to run just dtrace and get a long list of all the command line options. I went back to Centos and Fedora. When I enter dtrace, the output is Usage /bin/dtrace [--help] [-h | -G] [-C [-I<Path>]] -s File.d [-o <File>]. So, after an hour of Googling, I’ve given up. How do you get dtrace to work properly on Centos/Fedora? I’ve tried both as root and a user. I’ve searched for packages to increase the functionality. I’ve tried removing and reinstalling dtrace. The only thing left is to remove the package and install dtrace from source.

My answer:

The dtrace you find on Oracle Linux is not the dtrace which comes with Linux systemtap and that you will find on every other Linux distribution.

Rather, it is a port of Solaris dtrace provided by Oracle and only available on Oracle Linux.

The two commands are completely different and have different purposes.

The standard Linux kernel tracing facility is known as systemtap, and Oracle’s dtrace is just a proprietary wrapper over that. You can always use systemtap directly.

View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.