4 Written by Jens Axboe <axboe@suse.de> (initial version and kernel support),
5 Alan D. Brunelle (threading and splitup into two seperate programs),
6 Nathan Scott <nathans@sgi.com> (bug fixes, process names, multiple devices)
12 You need to be running a 2.6.14-rc1 kernel or newer, with the blk-trace patch
13 included in this repository. If you forgot where you got it, the url is:
15 rsync://rsync.kernel.org/pub/scm/linux/kernel/git/axboe/blktrace.git
17 If you don't have git, you can get hourly snapshots from:
19 http://www.kernel.org/pub/linux/kernel/people/axboe/blktrace/
21 The snapshots include the full git object database as well.
27 $ blktrace -d <dev> [ -r relay_path ] [ -o output ] [ -k ] [ -w time ]
28 [ -a action ] [ -A action mask ]
30 -d Use specified device. May also be given last after options.
31 -r Path to mounted relayfs, defaults to /relay.
32 -o File(s) to send output to.
33 -k Kill running trace.
34 -w Stop after defined time, in seconds.
35 -a Only trace specific actions (use more -a options to add actions).
36 Available actions are:
49 -A Give the trace mask directly as a number.
51 $ blkparse -i <input> [ -o <output> ] [ -b rb_batch ] [ -s ] [ -t ] [ -q ]
52 [ -w start:stop ] [ -f output format ] [ -F format spec ]
54 -i Input file containing trace data, or '-' for stdin.
55 -o Output file. If not given, output is stdout.
56 -b stdin read batching.
57 -s Show per-program io statistics.
58 -t Track individual ios. Will tell you the time a request took to
59 get queued, to get dispatched, and to get completed.
60 -q Quiet. Don't display any stats at the end of the trace.
61 -w Only parse data between the given time interval in seconds. If
62 'start' isn't given, blkparse defaults the start time to 0.
63 -f Output format. Customize the output format. The format field
68 %C - Task command name
79 %t - Time (wallclock - nanoseconds)
80 %T - Time (wallclock - seconds)
81 %u - Time (processing - microseconds)
84 -F Format specification. The individual specifiers are:
91 M - Both front and back merge
100 If you want to do live tracing, you can pipe the data between blktrace
103 % blktrace -d <device> -o - | blkparse -i -
105 This has a small risk of displaying some traces a little out of sync, since
106 it will do batch sorts of input events. Similarly, you can do traces over
107 the network with eg netcat:
109 % blktrace -d /dev/sda -o - | netcat parsehost portno
110 % netcat -l -p portno tracehost | blkparse -i -
112 Which will send the traces from tracehost to parsehost over the network on
113 the defined port number.
116 20050906, Jens Axboe <axboe@suse.de>