dtrace(8) on Solnix vs Linux and the BSDs
On Solnix, dtrace is the illumos dtrace at /usr/sbin/dtrace, the same DTrace tool that FreeBSD and NetBSD ported from Solaris. It differs from them mainly in where -A writes anonymous-tracing directives. Linux has no dtrace in the bundle, and bpftrace uses different options, with -e and -f meaning different things.
The manual pages
- Solnix: dtrace(8) from
pkgs.solnix.illumos-world-man· illumos.org - Linux: bpftrace(8) bpftrace-0.25.1 (different command, similar job)
- FreeBSD: dtrace(1) 15.1-RELEASE
- NetBSD: dtrace(1) 11.0
What Solnix runs
A default Solnix system runs the illumos dtrace at /usr/sbin/dtrace. No other variants are shipped. The Solnix page points to the Dynamic Tracing Guide for the D language, providers and bundled tools.
Differences
| Compared with | Topic | What differs |
|---|---|---|
| FreeBSD, NetBSD | -A output file | Solnix dtrace -A writes driver.conf(5) directives for dtrace(4D) to /kernel/drv/dtrace.conf by default. FreeBSD and NetBSD write to /boot/dtrace.dof by default. All of them let -o choose another file.Source: Solnix dtrace(8) -A; FreeBSD dtrace(1) -A; NetBSD dtrace(1) -A |
| FreeBSD | -d, -O and --libxo | FreeBSD dtrace has -d, which dumps the D script after syntactic transformations. Its synopsis also lists -O and --libxo. The Solnix and NetBSD synopses have none of these three, so a FreeBSD command line using them will not work there.Source: FreeBSD dtrace(1) SYNOPSIS, -d; Solnix dtrace(8) SYNOPSIS; NetBSD dtrace(1) SYNOPSIS |
| Linux | -e meaning | On Solnix, dtrace -e compiles the request, then exits before enabling any probes. On Linux, bpftrace -e PROGRAM takes the program text on the command line. Solnix dtrace takes command-line programs through -n, -f, -m, -P and -i, or from a file with -s.Source: Solnix dtrace(8) -e, SYNOPSIS; Linux bpftrace(8) -e |
| Linux | -f meaning | Solnix dtrace -f selects probes by function name, optionally qualified by provider and module. bpftrace -f FORMAT sets the output format to json or text. The dtrace text shown does not describe a JSON output mode.Source: Solnix dtrace(8) -f; Linux bpftrace(8) -f |
| Linux | -h meaning | Solnix dtrace -h generates a header file of macros for the probes in a provider definition. bpftrace -h prints the help summary.Source: Solnix dtrace(8) -h; Linux bpftrace(8) -h, --help |
| Linux | script input | Solnix dtrace reads a script with -s script. bpftrace takes the script as a positional FILENAME, and "-" means read the program from stdin. The dtrace text shown does not document reading the program from stdin.Source: Solnix dtrace(8) SYNOPSIS (-s script); Linux bpftrace(8) SYNOPSIS |
| Linux | syntax-check without running | Solnix dtrace -e verifies that programs compile without enabling the instrumentation. bpftrace --dry-run stops after attaching all probes, so it also loads and attaches them. The bpftrace text says it tests that the script can be parsed, loaded and attached.Source: Solnix dtrace(8) -e; Linux bpftrace(8) --dry-run |
| Linux | buffer option | Solnix dtrace -b bufsz sets the principal trace buffer size and accepts k, m, g or t suffixes. bpftrace -B MODE sets the output buffering mode (none, line or full), not a size.Source: Solnix dtrace(8) -b; Linux bpftrace(8) -B |
| Linux | -c child command | Solnix dtrace accepts several -c options, exits when all commands have exited, and exposes the first command's PID as $target. bpftrace -c runs one command, exposes its PID as the cpid builtin, and sends SIGTERM to the child if bpftrace exits first.Source: Solnix dtrace(8) -c; Linux bpftrace(8) -c |
| Linux | language and backend | Solnix dtrace compiles D programs and uses probe descriptions of the form provider:module:function:name. bpftrace is a separate language that uses LLVM to compile to eBPF, and its probe examples use forms like kprobe:*file*. D scripts do not run under bpftrace. Source: Solnix dtrace(8) DESCRIPTION, -n; Linux bpftrace(8) DESCRIPTION, -l |
| Linux | run time and map output | A bpftrace program runs until Ctrl-C or an exit function is called, and prints all populated maps when it exits. The Solnix dtrace text shown does not describe its exit or end-of-run output behaviour. Source: Linux bpftrace(8) SYNOPSIS; Solnix dtrace(8) DESCRIPTION |
| FreeBSD, NetBSD | same program family | FreeBSD and NetBSD describe dtrace as ported from Solaris. Their option sets match Solnix for -32/-64, -a, -b, -c, -C, -D, -e, -f and the probe-selection options. The differences are -A, plus -d, -O and --libxo on FreeBSD only.Source: FreeBSD dtrace(1) DESCRIPTION, SYNOPSIS; NetBSD dtrace(1) DESCRIPTION, SYNOPSIS; Solnix dtrace(8) SYNOPSIS |
Everyday tasks
| Task | Solnix | Linux | FreeBSD | NetBSD |
|---|---|---|---|---|
| list available probes | dtrace -l | bpftrace -l [SEARCH] | dtrace -l | dtrace -l |
| trace from a one-liner on the command line | dtrace -n 'probe { action }' | bpftrace -e 'program' | dtrace -n 'probe { action }' | dtrace -n 'probe { action }' |
| run a script file | dtrace -s script | bpftrace FILENAME | dtrace -s script | dtrace -s script |
| check that a program compiles without tracing | dtrace -e | bpftrace --dry-run | dtrace -e | dtrace -e |
| trace a command and exit when it finishes | dtrace -c cmd | bpftrace -c COMMAND | dtrace -c cmd | dtrace -c cmd |
Standards
- POSIX: dtrace is not a POSIX.1-2024 utility.
Writing portable scripts
- Do not use
-e,-for-hin scripts shared between dtrace and bpftrace: they mean different things in each. Pick the tool by checking which one is installed. - Do not hard-code the
-Aoutput path. Solnix defaults to /kernel/drv/dtrace.conf and FreeBSD and NetBSD to /boot/dtrace.dof. Pass-oto choose the file.
Every difference here is taken from the manual pages linked above: Solnix's published page, Linux (man-pages and the GNU and util-linux manuals), FreeBSD, OpenBSD and NetBSD. Each row names its source. Where a manual is silent, this page is too. Compiled 2026-10-26. Found a mistake? Mail hackers@lists.solnix.io.