Systems Performance 2nd Ed.

BPF Performance Tools book

Recent posts:
Blog index

DTrace book sample chapter: File Systems

23 Feb 2011

I originally posted this at

The long awaited DTrace book, which I posted as coming soon in September last year, is finally ready to be printed! Since then it has been through copy-edit, composition, formatting and indexing. It's taken a while, due in part to this being an 1100 page book. It's exciting to now see the final copy that will begin printing. Jim and I have also received the table of contents and a sample chapter from the final copy to share:

DTrace Book: Table of Contents PDF (16 pages)
DTrace Book: Chapter 5 File Systems PDF (108 pages)

Chapter 5 analyses file systems using DTrace, and includes scripts to trace VFS, UFS, ZFS, HFS+ and others. File system analysis is particularly important for performance investigations as this can measure response time as experienced by the application, and includes all file system I/O. This is often more relevant than looking at disk I/O, which may be asynchronous to the application (file system write flushing), and can miss issues entirerly. Slow I/O isn't always due to disks - it could be kernel lock contention, for example. If there are indeed issues at the disk level, DTrace can investigate in detail there too. Chapter 4 Disk I/O shows tracing of the lower level I/O subsystem including block devices, SCSI, SATA, IDE and SAS.

I've summarized the chapters and appendices below, with final page counts:

ADTrace Tunable Variables6
BD Language Reference14
CProvider Arguments Reference20
DDTrace on FreeBSD6
EUSDT Example12
FDTrace Error Messages10
GDTrace Cheat Sheet4

2The D Language32
3System View100
4Disk I/O140
5File Systems108
6Network Lower Level Protocols158
7Application Protocols112
13DTrace Tools40
14Tips and Tricks18

I've included the Glossary as it's a particularly important part of the book. Since we cover such a wide range of topics, readers may be exposed to unfamiliar topics with unfamiliar terminology. Jim and I wrote a longer than usual Glossary to cover all the terms, which we hope is helpful.

We'll make the scripts available to download as a tarball so that you don't need to retype the scripts from the book, or the sample PDF (copy-n-paste from the PDF doesn't work well anyway).

You can watch videos of Jim and myself talking about the book (taken roughly a year ago): Introduction to the DTrace book and What's in the DTrace book.

Update Nov 3, 2011: We have some newer videos about the DTrace book, and particularly its relevance to Oracle Solaris 11. And there's a website for the DTrace book.