-
Notifications
You must be signed in to change notification settings - Fork 19
Home
This is the Linux port of the Solaris Dynamic Tracing Framework.
Please consider joining our development list: dtrace-devel at oss.oracle.com
DTrace is a userspace utility. The latest development code can be found in the 2.0-branch-dev branch of this dtrace-utils repository. The various releases can also be found here.
DTrace for Linux depends on libctf
(part of newer binutils, with full functionality in version 2.36.1 or later) or libdtrace-ctf.
While libctf is preferred, building against libdtrace-ctf is fully supported. Libdtrace-ctf can be found at:
https://github.com/oracle/libdtrace-ctf
DTrace for Linux makes use of BPF library functions that are compiled at build time. It depends on BPF support in GCC and binutils to generate the pre-compiled BPF function library.
In addition, DTrace for Linux makes use of 3 tracing support features that are not commonly available in the Linux kernel:
- CTF data generation at compile time: this provides important datatype information for kernel and kernel module symbols. (NOTE: we are going to try to upstream this next, in the Linux kernel, if accepted. 2022-11-22)
- waitfd() system call: this provides a mechanism to monitor for state changes of processes that are being traced. (NOTE: we are going to try to upstream this next, in the Linux kernel, if accepted. 2022-11-22)
- /proc/kallsyms module grouping support: this adds annotation with module names to all symbols that are part of a kernel module even if the module is configured to be compiled into the kernel proper. This allows for consistent ways to refer to probes by module and function (or probe) name. (NOTE: this is currently being upstreamed in the Linux kernel. ETA: hopefully end of 2022)
These additional support features for tracing are available at: https://github.com/oracle/dtrace-linux-kernel/tree/v2/5.14.9 (as new kernels are released we'll forward port the code, look for additional branches).
- dev: Default branch: this is where patches which are reviewed and accepted (on the dtrace-devel.oss.oracle.com mailing list) are added
- 2.0-branch-dev: Patches are merged from the dev branch into this branch when they are included into a release of DTrace
- 2.0-branch: This has the releases of DTrace for Oracle Linux. This branch includes additional patches specific to the builds for Oracle Linux.
DTrace for Linux started in 2011. Since then and until 2019, DTrace for Linux required a set of custom kernel modules and core kernel support functions for its implementation. This design continued through DTrace version 1.2.1.
That version is still maintained and it supports nearly all language features available in Solaris DTrace, and a great many of the providers, including FBT
, USDT
and pid
. Perf events are available as the perf
provider.
The source code for the kernel changes for these DTrace versions is available in the dtrace-linux-kernel Github repo in the v1/* branches, ported to the most recent versions of releases Linux kernel.
These versions of DTrace require the libdtrace-ctf type storage library.
Starting from 2020, with release 2.0.0, we have re-implemented DTrace for Linux utilizing BPF and other core kernel tracing functionality. These more recent versions of DTrace are mentioned at the beginning of this page (https://github.com/oracle/dtrace-utils/wiki/DTrace-on-Linux#source-code-and-dependencies). All DTrace functionality is being moved from kernel space to userspace, and it is being re-implemented. Please refer to the Release Notes in this wiki, to see what functionality is incrementally being added.
- Linux Plumbers Conference 2021: https://lpc.events/event/11/contributions/1082/
- Linux Plumbers Conference 2020: https://linuxplumbersconf.org/event/7/contributions/850/
- Tracing Summit San Diego 2019: https://tracingsummit.org/ts/2019/dtrace/
RPMs for Oracle Linux are available from here:
The license for the various components of DTrace, post-0.6.1, is:
- dtrace-linux-kernel (https://github.com/oracle/dtrace-linux-kernel): GPLv2
- dtrace-utils (https://github.com/oracle/dtrace-utils#1-license): UPL
- libdrace-ctf (https://github.com/oracle/libdtrace-ctf#license): either UPL or GPLv2+