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 πΈ
π§ 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
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright (c) 2015 Mark Johnston <markj@FreeBSD.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms