DTrace

Overlay repository
The ebuilds for dtrace are placed (in time of writing) in github repository.

https://github.com/robertek/dtrace-portage-overlay

To activate the repository just add new repository configuration to your portage config.

Then sync portage tree.

Installation
DTrace support on Gentoo consists of kernel sources with patches and userspace utilities. It is packed in 3 packages:
 * libctf => library for CTF debug info handling, needed for both the kernel and user utilities
 * dtrace-user => userspace part, mainly the dtrace(1) command and libdtrace
 * dtrace-sources => kernel 4.14.x sources containing dtrace patches and working initial .config

The default installation can be done installing just the dtrace-user:

Kernel
Build the kernel your way. The main difference to normal building is executing "make ctf" before kernel installation. This will generate CTF debug data for dtrace to work.

Example steps:

Test it
When everything passed correctly you may try some basic dtrace oneliner.

To start learning DTrace check some informative guides:


 * https://wiki.freebsd.org/DTrace
 * http://dtrace.org/blogs/about/