dtrace_io (4)
Leading comments
Copyright (c) 2015 Mark Johnston <markj@FreeBSD.org> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the docum...
NAME
dtrace_io - a DTrace provider for tracing events related to disk I/OSYNOPSIS
Fn io:::start struct bio * struct devstat * Fn io:::done struct bio * struct devstat *DESCRIPTION
The io provider allows the tracing of disk I/O events. The Fn 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 Fn io:::done probe fires when a I/O request is completed. Both probes take a Vt struct bio * representing the I/O request as their first argument. The second argument is a Vt struct devstat * for the underlying disk(9) object.ARGUMENTS
The fields of Vt struct bio are described in the g_bio9 manual page, and the fields of Vt struct devstat are described in the devstat(9) manual page. Translators for the Vt bufinfo_t and Vt devinfo_t D types are defined in /usr/lib/dtrace/io.dFILES
- /usr/lib/dtrace/io.d
- DTrace type and translator definitions for the io provider.
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", @); }