Blame README

Packit c4abd9
Block IO Tracing
Packit c4abd9
----------------
Packit c4abd9
Packit c4abd9
Written by Jens Axboe <axboe@kernel.dk> (initial version and kernel support),
Packit c4abd9
Alan D. Brunelle (threading and splitup into two seperate programs),
Packit c4abd9
Nathan Scott <nathans@sgi.com> (bug fixes, process names, multiple devices)
Packit c4abd9
Also thanks to Tom Zanussi <zanussi@us.ibm.com> for good input and
Packit c4abd9
patches.
Packit c4abd9
Packit c4abd9
Packit c4abd9
Requirements
Packit c4abd9
------------
Packit c4abd9
Packit c4abd9
blktrace was integrated into the mainline kernel between 2.6.16 and 2.6.17-rc1.
Packit c4abd9
The target trace needs to run on a kernel at least that new.
Packit c4abd9
Packit c4abd9
git://git.kernel.dk/blktrace.git
Packit c4abd9
Packit c4abd9
If you don't have git, you can get hourly snapshots from:
Packit c4abd9
Packit c4abd9
http://brick.kernel.dk/snaps/
Packit c4abd9
Packit c4abd9
The snapshots include the full git object database as well. kernel.org has
Packit c4abd9
excessively long mirror times, so if you have git installed, you can pull
Packit c4abd9
the master tree from:
Packit c4abd9
Packit c4abd9
git://git.kernel.dk/blktrace.git
Packit c4abd9
Packit c4abd9
For browsing the repo over http and viewing history etc, you can direct
Packit c4abd9
your browser to:
Packit c4abd9
Packit c4abd9
http://git.kernel.dk/
Packit c4abd9
Packit c4abd9
A blktrace visualization tool, iowatcher, was added to blktrace in version
Packit c4abd9
1.1.0. It requires librsvg and either png2theora or ffmpeg to generate movies.
Packit c4abd9
Packit c4abd9
Usage
Packit c4abd9
-----
Packit c4abd9
Packit c4abd9
$ blktrace -d <dev> [ -r debug_path ] [ -o output ] [ -k ] [ -w time ]
Packit c4abd9
		    [ -a action ] [ -A action mask ]
Packit c4abd9
Packit c4abd9
	-d Use specified device. May also be given last after options.
Packit c4abd9
	-r Path to mounted debugfs, defaults to /sys/kernel/debug.
Packit c4abd9
	-o File(s) to send output to.
Packit c4abd9
	-D Directory to prepend to output file names.
Packit c4abd9
	-k Kill running trace.
Packit c4abd9
	-w Stop after defined time, in seconds.
Packit c4abd9
	-a Only trace specific actions (use more -a options to add actions).
Packit c4abd9
	   Available actions are:
Packit c4abd9
Packit c4abd9
		READ
Packit c4abd9
		WRITE
Packit c4abd9
		BARRIER
Packit c4abd9
		SYNC
Packit c4abd9
		QUEUE
Packit c4abd9
		REQUEUE
Packit c4abd9
		ISSUE
Packit c4abd9
		COMPLETE
Packit c4abd9
		FS
Packit c4abd9
		PC
Packit c4abd9
Packit c4abd9
	-A Give the trace mask directly as a number.
Packit c4abd9
Packit c4abd9
	-b Sub buffer size in KiB.
Packit c4abd9
	-n Number of sub buffers.
Packit c4abd9
	-l Run in network listen mode (blktrace server)
Packit c4abd9
	-h Run in network client mode, connecting to the given host
Packit c4abd9
	-p Network port to use (default 8462)
Packit c4abd9
	-s Disable network client use of sendfile() to transfer data
Packit c4abd9
	-V Print program version info.
Packit c4abd9
Packit c4abd9
$ blkparse -i <input> [ -o <output> ] [ -b rb_batch ] [ -s ] [ -t ] [ -q ]
Packit c4abd9
		      [ -w start:stop ] [ -f output format ] [ -F format spec ]
Packit c4abd9
		      [ -d <binary> ]
Packit c4abd9
Packit c4abd9
	-i Input file containing trace data, or '-' for stdin.
Packit c4abd9
	-D Directory to prepend to input file names.
Packit c4abd9
	-o Output file. If not given, output is stdout.
Packit c4abd9
	-b stdin read batching.
Packit c4abd9
	-s Show per-program io statistics.
Packit c4abd9
	-h Hash processes by name, not pid.
Packit c4abd9
	-t Track individual ios. Will tell you the time a request took to
Packit c4abd9
	   get queued, to get dispatched, and to get completed.
Packit c4abd9
	-q Quiet. Don't display any stats at the end of the trace.
Packit c4abd9
	-w Only parse data between the given time interval in seconds. If
