Commit | Line | Data |
---|---|---|
d0ca268b JA |
1 | Block IO Tracing |
2 | ---------------- | |
3 | ||
4 | Written by Jens Axboe <axboe@suse.de> (initial version and kernel support) and | |
5 | Alan D. Brunelle (threading and splitup into two seperate programs). | |
6 | ||
7 | ||
c1bd9d09 JA |
8 | Requirements |
9 | ------------ | |
10 | ||
56c7d54d JA |
11 | You need to be running a 2.6.13-mm1 kernel with the blk-trace patch |
12 | included in this repository. If you forgot where you got it, the url is: | |
c1bd9d09 JA |
13 | |
14 | rsync://rsync.kernel.org/pub/scm/linux/kernel/git/axboe/blktrace.git | |
15 | ||
6432fd98 JA |
16 | If you don't have git, you can get hourly snapshots from: |
17 | ||
18 | http://www.kernel.org/pub/linux/kernel/people/axboe/blktrace/ | |
19 | ||
20 | The snapshots include the full git object database as well. | |
21 | ||
c1bd9d09 JA |
22 | |
23 | Usage | |
24 | ----- | |
25 | ||
152f6476 | 26 | % blktrace -d <dev> [-o <output> -a <trace> [-a <trace>] -k] |
d0009925 JA |
27 | -a <trace> is one of: (use multiple -a options to get more) |
28 | READ | |
29 | WRITE | |
30 | BARRIER | |
31 | SYNC | |
32 | QUEUE | |
33 | REQUEUE | |
34 | ISSUE | |
35 | COMPLETE | |
36 | FS | |
37 | PC | |
152f6476 | 38 | -k Kill a currently running trace. |
d0ca268b JA |
39 | --- run task to generate load to be traced --- |
40 | <SIGINT to kill> | |
41 | --- Generates: | |
d0009925 | 42 | <output>_out.[0..ncpus] : Contains binary trace data |
d0ca268b | 43 | |
152f6476 | 44 | % blkparse -i <input> [-o <output> -s] |
d0ca268b | 45 | --- Generates: |
152f6476 JA |
46 | <output>.log : Contains formatted trace data, if |
47 | output logging is added with the -o option. Otherwise, the | |
48 | output is sent to stdout. If the -s option is used, in | |
49 | addition to per-CPU stats, per process stats are shown as well. | |
c1bd9d09 JA |
50 | |
51 | ||
d0009925 JA |
52 | If you want to do live tracing, you can pipe the data between blktrace |
53 | and blkparse: | |
54 | ||
55 | % blktrace -d <device> -o - | blkparse -i - | |
56 | ||
57 | This has a small risk of displaying some traces a little out of sync, since | |
58 | it will do batch sorts of input events. Similarly, you can do traces over | |
59 | the network with eg netcat: | |
60 | ||
61 | % blktrace -d /dev/sda -o - | netcat parsehost portno | |
ebc37a0b | 62 | % netcat -l -p portno tracehost | blkparse -i - |
d0009925 JA |
63 | |
64 | Which will send the traces from tracehost to parsehost over the network on | |
65 | the defined port number. | |
66 | ||
67 | ||
68 | 20050906, Jens Axboe <axboe@suse.de> | |
c1bd9d09 | 69 |