summaryrefslogtreecommitdiff
path: root/README
blob: f41938162b197012a737bf56db867710b820b9bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
Block IO Tracing
----------------

Written by Jens Axboe <axboe@suse.de> (initial version and kernel support),
Alan D. Brunelle (threading and splitup into two seperate programs),
Nathan Scott <nathans@sgi.com> (bug fixes, process names, multiple devices)


Requirements
------------

You need to be running a 2.6.14-rc1 kernel or newer, with the blk-trace patch
included in this repository. If you forgot where you got it, the url is:

rsync://rsync.kernel.org/pub/scm/linux/kernel/git/axboe/blktrace.git

If you don't have git, you can get hourly snapshots from:

http://www.kernel.org/pub/linux/kernel/people/axboe/blktrace/

The snapshots include the full git object database as well.


Usage
-----

% blktrace -d <dev> [-o <output> -a <trace> [-a <trace>] -k]
	-a <trace> is one of: (use multiple -a options to get more)
		READ
		WRITE
		BARRIER
		SYNC
		QUEUE
		REQUEUE
		ISSUE
		COMPLETE
		FS
		PC
	-k Kill a currently running trace.
	--- run task to generate load to be traced ---
	<SIGINT to kill>
	--- Generates:
		<output>_out.[0..ncpus] : Contains binary trace data

	% blkparse -i <input> [-o <output> -s -t]
	--- Generates:
		<output>.log : Contains formatted trace data, if
		output logging is added with the -o option. Otherwise, the
		output is sent to stdout. If the -s option is used, in
		addition to per-CPU stats, per process stats are shown as well.
		The -t option will provide individual io statistics, displaying
		things like completion time, queueing time, etc.


If you want to do live tracing, you can pipe the data between blktrace
and blkparse:

% blktrace -d <device> -o - | blkparse -i -

This has a small risk of displaying some traces a little out of sync, since
it will do batch sorts of input events. Similarly, you can do traces over
the network with eg netcat:

% blktrace -d /dev/sda -o - | netcat parsehost portno
% netcat -l -p portno tracehost | blkparse -i -

Which will send the traces from tracehost to parsehost over the network on
the defined port number.


20050906, Jens Axboe <axboe@suse.de>