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

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

options         KDTRACE_FRAME

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. 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 DTrace toolkit 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 DTrace toolkit. The current version is available at http://www.opensolaris.org/os/community/dtrace/dtracetoolkit/. There is an install mechanism included; however, installation is not required to make use of the bundled utilities.

This, and other documents, can be downloaded from ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/.

For questions about FreeBSD, read the documentation before contacting <questions@FreeBSD.org>.
For questions about this documentation, e-mail <doc@FreeBSD.org>.