[PATCH] Add support for bounce and split operations
[blktrace.git] / README
1 Block IO Tracing
2 ----------------
3
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)
7
8
9 Requirements
10 ------------
11
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:
14
15 rsync://rsync.kernel.org/pub/scm/linux/kernel/git/axboe/blktrace.git
16
17 If you don't have git, you can get hourly snapshots from:
18
19 http://www.kernel.org/pub/linux/kernel/people/axboe/blktrace/
20
21 The snapshots include the full git object database as well.
22
23
24 Usage
25 -----
26
27 $ blktrace -d <dev> [ -r relay_path ] [ -o output ] [ -k ] [ -w time ]
28                     [ -a action ] [ -A action mask ]
29
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:
37
38                 READ
39                 WRITE
40                 BARRIER
41                 SYNC
42                 QUEUE
43                 REQUEUE
44                 ISSUE
45                 COMPLETE
46                 FS
47                 PC
48
49         -A Give the trace mask directly as a number.
50
51 $ blkparse -i <input> [ -o <output> ] [ -b rb_batch ] [ -s ] [ -t ] [ -q ]
52                       [ -w start:stop ] [ -f output format ] [ -F format spec ]
53
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
64            identifiers are:
65
66                 %a      - Action
67                 %c      - CPU ID
68                 %C      - Task command name
69                 %d      - Direction (r/w)
70                 %D      - Device number
71                 %e      - Error number
72                 %M      - Major
73                 %m      - Minor
74                 %n      - Nblocks
75                 %p      - PID
76                 %P      - PDU
77                 %s      - Sequence number
78                 %S      - Sector number
79                 %t      - Time (wallclock - nanoseconds)
80                 %T      - Time (wallclock - seconds)
81                 %u      - Time (processing - microseconds)
82                 %U      - Unplug depth
83
84         -F Format specification. The individual specifiers are:
85
86                 B       - Back merge
87                 C       - Complete
88                 D       - Issue
89                 F       - Front merge
90                 G       - Get request
91                 I       - Insert
92                 M       - Both front and back merge
93                 P       - Plug
94                 Q       - Queue
95                 R       - Requeue
96                 S       - Sleep requests
97                 T       - Unplug timer
98                 U       - Unplug IO
99                 W       - Bounce
100                 X       - Split
101
102
103 If you want to do live tracing, you can pipe the data between blktrace
104 and blkparse:
105
106 % blktrace -d <device> -o - | blkparse -i -
107
108 This has a small risk of displaying some traces a little out of sync, since
109 it will do batch sorts of input events. Similarly, you can do traces over
110 the network with eg netcat:
111
112 % blktrace -d /dev/sda -o - | netcat parsehost portno
113 % netcat -l -p portno tracehost | blkparse -i -
114
115 Which will send the traces from tracehost to parsehost over the network on
116 the defined port number.
117
118
119 20050906, Jens Axboe <axboe@suse.de>
120