gcc 4.3.2 has started to warn about:
[blktrace.git] / doc / blkparse.1
CommitLineData
98eee4e4
JA
1.TH BLKTPARSE 1 "March 6, 2007" "blktrace git\-20070306202522" ""
2
3
4.SH NAME
5blkparse \- produce formatted output of event streams of block devices
6
7
8.SH SYNOPSIS
9.B blkparse [ \fIoptions\fR ]
10.br
11
12
13.SH DESCRIPTION
14The \fIblkparse\fR utility will attempt to combine streams of events for
15various devices on various CPUs, and produce a formatted output of the event
16information. Specifically, it will take the (machine-readable) output of the
17\fIblktrace\fR utility and convert it to a nicely formatted and human-readable
18form.
19
20As with \fIblktrace\fR, some details concerning \fIblkparse\fR
21will help in understanding the command line options presented below.
22
23
24.TP 2
25\-
26By default, \fIblkparse\fR expects to run in a post-processing mode; one where
27the trace events have been saved by a previous run of blktrace, and blkparse
28is combining event streams and dumping formatted data.
29
30blkparse may be run in a live manner concurrently with blktrace by specifying
31\fB\-i \-\fR to blkparse, and combining it with the live option for blktrace.
32An example would be:
33
34 % blktrace \-d /dev/sda \-o \- | blkparse \-i \-
35
36.TP 2
37\-
38You can set how many blkparse batches event reads via the \fB\-b\fR option, the
39default is to handle events in batches of 512.
40
41.TP 2
42\-
43If you have saved event traces in blktrace with different output names (via
44the \fB\-o\fR option to blktrace), you must specify the same input name via the
45\fB\-i\fR option.
46
47.TP 2
48\-
49The format of the output data can be controlled via the \fB\-f\fR or \fB\-F\fR
50options \-\- see OUTPUT DESCRIPTION AND FORMATTING for details.
51
52.PP
53By default, blkparse sends formatted data to standard output. This may
54be changed via the \fB\-o\fR option, or text output can be disabled via the
55\fB\-O\fR option. A merged binary stream can be produced using the \fB\-d\fR
56option.
57
58
59
60.SH OPTIONS
61
62\-b \fIbatch\fR
63.br
64\-\-batch={batch}
65.RS
66Standard input read batching
67.RE
68
69\-i \fIfile\fR
70.br
71\-\-input=\fIfile\fR
72.RS
73Specifies base name for input files \-\- default is \fIdevice\fR.blktrace.\fIcpu\fR.
74
75As noted above, specifying \fB\-i \-\fR runs in live mode with blktrace
76(reading data from standard in).
77.RE
78
79\-F \fItyp,fmt\fR
80.br
81\-\-format=\fItyp,fmt\fR
82.br
83\-f \fIfmt\fR
84.br
85\-\-format\-spec=\fIfmt\fR
86.RS
87Sets output format
88(See OUTPUT DESCRIPTION AND FORMATTING for details.)
89
90The \-f form specifies a format for all events
91
92The \-F form allows one to specify a format for a specific
93event type. The single\-character \fItyp\fR field is one of the
94action specifiers described in ACTION IDENTIFIERS.
95.RE
96
97\-m
98.br
99\-\-missing
100.RS
101Print missing entries
102.RE
103
104\-h
105.br
106\-\-hash\-by\-name
107.RS
108Hash processes by name, not by PID
109.RE
110
111\-o \fIfile\fR
112.br
113\-\-output=\fIfile\fR
114.RS
115Output file
116.RE
117
118\-O
119.br
120\-\-no\-text\-output
121.RS
122Do \fInot\fR produce text output, used for binary (\fB\-d\fR) only
123.RE
124
125\-d \fIfile\fR
126.br
127\-\-dump\-binary=\fIfile\fR
128.RS
129Binary output file
130.RE
131
132\-q
133.br
134\-\-quiet
135.RS
136Quiet mode
137.RE
138
139\-s
140.br
141\-\-per\-program\-stats
142.RS
143Displays data sorted by program
144.RE
145
146\-t
147.br
148\-\-track\-ios
149.RS
150Display time deltas per IO
151.RE
152
153\-w \fIspan\fR
154.br
155\-\-stopwatch=\fIspan\fR
156.RS
157Display traces for the \fIspan\fR specified \-\- where span can be:
158.br
159\fIend\-time\fR \-\- Display traces from time 0 through \fIend\-time\fR (in ns)
160.br
161or
162.br
163\fIstart:end\-time\fR \-\- Display traces from time \fIstart\fR
164through end\-time (in ns).
165.RE
166
167\-v
168.br
169\-\-verbose
170.RS
171More verbose marginal on marginal errors
172.RE
173
174\-V
175.br
176\-\-version
177.RS
178Display version
179.RE
180
181
182.SH "TRACE ACTIONS"
183The following trace actions are recognised:
184
185.HP 4
186\fBC -- complete\fR
187A previously issued request has been completed. The output will detail the
188sector and size of that request, as well as the success or failure of it.
189
190.HP 4
191\fBD -- issued\fR
192A request that previously resided on the block layer queue or in the i/o
193scheduler has been sent to the driver.
194
195.HP 4
196\fBI -- inserted\fR
197A request is being sent to the i/o scheduler for addition to the internal queue
198and later service by the driver. The request is fully formed at this time.
199
200.HP 4
201\fBQ -- queued\fR
202This notes intent to queue i/o at the given location. No real requests exists
203yet.
204
205.HP 4
206\fBB -- bounced\fR
207The data pages attached to this \fIbio\fR are not reachable by the hardware
208and must be bounced to a lower memory location. This causes a big slowdown in
209i/o performance, since the data must be copied to/from kernel buffers. Usually
210this can be fixed with using better hardware -- either a better i/o controller,
211or a platform with an IOMMU.
212
213.HP 4
214\fBM -- back merge\fR
215A previously inserted request exists that ends on the boundary of where this i/o
216begins, so the i/o scheduler can merge them together.
217
218.HP 4
219\fBF -- front merge\fR
220Same as the back merge, except this i/o ends where a previously inserted
221requests starts.
222
223.HP 4
224\fBM --front or back merge\fR
225One of the above
226
227.HP 4
228\fBM -- front or back merge\fR
229One of the above.
230
231.HP 4
232\fBG -- get request\fR
233To send any type of request to a block device, a \fIstruct request\fR
234container must be allocated first.
235
236.HP 4
237\fBS -- sleep\fR
238No available request structures were available, so the issuer has to wait for
239one to be freed.
240
241.HP 4
242\fBP -- plug\fR
243When i/o is queued to a previously empty block device queue, Linux will plug the
244queue in anticipation of future ios being added before this data is needed.
245
246.HP 4
247\fBU -- unplug\fR
248Some request data already queued in the device, start sending requests to the
249driver. This may happen automatically if a timeout period has passed (see next
250entry) or if a number of requests have been added to the queue.
251
252.HP 4
253\fBT -- unplug due to timer\fR
254If nobody requests the i/o that was queued after plugging the queue, Linux will
255automatically unplug it after a defined period has passed.
256
257.HP 4
258\fBX -- split\fR
259On raid or device mapper setups, an incoming i/o may straddle a device or
260internal zone and needs to be chopped up into smaller pieces for service. This
261may indicate a performance problem due to a bad setup of that raid/dm device,
262but may also just be part of normal boundary conditions. dm is notably bad at
263this and will clone lots of i/o.
264
265.HP 4
266\fBA -- remap\fR
267For stacked devices, incoming i/o is remapped to device below it in the i/o
268stack. The remap action details what exactly is being remapped to what.
269
270
271
272
273.SH "OUTPUT DESCRIPTION AND FORMATTING"
274
275The output from blkparse can be tailored for specific use -- in particular, to ease
276parsing of output, and/or limit output fields to those the user wants to see. The
277data for fields which can be output include:
278
279.IP \fBa\fR 4
280Action, a (small) string (1 or 2 characters) -- see table below for more details
281
282.IP \fBc\fR 4
283CPU id
284
285.IP \fBC\fR 4
286Command
287
288.IP \fBd\fR 4
289RWBS field, a (small) string (1-3 characters) -- see section below for more details
290
291.IP \fBD\fR 4
2927-character string containing the major and minor numbers of
293the event's device (separated by a comma).
294
295.IP \fBe\fR 4
296Error value
297
298.IP \fBm\fR 4
299Minor number of event's device.
300
301.IP \fBM\fR 4
302Major number of event's device.
303
304.IP \fBn\fR 4
305Number of blocks
306
307.IP \fBN\fR 4
308Number of bytes
309
310.IP \fBp\fR 4
311Process ID
312
313.IP \fBP\fR 4
314Display packet data \-\- series of hexadecimal values
315
316.IP \fBs\fR 4
317Sequence numbers
318
319.IP \fBS\fR 4
320Sector number
321
322.IP \fBt\fR 4
323Time stamp (nanoseconds)
324
325.IP \fBT\fR 4
326Time stamp (seconds)
327
328.IP \fBu\fR 4
329Elapsed value in microseconds (\fI\-t\fR command line option)
330
331.IP \fBU\fR 4
332Payload unsigned integer
333
334.PP
335Note that the user can optionally specify field display width, and optionally a
336left-aligned specifier. These precede field specifiers, with a '%' character,
337followed by the optional left-alignment specifier (\-) followed by the width (a
338decimal number) and then the field.
339
340Thus, to specify the command in a 12-character field that is left aligned:
341
342 \-f "%\-12C"
343
344
345.SH "ACTION IDENTIFIERS"
346
347The following table shows the various actions which may be output:
348
349.IP A
350IO was remapped to a different device
351
352.IP B
353IO bounced
354
355.IP C
356IO completion
357
358.IP D
359IO issued to driver
360
361.IP F
362IO front merged with request on queue
363
364.IP G
365Get request
366
367.IP I
368IO inserted onto request queue
369
370.IP M
371IO back merged with request on queue
372
373.IP P
374Plug request
375
376.IP Q
377IO handled by request queue code
378
379.IP S
380Sleep request
381
382.IP T
383Unplug due to timeout
384
385.IP U
386Unplug request
387
388.IP X
389Split
390
391
392.SH "RWBS DESCRIPTION"
393
64c03161
DW
394This is a small string containing at least one character ('R' for read, 'W'
395for write, or 'D' for block discard operation), and optionally either
396a 'B' (for barrier operations) or 'S' (for synchronous operations).
98eee4e4
JA
397
398
399.SH "DEFAULT OUTPUT"
400
401The standard header (or initial fields displayed) include:
402
403 "%D %2c %8s %5T.%9t %5p %2a %3d"
404
405Breaking this down:
406
407.IP \fB%D\fR
408Displays the event's device major/minor as: %3d,%\-3d.
409
410.IP \fB%2c\fR
411CPU ID (2-character field).
412
413.IP \fB%8s\fR
414Sequence number
415
416.IP \fB%5T.%9t\fR
4175-character field for the seconds portion of the time stamp and a 9-character field for the nanoseconds in the time stamp.
418
419.IP \fB%5p\fR
4205-character field for the process ID.
421
422.IP \fB%2a\fR
4232-character field for one of the actions.
424
425.IP \fB%3d\fR
4263-character field for the RWBS data.
427
428Seeing this in action:
429
430 8,0 3 1 0.000000000 697 G W 223490 + 8 [kjournald]
431
432The header is the data in this line up to the 223490 (starting block).
433The default output for all event types includes this header.
434
435
436
437.SH "DEFAULT OUTPUT PER ACTION"
438
439\fBC \-\- complete\fR
440.RS 4
441If a payload is present, this is presented between
442parenthesis following the header, followed by the error value.
443
444If no payload is present, the sector and number of blocks are presented
445(with an intervening plus (+) character). If the \fB\-t\fR option
446was specified, then the elapsed time is presented. In either case,
447it is followed by the error value for the completion.
448.RE
449
450\fBB \-\- bounced\fR
451.br
452\fBD \-\- issued\fR
453.br
454\fBI \-\- inserted\fR
455.br
456\fBQ \-\- queued\fR
457.RS 4
458If a payload is present, the number of payload bytes
459is output, followed by the payload in hexadecimal between parenthesis.
460
461If no payload is present, the sector and number of blocks are presented
462(with an intervening plus (+) character). If the \fB\-t\fR option was
463specified, then the elapsed time is presented (in parenthesis). In
464either case, it is followed by the command associated with the event
465(surrounded by square brackets).
466.RE
467
468\fBF \-\- front merge\fR
469.br
470\fBG \-\- get request\fR
471.br
472\fBM \-\- back merge\fR
473.br
474\fBS \-\- sleep\fR
475.RS 4
476The starting sector and number of blocks is output
477(with an intervening plus (+) character), followed by the command
478associated with the event (surrounded by square brackets).
479.RE
480
481\fBP \-\- plug\fR
482.RS 4
483The command associated with the event (surrounded by
484square brackets) is output.
485.RE
486
487\fBU \-\- unplug\fR
488.br
489\fBT \-\- unplug due to timer\fR
490.RS 4
491The command associated with the event
492(surrounded by square brackets) is output, followed by the number of
493requests outstanding.
494.RE
495
496\fBX \-\- split\fR
497.RS 4
498The original starting sector followed by the new
499sector (separated by a slash (/) is output, followed by the command
500associated with the event (surrounded by square brackets).
501.RE
502
503\fBA \-\- remap\fR
504.RS 4
505Sector and length is output, along with the original
506device and sector offset.
507.RE
508
509
510.SH EXAMPLES
511To trace the i/o on the device \fI/dev/hda\fB and parse the output to human
512readable form, use the following command:
513
514 % blktrace \-d /dev/sda \-o \- | blkparse \-i \-
515
516(see \fIblktrace\fR (8) for more information).
517This same behaviour can be achieve with the convenience script \fIbtrace\fR.
518The command
519
520 % btrace /dev/sda
521
522has exactly the same effect as the previous command. See \fIbtrace\fR (8) for
523more information.
524
525To trace the i/o on a device and save the output for later processing with
526\fIblkparse\fR, use \fIblktrace\fR like this:
527
528 % blktrace /dev/sda /dev/sdb
529
530This will trace i/o on the devices \fI/dev/sda\fR and \fI/dev/sdb\fR and save
531the recorded information in the files \fIsda\fR and \fIsdb\fR in the current
532directory, for the two different devices, respectively. This trace
533information can later be parsed by the \fIblkparse\fR utility:
534
535 % blkparse sda sdb
536
537which will output the previously recorded tracing information in human
538readable form to stdout.
539
540
541.SH AUTHORS
542\fIblkparse\fR was written by Jens Axboe, Alan D. Brunelle and Nathan Scott. This
543man page was created from the \fIblktrace\fR documentation by Bas Zoetekouw.
544
545
546.SH "REPORTING BUGS"
547Report bugs to <linux\-btrace@vger.kernel.org>
548
549.SH COPYRIGHT
550Copyright \(co 2006 Jens Axboe, Alan D. Brunelle and Nathan Scott.
551.br
552This is free software. You may redistribute copies of it under the terms of
553the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
554There is NO WARRANTY, to the extent permitted by law.
555.br
556This manual page was created for Debian by Bas Zoetekouw. It was derived from
557the documentation provided by the authors and it may be used, distributed and
558modified under the terms of the GNU General Public License, version 2.
559.br
560On Debian systems, the text of the GNU General Public License can be found in
561/usr/share/common\-licenses/GPL\-2.
562
563.SH "SEE ALSO"
564btrace (8), blktrace (8), verify_blkparse (1), blkrawverify (1), btt (1)
565