2 - blktrace receives data from the kernel in buffers passed up through the debug file system (relay). Each device being traced has a file created in the mounted directory for the debugfs, which defaults to /sys/kernel/debug -- this can be overridden with the -r command line argument.
2 - blktrace defaults to collecting all events that can be traced. To limit the events being captured, you can specify one or more filter masks via the -a option. Alternatively, one may specify the entire mask utilising a hexadecimal value that is version-specific. (Requires understanding of the internal representation of the filter mask.)
2 - As noted above, the events are passed up via a series of buffers stored into debugfs files. The size and number of buffers can be specified via the -b and -n arguments respectively.
2 - blktrace stores the extracted data into files stored in the local directory. The format of the file names is (by default) device.blktrace.cpu, where device is the base device name (e.g, if we are tracing /dev/sda, the base device name would be sda); and cpu identifies a CPU for the event stream. The device portion of the event file name can be changed via the -o option.
2 - blktrace may also be run concurrently with blkparse to produce live output -- to do this specify -o - for blktrace.
2 - The default behaviour for blktrace is to run forever until explicitly killed by the user (via a control-C, or kill utility invocation). There are two ways to modify this:
5 1. You may utilise the blktrace utility itself to kill a running trace -- via the -k option.
5 2. You can specify a run-time duration for blktrace via the -w option -- then blktrace will run for the specified number of seconds, and then halt.
--set-mask=hex-mask
Set filter mask to hex-mask (see below for masks)
--act-mask=mask
Add mask to current filter (see below for masks)
--buffer-size=size
Specifies buffer size for event extraction (scaled by 1024). The default buffer size is 512KiB.
--dev=dev
Adds dev as a device to trace
--input-devs=file
Adds the devices found in file as devices to trace
--kill
Kill on-going trace
--num-sub=num-sub
Specifies number of buffers to use. blktrace defaults to 4 sub buffers.
--output=file
Prepend file to output file name(s)
--relay=rel-path
Specifies debugfs mount point
--version Outputs version
-w seconds--stopwatch=seconds
Sets run time to the number of seconds specified
barrier: barrier attribute
complete: completed by driver
fs: requests
issue: issued to driver
pc: packet command events
queue: queue operations
read: read traces
requeue: requeue operations
sync: synchronous attribute
write: write traces
notify: trace messages
This is free software. You may redistribute copies of it under the terms of the GNU General Public License <http://www.gnu.org/licenses/gpl.html>. There is NO WARRANTY, to the extent permitted by law.
This manual page was created for Debian by Bas Zoetekouw. It was derived from the documentation provided by the authors and it may be used, distributed and modified under the terms of the GNU General Public License, version 2.
On Debian systems, the text of the GNU General Public License can be found in /usr/share/common-licenses/GPL-2.