Packit c4abd9
	   'start' isn't given, blkparse defaults the start time to 0.
Packit c4abd9
	-d Dump sorted data in binary format
Packit c4abd9
	-f Output format. Customize the output format. The format field
Packit c4abd9
	   identifiers are:
Packit c4abd9
Packit c4abd9
		%a	- Action
Packit c4abd9
		%c	- CPU ID
Packit c4abd9
		%C	- Task command (process) name
Packit c4abd9
		%d	- Direction (r/w)
Packit c4abd9
		%D	- Device number
Packit c4abd9
		%e	- Error number
Packit c4abd9
		%M	- Major
Packit c4abd9
		%m	- Minor
Packit c4abd9
		%N	- Number of bytes
Packit c4abd9
		%n	- Number of sectors
Packit c4abd9
		%p	- PID
Packit c4abd9
		%P	- PDU
Packit c4abd9
		%s	- Sequence number
Packit c4abd9
		%S	- Sector number
Packit c4abd9
		%t	- Time (wallclock - nanoseconds)
Packit c4abd9
		%T	- Time (wallclock - seconds)
Packit c4abd9
		%u	- Time (processing - microseconds)
Packit c4abd9
		%U	- Unplug depth
Packit c4abd9
Packit c4abd9
	-F Format specification. The individual specifiers are:
Packit c4abd9
Packit c4abd9
		A	- Remap
Packit c4abd9
		B	- Bounce
Packit c4abd9
		C	- Complete
Packit c4abd9
		D	- Issue
Packit c4abd9
		M	- Back merge
Packit c4abd9
		F	- Front merge
Packit c4abd9
		G	- Get request
Packit c4abd9
		I	- Insert
Packit c4abd9
		P	- Plug
Packit c4abd9
		Q	- Queue
Packit c4abd9
		R	- Requeue
Packit c4abd9
		S	- Sleep requests
Packit c4abd9
		T	- Unplug timer
Packit c4abd9
		U	- Unplug IO
Packit c4abd9
		W	- Bounce
Packit c4abd9
		X	- Split
Packit c4abd9
Packit c4abd9
	-v More verbose for marginal errors.
Packit c4abd9
	-V Print program version info.
Packit c4abd9
Packit c4abd9
$ verify_blkparse filename
Packit c4abd9
Packit c4abd9
	Verifies an output file from blkparse. All it does is check if
Packit c4abd9
	the events in the file are correctly time ordered. If an entry
Packit c4abd9
	is found that isn't ordered, it's dumped to stdout.
Packit c4abd9
Packit c4abd9
$ blkrawverify <dev> [<dev>...]
Packit c4abd9
Packit c4abd9
	The blkrawverify utility can be used to verify data retrieved
Packit c4abd9
	via blktrace. It will check for valid event formats, forward
Packit c4abd9
	progressing sequence numbers and time stamps, also does reasonable
Packit c4abd9
	checks for other potential issues within invidividual events.
Packit c4abd9
Packit c4abd9
	Errors found will be tracked in <dev>.verify.out.
Packit c4abd9
Packit c4abd9
If you want to do live tracing, you can pipe the data between blktrace
Packit c4abd9
and blkparse:
Packit c4abd9
Packit c4abd9
% blktrace -d <device> -o - | blkparse -i -
Packit c4abd9
Packit c4abd9
This has a small risk of displaying some traces a little out of sync, since
Packit c4abd9
it will do batch sorts of input events. Similarly, you can do traces over
Packit c4abd9
the network. The network 'server' must run:
Packit c4abd9
Packit c4abd9
% blktrace -l
Packit c4abd9
Packit c4abd9
to listen to incoming blktrace connections, while the client should use
Packit c4abd9
Packit c4abd9
% blktrace -d /dev/sda -h <server hostname>
Packit c4abd9
Packit c4abd9
to connect and transfer data over the network.
Packit c4abd9
Packit c4abd9
Packit c4abd9
Documentation
Packit c4abd9
-------------
Packit c4abd9
Packit c4abd9
A users guide is distributed with the source. It is in latex, a
Packit c4abd9
'make docs' will build a PDF in doc/. You need tetex and latex installed
Packit c4abd9
to build the document.
Packit c4abd9
Packit c4abd9
Packit c4abd9
Resources
Packit c4abd9
---------
Packit c4abd9
Packit c4abd9
vger hosts a mailing list dedicated to btrace discussion and development.
Packit c4abd9
The list is called linux-btrace@vger.kernel.org, subscribe by sending
Packit c4abd9
a mail to majordomo@vger.kernel.org with 'subscribe linux-btrace' in
Packit c4abd9
the mail body.
Packit c4abd9
Packit c4abd9
Packit c4abd9
Packit c4abd9
2006-09-05, Jens Axboe <axboe@kernel.dk>
Packit c4abd9