A while ago Jonathan Adams posted an mdb cheatsheet, summarizing the syntax and commands of the Solaris Modular Debugger. It's a pretty handy reference, and last week I used it as a handout when teaching a class that included both mdb and DTrace. Well, I have the mdb cheatsheet - what about a DTrace one?

Here is my DTrace cheatsheet, styled by Todd. This doesn't include all of DTrace - it includes what I use most frequently. As a reminder, I flicked through the DTraceToolkit to see what I frequently used in those scripts.
If you learn what everything does on that one page cheatsheet including the one-liners, you'll know a significant amount of DTrace. If something has been summarized too much on that cheatsheet, refer to the full DTrace Guide.
Thanks Brendon, this is immensely useful especially for folks who do not touch DTrace daily (or are getting old). Perhaps you also want to highlight /usr/demo/dtrace/.
Posted by Wee Yeh on November 05, 2009 at 11:18 PM PST #
flowindent is something I use pretty regularly - might be good to include in the next version.
Posted by Glynn Foster on November 06, 2009 at 09:22 AM PST #
printa is the only thing I find my self wanting to add to this.
Thank you.
Posted by Chris Gerhard on November 07, 2009 at 12:33 AM PST #
That's very useful thanks.
zonename is another useful variable I use frequently,
and the fds[] array - particularly fds[xx].fi_pathname
Posted by Andy Fiddaman on November 08, 2009 at 11:49 AM PST #
Thanks for the suggestions, and I will roll updates. I had thought of these, but maybe I can improve it anyway; comments:
* /usr/demo/dtrace - not on MacOS X when I checked. I should have a section of dirs to look in for dtrace scripts that may or may not exist; the /opt/DTT/Bin dir won't be on MacOS X anyway (many of them are in /usr/bin.)
* flowindent - this is cute, but often gets messed up on multi-CPU machines. I should think of an example that is less likely to get messed up and include it as a one-liner.
* printa - it's mentioned after printf(); maybe not clear enough.
* fds[] - I demo that in a one-liner; maybe it should go in the vars list too.
Posted by Brendan Gregg on November 10, 2009 at 11:40 AM PST #
This is great.
Thanks.
Posted by Unknown on December 04, 2009 at 02:36 PM PST #