I open this topic for people to share their DTrace scripts. So we can perfect our scripts and introduce DTrace to others.
You can visit DTrace - FreeBSD Wiki to see how to enable DTrace in FreeBSD and get more information on DTrace.
Addendum: The stable and unstable in the parentheses refer to whether we are using stable or unstable providers. And the number referred to the branch of FreeBSD that the script was tested on.
You can visit DTrace - FreeBSD Wiki to see how to enable DTrace in FreeBSD and get more information on DTrace.
- There are already seven example scripts in DTrace/Exmaples - FreeBSD Wiki.
- disk-io.d (unstable, 9.0) measuring disk io latencies and sizes
- vfs-io.d (stable, 9.0) measuring vfs io latencies and sizes
- crypto-lat.d (unstable, 9.0) measuring crypto latencies
- vfssnoop.d (stable, 9.0) observing file activities (open, close, read, etc) in a running system
- vfsstat.d (stable, 9.0) provide statistics for various vfs operations
- diskio2.d (unstable, 9.0) measuring disk io latencies and sizes with another approach
- malloc.d (stable, 9.0) trace memory usages
- em-intr-lat.d (unstable, 9.0) measure the latencies of em(4) handling incoming and outgoing traffic
- syscallrwbytypes.d (stable, 9.0) measures whole system read and write output that using syscall(2)s (network include)
- diskflushlat.d (unstable, 9.0) measures disk cache flush latencies and log anomalies to /var/log/messages
Addendum: The stable and unstable in the parentheses refer to whether we are using stable or unstable providers. And the number referred to the branch of FreeBSD that the script was tested on.