DTrace/FreeBSD source snapshot

John Birrell jb at what-creek.com
Fri Feb 1 01:35:40 PST 2008

[ amd64 and i386 users only ]

Here is a link to a current snapshot containing DTrace:


It's a big file, but for anyone who is interested, I can provide
diffs in future from it.

The source builds like a normal FreeBSD buildworld/buildkernel.

If you want debug symbols built in, you must do it by setting
DEBUG_FLAGS=-g in /etc/make.conf. Just trying to set the default
CFLAGS to include -g won't work because the CTF tools (which
create the CTF ELF segment that DTrace uses) will compile with
-g anyway, and only if you have set DEBUG_FLAGS=-g will it leave
the debug ELF sections, otherwise they will be deleted as part
of the conversion.

A "make universe" will work across all architectures. The machine
dependent support for the kernel modules is only present for
amd64 and i386. i386 needs more asm code to support the exceptions
that the Function Boundary Trace (fbt) provider uses.

The DTrace Test Suite can be run:

cd src/tools/test/dtrace
make cleandir && make obj && make all

On amd64 all 822 tests should pass. Beware of the stress that some 
of the tests place the system under. It is best to avoid running too
many other resource hungry apps at the same time. Also consider
the likelihood of the system locking up. This is Alpha quality. :-)

You can read the DTrace documentation online here:


or you download the PDF file from there too.

You can load the DTrace kernel modules from the bootloader. There
are menu uptions for both single- and multi-user mode there.

Alternately you can "kldload dtraceall" to load the full DTrace
kernel module set.

With the modules loaded, you are ready to run the (superuser) "dtrace"
command line program.... see the documentation.


John Birrell

More information about the freebsd-current mailing list