Appendix D. DTrace One-Liners

This appendix contains some handy DTrace one-liners. Apart from being useful in themselves, they can help you learn DTrace, one line at a time. Some of these were demonstrated in previous chapters. Many may not work right away; they may depend on the presence of certain providers, or on a specific kernel version.

See Chapter 4, Observability Tools, for an introduction to DTrace.

syscall Provider

List syscall provider entry probes:

dtrace -ln syscall:::entry

Count syscalls by process name:

dtrace -n 'syscall:::entry { @[execname] = count(); }'

Count syscalls by syscall name:

dtrace -n 'syscall:::entry { @[probefunc] = count(); }'

Count syscalls by ...

Get Systems Performance: Enterprise and the Cloud now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.