DTrace limited on Centos/Fedora

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.


The dtrace script that comes on non-Oracle linux distros is a little tool from the systemtap project. It provides only the <sys/sdt.h>-related object/header-file building functionality of solaris dtrace. It maps it to systemtap data structures, so stap -L 'process("a.out").mark("*") probes will list the instrumentation.


Now you can use BPFtrace!

https://github.com/iovisor/bpftrace

BPFtrace is a high-level tracing language for Linux enhanced Berkeley Packet Filter (eBPF) available in recent Linux kernels (4.x). BPFtrace uses LLVM as a backend to compile scripts to BPF-bytecode and makes use of BCC for interacting with the Linux BPF system, as well as existing Linux tracing capabilities: kernel dynamic tracing (kprobes), user-level dynamic tracing (uprobes), and tracepoints. The BPFtrace language is inspired by awk and C, and predecessor tracers such as DTrace and SystemTap. BPFtrace was created by Alastair Robertson.

bpftrace probe types

Old answer:

You can install the Linux port of Sun/Oracle dtrace from source here: https://github.com/dtrace4linux/linux