September 25, 2010
Rui Paulo recently committed to FreeBSD HEAD the userland DTrace support, marking the completion of this FreeBSD Foundation sponsored project. Rui summarizes his work as follows:
DTrace, which originated on Solaris 10, is a comprehensive tracing framework that allows the instrumentation of software. FreeBSD has had DTrace support since 7.0, but until now tracing userland programs was not possible. Now that this project is complete, anyone can use DTrace with userland programs.
Tracing and instrumenting userland programs is very important because it allows the understanding of what’s going on, especially on highly complex systems such as databases, web servers, and language interpreters. Since DTrace on FreeBSD now has the ability to instrument both the kernel and the userland program, you can get very meaningful data on how your program is behaving and why.
Companies building products on FreeBSD now have the ability to create better products and find about problems faster then before.
This project focused on allowing the creation of DTrace pid probes, userland statically defined probes (aka USDT), importing plockstat (a DTrace utility to measure lock contention in the pthread library), importing dtruss (a system call tracing utility similar to ktrace) and enabling FreeBSD DTrace support on MySQL and PostgreSQL.
Merges to upcoming FreeBSD releases (8.2 and 7.4) are being thought out, but it’s likely they will happen.