In early 2004, DTrace remained nascent; while Mike Shapiro, Adam Leventhal, and I had completed our initial implementation in late 2003, it still had substantial gaps (for example, we had not yet completed user-level instrumentation on x86), many missing providers, and many features yet to be discovered. In part because we were still finishing it, we had only just started to publicly describe what we had done—and DTrace remained almost entirely unknown outside of Sun. Around this time, I stumbled on an obscure little Solaris-based tool called psio that used the operating system’s awkward pre-DTrace instrumentation facility, TNF, to determine the top I/O-inducing processes. It must be noted that TNF— which arcanely stands for Trace Normal Form—is a baroque, brittle, pedantic framework notable only for painfully yielding a modicum of system observability where there was previously none; writing a tool to interpret TNF in this way is a task of Herculean proportions. Seeing this TNF-based tool, I knew that its author—an Australian named Brendan Gregg—must be a kindred spirit: gritty, persistent, and hell-bent on shining a light into the inky black of the system’s depths.
The Oracle Solaris DTrace feature revolutionizes the way you debug operating systems and applications. Using DTrace, you can dynamically instrument software and quickly answer virtually any question about its behavior. Now, for the first time, there's a comprehensive, authoritative guide to making the most of DTrace in any supported UNIX environment--from Oracle Solaris to OpenSolaris, Mac OS X, and FreeBSD.
Written by key contributors to the DTrace community, DTrace teaches by example, presenting scores of commands and easy-to-adapt, downloadable D scripts. These concise examples generate answers to real and useful questions, and serve as a starting point for building more complex scripts. Using them, you can start making practical use of DTrace immediately, whether you're an administrator, developer, analyst, architect, or support professional.
The authors fully explain the goals, techniques, and output associated with each script or command. Drawing on their extensive experience, they provide strategy suggestions, checklists, and functional diagrams, as well as a chapter of advanced tips and tricks. You'll learn how to
-
Write effective scripts using DTrace's D language
-
Use DTrace to thoroughly understand system performance
-
Expose functional areas of the operating system, including I/O, filesystems, and protocols
-
Use DTrace in the application and database development process
-
Identify and fix security problems with DTrace
-
Analyze the operating system kernel
-
Integrate DTrace into source code
-
Extend DTrace with other tools
This book will help you make the most of DTrace to solve problems more quickly and efficiently, and build systems that work faster and more reliably.