25.3. Enabling DTrace Support

To enable support for DTrace, add the following lines to the kernel configuration file:

options KDTRACE_HOOKS options DDB_CTF


Users of the AMD64 architecture will want to add the following line to their kernel configuration file:


This option provides support for the FBT feature. DTrace will work without this option; however, there will be limited support for function boundary tracing.

All sources must be rebuilt and installed with CTF options.


Starting from 10.0, the following steps are not needed any more as the WITH_CTF option is included in the GENERIC kernel configuration.

To accomplish this task, rebuild the FreeBSD sources using:

# cd /usr/src # make WITH_CTF=1 kernel

The system will need to be restarted.

After rebooting and allowing the new kernel to be loaded into memory, support for the Korn shell should be added. This is needed as the DTraceToolkit has several utilities written in ksh. Install the shells/ksh93. It is also possible to run these tools under shells/pdksh or shells/mksh.

Finally, obtain the current DTraceToolkit. If you are running FreeBSD 10, you will find the DTraceToolkit in /usr/share/dtrace. Otherwise, you can install the DTraceToolkit using the sysutils/DTraceToolkit port.

All FreeBSD documents are available for download at http://ftp.FreeBSD.org/pub/FreeBSD/doc/

Questions that are not answered by the documentation may be sent to <freebsd-questions@FreeBSD.org>.

Send questions about this document to <freebsd-doc@FreeBSD.org>.