DTRACE_IO(4)

πŸ“¦
version 15.1 Β· 2 versions
, in freebsd 14.5, freebsd 15.1

πŸ’Ύ DTRACE_IO(4) πŸ’Ύ

okay bestie, so this is a page from the Kernel Interfaces Manual β€” yes, that's the manual name, we're doing kernel-interface-manual vibes today β€” and it's literally all about dtrace_io, a DTrace provider for tracing events related to disk I/O. she traces disks. she's iconic like that. πŸ¦‹


✨ NAME ✨

dtrace_io β€” a DTrace provider for tracing events related to disk I/O. that's it, that's the whole errand.


✨ SYNOPSIS ✨

io:::start(struct bio *, struct devstat *);

io:::done(struct bio *, struct devstat *);

two probes, two structs each, no cap. πŸŽ€


✨ DESCRIPTION ✨

okay so the io provider lets you trace disk I/O events, and honestly? obsessed.

The io:::start() probe fires when an I/O request is about to be sent to the backing driver of a disk(9) object. and like, the key detail: this happens after all GEOM(4) transformations have been performed on the request. so by the time start shows up, the request has already been through its whole lil glow-up. πŸ’…

The io:::done() probe fires when an I/O request is completed. that's it. finished. ate and left no crumbs.

Both probes take a struct bio * representing the I/O request as their first argument. the second argument is a struct devstat * for the underlying disk(9) object. two args, no more, no less. πŸ™ˆ


✨ ARGUMENTS ✨

The fields of struct bio are described in the g_bio(9) manual page, and the fields of struct devstat are described in the devstat(9) manual page β€” go read those if you want the full field-by-field lore, iykyk.

Translators for the bufinfo_t and devinfo_t D types are defined in /usr/lib/dtrace/io.d. so that's where that magic lives. 🧚


✨ FILES ✨

  • /usr/lib/dtrace/io.d β€” DTrace type and translator definitions for the io provider. literally the whole personality of the provider, in one file. ⭐

✨ EXAMPLES ✨

The following script shows a per-process breakdown of total I/O by disk device. it's giving main character energy, honestly:

#pragma D option quiet

io:::start
{
        @[args[1]->device_name, execname, pid] = sum(args[0]->bio_length);
}

END
{
        printf("%10s %20s %10s %15s\n", "DEVICE", "APP", "PID", "BYTES");
        printa("%10s %20s %10d %15@d\n", @);
}

DEVICE, APP, PID, BYTES β€” the four pillars of knowing what's going on with your disks. slay. πŸ”₯


✨ COMPATIBILITY ✨

This provider is not compatible with the io provider found in Solaris, because its probes use native FreeBSD argument types. so if you're coming over from Solaris expecting things to just work β€” nope, different argument types, different era. don't try it. 😭


✨ SEE ALSO ✨

dtrace(1), devstat(9), SDT(9)

(the besties you'll want to be seen with, fr fr)


✨ HISTORY ✨

The io provider first appeared in FreeBSD 9.2 and 10.0. she's been around. she's got history. periodt. πŸ‘‘


✨ AUTHORS ✨

This manual page was written by Mark Johnston <markj@FreeBSD.org>. thank you Mark, king behavior. 🫢


✨ BUGS ✨

The io:::wait-start() and io:::wait-done() probes are not currently implemented on FreeBSD. so if you go looking for them β€” they're not there yet, bestie. πŸ’€

lowkey important: don't script against wait-start or wait-done expecting them to fire, because they literally don't exist here yet. πŸ™ˆ

🌸 ok bye, this page was from Debian, dated October 26, 2025, and it lives in the Kernel Interfaces Manual β€” mwah, go trace some disks, ily, no cap πŸ’œ

πŸ“¦ where this page comes from