View Source

DTrace exists to help you figure out how the system works and why the system is sluggish or acting in an unexpected manner. The name is short for Dynamic Tracing: a powerful idea pioneered by DTrace. Dynamic tracing allows one to *peer into all parts of the system* \-\- kernel, device drivers, libraries, services, web servers, applications, databases \-\- without any restarts, recompilations,or overhead. DTrace is a powerful tool in any programmer's toolkit, and has been included by default with various operating systems including Illumos, Solaris, Mac OS X, FreeBSD, and QNX. A Linux port is in development.


DTrace works by dynamically patching live running instructions with instrumentation code. The DTrace facility also supports Static Tracing: where user-friendly trace points are added to code and compiled-in before deployment.

DTrace provides a language, 'D', for writing DTrace scripts and one-liners. The language is like C and awk, and provides powerful ways to filter and summarize data in-kernel before passing to user-land. This is an important feature that enables DTrace to be used in performance-sensitive production environments, as it can greatly reduce the overhead of gathering and presenting data. ...[more|http://dtrace.org/blogs/about/]





There is also a [pony|http://dtrace.org/blogs/about/dtracepony/].

h2. DTrace for Beginners

* [Tutorial: DTrace by Example|http://developers.sun.com/solaris/articles/dtrace_tutorial.html]
* [Using DTrace to Analyze Your Webstack|http://www.youtube.com/watch?v=47mgwxnbM9M] (short video)
* [Top 10 DTrace scripts for Mac OS X|http://dtrace.org/blogs/brendan/2011/10/10/top-10-dtrace-scripts-for-mac-os-x/]
* [Introducción a DTrace|http://www.youtube.com/watch?v=rM48nvJiZAQ] (in Spanish)

h2. More DTrace

* [DTrace FAQs|http://wiki.illumos.org/display/illumos/DTrace+FAQs]
* [Advanced DTrace Tips, Tricks and Gotchas|http://dtrace.org/resources/bmc/dtrace_tips.pdf]
* [DTrace: printf debugging for seventh-level wizards|http://sartak.org/talks/perl-oasis-2012/dtrace/]

h2. Books

* [DTrace Guide|http://dtrace.org/guide/preface.html] \- now ported and updated for illumos\!
* Dynamic Tracing Guide: the original reference manual, freely available as a 408 page [PDF|http://download.oracle.com/docs/cd/E19253-01/817-6223/817-6223.pdf] (2008)
* [Solaris Performance and Tools|http://www.amazon.com/Solaris-Performance-Tools-Techniques-OpenSolaris/dp/0131568191/ref=sr_1_1?s=books&ie=UTF8&qid=1328815305&sr=1-1]: takes Solaris perf analysis further with DTrace, 440 pages (2006)
* DTrace: the DTrace book of scripts and strategy, 1100 pages (2011). Read a [sample chapter on Brendan's blog|http://dtrace.org/blogs/brendan/2011/02/23/dtrace-book-sample-chapter-file-systems/]
** [Introduction to the DTrace Book|http://smartos.org/2010/10/24/introduction-to-the-dtrace-book/]
** [What's in the DTrace Book|http://www.youtube.com/watch?v=k7mwj9Km3fg]
** [Brendan's talk at BayLISA about DTrace and the DTrace book|http://dtrace.org/blogs/brendan/2011/06/28/baylisa-talk/]
** [Updated DTrace book intro, DTrace book and Solaris 11|http://dtrace.org/blogs/brendan/2011/10/02/dtrace-book-short-videos/]

h2. Videos on DTrace

* [Bryan Cantrill's Google Tech Talk|http://video.google.com/videoplay?docid=-8002801113289007228]
* [Breaking Down MySQL/Percona Query Latency With DTrace|http://dtrace.org/blogs/brendan/2011/07/06/breaking-down-mysqlpercona-query-latency-with-dtrace/]
* [Little Shop of Performance Horrors|http://smartos.org/2009/11/06/video-little-shop-of-performance-horrors/]
* [DTrace BoF at LISA10|http://smartos.org/2010/11/17/dtrace-bof-at-lisa10/]
* [Brendan Gregg on DTrace|http://www.youtube.com/playlist?list=PLE0C1BA9B7A144AE0] at the Kernel Conference Australia, 2009
* [How to Build Better Applications with Oracle Solaris DTrace|http://www.beginningwithi.com/comments/2010/10/24/how-to-build-better-applications-with-oracle-solaris-dtrace/]
* [Observing Your App and Everything Else it Runs on Using DTrace|http://www.beginningwithi.com/comments/2010/05/30/observing-your-app-and-everything-else-it-runs-on-using-dtrace/]
* [DTracing Your Website|http://www.beginningwithi.com/comments/2010/07/27/dtracing-your-website/]
* [The Problems Solaris Solves: Diagnosing Live Systems with DTrace|http://www.beginningwithi.com/comments/2010/05/26/the-problems-solaris-solves-4-diagnosing-live-systems-with-dtrace/]
* “DTrace, Goals, Successes, Failures, and Solving Problems” \- [Adam Leventhal|http://www.linkedin.com/in/adamleventhal] - [video|http://smartos.org/2013/05/30/adam-leventhal-on-dtrace/]
* “Building a monitoring framework using DTrace and MongoDB” \- [Dan Kimmel|http://www.linkedin.com/pub/dan-kimmel/4a/88a/425] \- [video|http://smartos.org/2013/06/01/building-a-monitoring-framework-using-dtrace-and-mongodb/]
* “Debugging with DTrace” \- [Max Bruning|http://www.linkedin.com/pub/max-bruning/0/337/180] \- Training Director, Joyent \- [video|http://smartos.org/2013/05/29/debugging-with-dtrace/]
* “Solving Problems with DTrace on any Platform” \- [Brendan Gregg|http://www.linkedin.com/pub/brendan-gregg/1/3a8/3/] \- [video|http://smartos.org/2013/05/28/solving-problems-with-dtrace-on-any-platform/]


h3. dtrace.conf 2012 Videos

For a good overview and wrap-up, see [Adam's blog post on dtrace.conf|http://dtrace.org/blogs/ahl/2012/04/09/dtrace-conf12-wrap-up/].


| State of the Union - [video|http://smartos.org/2012/04/05/dtrace-conf-2012-dtrace-state-of-the-union/] | [Bryan Cantrill|http://dtrace.org/blogs/bmc] |
| Setting the Agenda - [video|http://www.youtube.com/watch?v=274w2PcN66Y] | |
| User-Level CTF - [video|http://smartos.org/2012/04/07/dtrace-conf-2012-user-level-ctf/] | [Adam Leventhal|http://dtrace.org/blogs/ahl] |
| Dynamic Translators - [video|http://smartos.org/2012/04/07/dtrace-conf-2012-dynamic-translators/] | [Dave Pacheco|http://dtrace.org/blogs/dap] |
| Control flow & language enhancements - [video|http://smartos.org/2012/04/07/dtrace-conf-2012-control-flow-language-enhancements/] | [Eric Schrock|http://dtrace.org/blogs/eschrock] |
| [Carousel ride\!|http://smartos.org/2012/04/05/a-carousel-of-dtrace/] | |
| Clang Parser for DTrace - [video|http://www.youtube.com/watch?v=6NqV_Uj8Ba4] | John Thompson |
| Visualizations - [video|http://www.youtube.com/watch?v=XD5hdaWnQM4] | [Brendan Gregg|http://dtrace.org/blogs/brendan] |
| Visualizations, Enabling toolchain for seamless USDT - [video|http://www.youtube.com/watch?v=3Sqa8mmtnMM] | Theo Schlossnagle |
| Visualizations - [video|http://www.youtube.com/watch?v=-B6u6wY3Iro] \\ | [Richard Elling|http://blog.richardelling.com/] |
| [DTrace in node.js|http://mcavage.github.com/presentations/dtrace_conf_2012-04-03/] \- [video|http://www.youtube.com/watch?v=0ZMvSh7lUdM] | [Mark Cavage|https://twitter.com/mcavage] |
| [User-land probes for Erlang virtual machine|http://www.snookles.com/scott/publications/dtrace.conf-2012.erlang-vm.pdf] \- [video|http://smartos.org/2012/04/09/dtrace-conf-2012-dtrace-and-erlang/] | Scott Lystig Fritchie |
| DTrace on Linux - [video|http://www.youtube.com/watch?v=NElog3MvUC8] | Kris Van Hees |
| [ZFS DTrace provider|DOC:dtrace.conf 2012 - ZFS DTrace Provider] | [Matt Ahrens|http://blog.delphix.com/matt/] |
| DTrace on FreeBSD - [video|http://smartos.org/2012/04/09/dtrace-conf-2012-dtrace-on-freebsd/] | Ryan Stone |
| Barriers to Adoption - [video|http://www.youtube.com/watch?v=P95LHZ-WOWw] | Jarod Jenson |

h2.