25.3. Enabling DTrace Support
Prev | Chapter 25. DTrace | Next

## 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 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.

Prev | Up | Next
25.2. Implementation Differences | Home | 25.4. Using DTrace

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>.