DTRACE_IO(4)

✨ DTRACE_IO(4) ✨

okay bestie, this one's from the Kernel Interfaces Manual and it's literally about watching your disks do stuff πŸ’…


🌸 NAME 🌸

dtrace_io β€” a DTrace provider for tracing events related to disk I/O


πŸŽ€ SYNOPSIS πŸŽ€

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

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

πŸ¦‹ DESCRIPTION πŸ¦‹

so the io provider is your backstage pass to 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, important detail β€” this happens after all GEOM(4) transformations have been performed on the request. so by the time you see it, the request is fully dressed and ready to go, no cap. ✨

The io:::done() probe fires when an I/O request is completed. it's done, it's giving closure, it's over. 🫢

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, both iconic, no notes. πŸ‘‘


πŸ’œ 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. like, go read those if you wanna know the whole tea πŸ“

Translators for the bufinfo_t and devinfo_t D types are defined in /usr/lib/dtrace/io.d. yes bestie, the translators live there. that's their home. 🏠


🌈 FILES 🌈

  • /usr/lib/dtrace/io.d β€” DTrace type and translator definitions for the io provider.

πŸ”₯ EXAMPLES πŸ”₯

here's a little script that shows a per-process breakdown of total I/O by disk device. she's cute, she's functional, she ate:

#pragma D option quiet

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

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

⭐ COMPATIBILITY ⭐

heads up bestie 🚨 This provider is not compatible with the io provider found in Solaris, because its probes use native FreeBSD argument types. different flavor, different vibe, don't mix them up.

🌸 SEE ALSO 🌸

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


🧚 HISTORY 🧚

The io provider first appeared in FreeBSD 9.2 and 10.0. she's been serving looks since way back πŸ’…


πŸ’– AUTHORS πŸ’–

This manual page was written by Mark Johnston <markj@FreeBSD.org>. king behavior, we love to see it πŸ‘‘


πŸ’€ BUGS πŸ’€

The io:::wait-start() and io:::wait-done() probes are not currently implemented on FreeBSD. so if you were looking for those, they're not here yet 😭 not me waiting for them fr fr.


and that's the whole page bestie!! this one came from the Debian crew, dated April 18, 2015, and the page itself is DTRACE_IO(4) πŸŽ€ go trace some disks, you got this πŸ’–βœ¨

πŸ“¦ where this page comes from