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.

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 withTopicWhat differs
FreeBSD, NetBSD-A output fileSolnix 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 --libxoFreeBSD 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 meaningOn 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 meaningSolnix 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 meaningSolnix 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
Linuxscript inputSolnix 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
Linuxsyntax-check without runningSolnix 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
Linuxbuffer optionSolnix 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 commandSolnix 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
Linuxlanguage and backendSolnix 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
Linuxrun time and map outputA 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, NetBSDsame program familyFreeBSD 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

TaskSolnixLinuxFreeBSDNetBSD
list available probesdtrace -lbpftrace -l [SEARCH]dtrace -ldtrace -l
trace from a one-liner on the command linedtrace -n 'probe { action }'bpftrace -e 'program'dtrace -n 'probe { action }'dtrace -n 'probe { action }'
run a script filedtrace -s scriptbpftrace FILENAMEdtrace -s scriptdtrace -s script
check that a program compiles without tracingdtrace -ebpftrace --dry-rundtrace -edtrace -e
trace a command and exit when it finishesdtrace -c cmdbpftrace -c COMMANDdtrace -c cmddtrace -c cmd

Standards

  • POSIX: dtrace is not a POSIX.1-2024 utility.

Writing portable scripts

  • Do not use -e, -f or -h in 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 -A output path. Solnix defaults to /kernel/drv/dtrace.conf and FreeBSD and NetBSD to /boot/dtrace.dof. Pass -o to 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.