dtrace_io — a DTrace provider for tracing events related to disk I/O
Contents
Arguments
The fields of structbio are described in the g_bio(9) manual page, and the fields of structdevstat are
described in the devstat(9) manual page. Translators for the bufinfo_t and devinfo_t D types are defined
in /usr/lib/dtrace/io.d.
Bugs
The io:::wait-start() and io:::wait-done() probes are not currently implemented on FreeBSD.
Debian April 18, 2015 DTRACE_IO(4)
Compatibility
This provider is not compatible with the io provider found in Solaris, as its probes use native FreeBSD
argument types.
Description
The io provider allows the tracing of disk I/O events. The io:::start() probe fires when a I/O request
is about to be sent to the backing driver of a disk(9) object. This occurs after all GEOM(4)
transformations have been performed on the request. The io:::done() probe fires when a I/O request is
completed. Both probes take a structbio* representing the I/O request as their first argument. The
second argument is a structdevstat* for the underlying disk(9) object.
Examples
The following script shows a per-process breakdown of total I/O by disk device:
#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", @);
}
Files
/usr/lib/dtrace/io.d DTrace type and translator definitions for the io provider.
History
The io provider first appeared in FreeBSD 9.2 and 10.0.
Name
dtrace_io — a DTrace provider for tracing events related to disk I/O
See Also
dtrace(1), devstat(9), SDT(9)
Synopsis
io:::start(structbio*, structdevstat*);
io:::done(structbio*, structdevstat*);
