The DTraceToolkit is a collection of useful documented DTrace scripts, some of which originated from my original page on DTrace Tools. There are over 200 scripts in the DTraceToolkit, and each has a man page and an file of example output.
Note: This page was last updated in 2015 and is no longer maintained. It is now part of my Crypt.
Download the latest toolkit here:
- gunzip and "tar xvf" the file. cd to the toolkit directory
- Run ./install (optional, you can use the toolkit without doing this)
- Read Guide to find out how to get started
- A list of scripts is in Docs/Contents
Also see the Examples/* files for sample screenshots and descriptions.
The DTraceToolkit was a spare time project of mine I started in 2005, which was provided with no warranties or support. The scripts were intended to help users solve performance and troubleshooting issues without needing to learn DTrace, and for users who wanted to, the scripts also served as examples of DTrace to learn from. The toolkit has succeeded with these aims, and I've received thanks from many companies who have been using it. The DTraceToolkit's scripts have also been included in other products, including some versions of Mac OS X.
Specific DTraceToolkit updates:
- 05-Oct-2007: DTraceToolkit 0.99 added many scripts to demonstrate basic tracing of different languages.
- 05-Sep-2013: I wrote about DTraceToolkit 0.xx mistakes, and how I can learn from them to continue development.
- 15-May-2015: The DTraceToolkit Project Has Ended, although its scripts live on...
- 30-Jun-2016: It is now being updated by the FreeBSD folk at github.com/opendtrace/toolkit.
In 2012, I developed new DTrace-based tools for the Solaris/illumos cloud computing environment (zones/containers): the dtrace-cloud-tools collection (includes some repeats). These are my last scripts for Solaris/illumos.
My spare time has recently been spent porting my DTraceToolkit scripts to Linux. One example of this is my perf-tools collection (for ftrace and perf_events). I think the most recent updates to DTraceToolkit scripts was done by Oracle for their inclusion in Oracle Solaris 11.
I'm not anticipating updating the DTraceToolkit project again (see the 2015 blog post). I'm still doing some DTrace work, on FreeBSD, and sharing those scripts online.
This was originally written for the Solaris family of operating systems, as those were the only ones with DTrace at the time.
If you are on Mac OS X, you'll probably find dozens of these scripts have been ported (and sometimes improved) by the Apple engineers and are shipped by default in /usr/bin. You should use these versions instead. Try "man -k dtrace":
macosx# man -k dtrace bitesize.d(1m) - analyse disk I/O size by process. Uses DTrace cpuwalk.d(1m) - Measure which CPUs a process runs on. Uses DTrace creatbyproc.d(1m) - snoop creat()s by process name. Uses DTrace dappprof(1m) - profile user and lib function usage. Uses DTrace dapptrace(1m) - trace user and library function usage. Uses DTrace diskhits(1m) - disk access by file offset. Uses DTrace dispqlen.d(1m) - dispatcher queue length by CPU. Uses DTrace dtrace(1) - generic front-end to the DTrace facility dtruss(1m) - process syscall details. Uses DTrace errinfo(1m) - print errno for syscall fails. Uses DTrace execsnoop(1m) - snoop new process execution. Uses DTrace [...]
Some scripts have begun to be ported to FreeBSD as well.
This has not been tested on the DTrace for Linux ports yet - and many of the scripts probably need adjusting for OS differences (scripts that are entirely stable provider-based should just work!). Once the ports have enough stability, I'll port scripts over.
This is from the Docs/Contents file shipped with the DTraceToolkit version 0.99, which lists the scripts in the toolkit. Generally those that end in a ".d" are DTrace scripts, and those that don't are DTrace scripts wrapped in another language (eg, shell or Perl). See the Docs/Readme for instructions for finding their docs.
Some original versions of these scripts are on the remainder of this page. Updating and adding to this page became a nuisance, which is one of the reasons I rolled this up and made a toolkit.
- The DTraceToolkit page on solarisinternals.com.
- My DTrace Topics: DTraceToolkit presentation slides (PDF) from 2007.
- Stefan Parvu's DTrace and DTraceToolkit presentation slides (PDF), 2007.
- My unfinished DTraceToolkit style guide.