1 .TH BLKPARSE 1 "March 6, 2007" "blktrace git\-20070306202522" ""
5 blkparse \- produce formatted output of event streams of block devices
9 .B blkparse [ \fIoptions\fR ]
14 The \fIblkparse\fR utility will attempt to combine streams of events for
15 various devices on various CPUs, and produce a formatted output of the event
16 information. Specifically, it will take the (machine-readable) output of the
17 \fIblktrace\fR utility and convert it to a nicely formatted and human-readable
20 As with \fIblktrace\fR, some details concerning \fIblkparse\fR
21 will help in understanding the command line options presented below.
26 By default, \fIblkparse\fR expects to run in a post-processing mode; one where
27 the trace events have been saved by a previous run of blktrace, and blkparse
28 is combining event streams and dumping formatted data.
30 blkparse 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.
34 % blktrace \-d /dev/sda \-o \- | blkparse \-i \-
38 You can set how many blkparse batches event reads via the \fB\-b\fR option, the
39 default is to handle events in batches of 512.
43 If you have saved event traces in blktrace with different output names (via
44 the \fB\-o\fR option to blktrace), you must specify the same input name via the
49 The format of the output data can be controlled via the \fB\-f\fR or \fB\-F\fR
50 options \-\- see OUTPUT DESCRIPTION AND FORMATTING for details.
53 By default, blkparse sends formatted data to standard output. This may
54 be 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
66 Standard input read batching
73 Specifies base name for input files \-\- default is \fIdevice\fR.blktrace.\fIcpu\fR.
75 As noted above, specifying \fB\-i \-\fR runs in live mode with blktrace
76 (reading data from standard in).
81 \-\-format=\fItyp,fmt\fR
85 \-\-format\-spec=\fIfmt\fR
88 (See OUTPUT DESCRIPTION AND FORMATTING for details.)
90 The \-f form specifies a format for all events
92 The \-F form allows one to specify a format for a specific
93 event type. The single\-character \fItyp\fR field is one of the
94 action specifiers described in ACTION IDENTIFIERS.
101 When \-d is specified, this will stop messages from being output to the
102 file. (Can seriously reduce the size of the resultant file when using
103 the CFQ I/O scheduler.)
110 Hash processes by name, not by PID
115 \-\-output=\fIfile\fR
124 Do \fInot\fR produce text output, used for binary (\fB\-d\fR) only
129 \-\-dump\-binary=\fIfile\fR
143 \-\-per\-program\-stats
145 Displays data sorted by program
152 Display time deltas per IO
157 \-\-stopwatch=\fIspan\fR
159 Display traces for the \fIspan\fR specified \-\- where span can be:
161 \fIend\-time\fR \-\- Display traces from time 0 through \fIend\-time\fR (in ns)
165 \fIstart:end\-time\fR \-\- Display traces from time \fIstart\fR
166 through end\-time (in ns).
173 More verbose marginal on marginal errors
185 The following trace actions are recognised:
189 A previously issued request has been completed. The output will detail the
190 sector and size of that request, as well as the success or failure of it.
194 A request that previously resided on the block layer queue or in the i/o
195 scheduler has been sent to the driver.
199 A request is being sent to the i/o scheduler for addition to the internal queue
200 and later service by the driver. The request is fully formed at this time.
204 This notes intent to queue i/o at the given location. No real requests exists
209 The data pages attached to this \fIbio\fR are not reachable by the hardware
210 and must be bounced to a lower memory location. This causes a big slowdown in
211 i/o performance, since the data must be copied to/from kernel buffers. Usually
212 this can be fixed with using better hardware -- either a better i/o controller,
213 or a platform with an IOMMU.
216 \fBM -- back merge\fR
217 A previously inserted request exists that ends on the boundary of where this i/o
218 begins, so the i/o scheduler can merge them together.
221 \fBF -- front merge\fR
222 Same as the back merge, except this i/o ends where a previously inserted
226 \fBM --front or back merge\fR
230 \fBM -- front or back merge\fR
234 \fBG -- get request\fR
235 To send any type of request to a block device, a \fIstruct request\fR
236 container must be allocated first.
240 No available request structures were available, so the issuer has to wait for
245 When i/o is queued to a previously empty block device queue, Linux will plug the
246 queue in anticipation of future ios being added before this data is needed.
250 Some request data already queued in the device, start sending requests to the
251 driver. This may happen automatically if a timeout period has passed (see next
252 entry) or if a number of requests have been added to the queue.
255 \fBT -- unplug due to timer\fR
256 If nobody requests the i/o that was queued after plugging the queue, Linux will
257 automatically unplug it after a defined period has passed.
261 On raid or device mapper setups, an incoming i/o may straddle a device or
262 internal zone and needs to be chopped up into smaller pieces for service. This
263 may indicate a performance problem due to a bad setup of that raid/dm device,
264 but may also just be part of normal boundary conditions. dm is notably bad at
265 this and will clone lots of i/o.
269 For stacked devices, incoming i/o is remapped to device below it in the i/o
270 stack. The remap action details what exactly is being remapped to what.
275 .SH "OUTPUT DESCRIPTION AND FORMATTING"
277 The output from blkparse can be tailored for specific use -- in particular, to ease
278 parsing of output, and/or limit output fields to those the user wants to see. The
279 data for fields which can be output include:
282 Action, a (small) string (1 or 2 characters) -- see table below for more details
291 RWBS field, a (small) string (1-3 characters) -- see section below for more details
294 7-character string containing the major and minor numbers of
295 the event's device (separated by a comma).
301 Minor number of event's device.
304 Major number of event's device.
316 Display packet data \-\- series of hexadecimal values
325 Time stamp (nanoseconds)
331 Elapsed value in microseconds (\fI\-t\fR command line option)
334 Payload unsigned integer
337 Note that the user can optionally specify field display width, and optionally a
338 left-aligned specifier. These precede field specifiers, with a '%' character,
339 followed by the optional left-alignment specifier (\-) followed by the width (a
340 decimal number) and then the field.
342 Thus, to specify the command in a 12-character field that is left aligned:
347 .SH "ACTION IDENTIFIERS"
349 The following table shows the various actions which may be output:
352 IO was remapped to a different device
364 IO front merged with request on queue
370 IO inserted onto request queue
373 IO back merged with request on queue
379 IO handled by request queue code
385 Unplug due to timeout
394 .SH "RWBS DESCRIPTION"
396 This is a small string containing at least one character ('R' for read, 'W'
397 for write, or 'D' for block discard operation), and optionally either
398 a 'B' (for barrier operations) or 'S' (for synchronous operations).
403 The standard header (or initial fields displayed) include:
405 "%D %2c %8s %5T.%9t %5p %2a %3d"
410 Displays the event's device major/minor as: %3d,%\-3d.
413 CPU ID (2-character field).
419 5-character field for the seconds portion of the time stamp and a 9-character field for the nanoseconds in the time stamp.
422 5-character field for the process ID.
425 2-character field for one of the actions.
428 3-character field for the RWBS data.
430 Seeing this in action:
432 8,0 3 1 0.000000000 697 G W 223490 + 8 [kjournald]
434 The header is the data in this line up to the 223490 (starting block).
435 The default output for all event types includes this header.
439 .SH "DEFAULT OUTPUT PER ACTION"
441 \fBC \-\- complete\fR
443 If a payload is present, this is presented between
444 parenthesis following the header, followed by the error value.
446 If no payload is present, the sector and number of blocks are presented
447 (with an intervening plus (+) character). If the \fB\-t\fR option
448 was specified, then the elapsed time is presented. In either case,
449 it is followed by the error value for the completion.
456 \fBI \-\- inserted\fR
460 If a payload is present, the number of payload bytes
461 is output, followed by the payload in hexadecimal between parenthesis.
463 If no payload is present, the sector and number of blocks are presented
464 (with an intervening plus (+) character). If the \fB\-t\fR option was
465 specified, then the elapsed time is presented (in parenthesis). In
466 either case, it is followed by the command associated with the event
467 (surrounded by square brackets).
470 \fBF \-\- front merge\fR
472 \fBG \-\- get request\fR
474 \fBM \-\- back merge\fR
478 The starting sector and number of blocks is output
479 (with an intervening plus (+) character), followed by the command
480 associated with the event (surrounded by square brackets).
485 The command associated with the event (surrounded by
486 square brackets) is output.
491 \fBT \-\- unplug due to timer\fR
493 The command associated with the event
494 (surrounded by square brackets) is output, followed by the number of
495 requests outstanding.
500 The original starting sector followed by the new
501 sector (separated by a slash (/) is output, followed by the command
502 associated with the event (surrounded by square brackets).
507 Sector and length is output, along with the original
508 device and sector offset.
513 To trace the i/o on the device \fI/dev/hda\fB and parse the output to human
514 readable form, use the following command:
516 % blktrace \-d /dev/sda \-o \- | blkparse \-i \-
518 (see \fIblktrace\fR (8) for more information).
519 This same behaviour can be achieve with the convenience script \fIbtrace\fR.
524 has exactly the same effect as the previous command. See \fIbtrace\fR (8) for
527 To trace the i/o on a device and save the output for later processing with
528 \fIblkparse\fR, use \fIblktrace\fR like this:
530 % blktrace /dev/sda /dev/sdb
532 This will trace i/o on the devices \fI/dev/sda\fR and \fI/dev/sdb\fR and save
533 the recorded information in the files \fIsda\fR and \fIsdb\fR in the current
534 directory, for the two different devices, respectively. This trace
535 information can later be parsed by the \fIblkparse\fR utility:
539 which will output the previously recorded tracing information in human
540 readable form to stdout.
544 \fIblkparse\fR was written by Jens Axboe, Alan D. Brunelle and Nathan Scott. This
545 man page was created from the \fIblktrace\fR documentation by Bas Zoetekouw.
549 Report bugs to <linux\-btrace@vger.kernel.org>
552 Copyright \(co 2006 Jens Axboe, Alan D. Brunelle and Nathan Scott.
554 This is free software. You may redistribute copies of it under the terms of
555 the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
556 There is NO WARRANTY, to the extent permitted by law.
558 This manual page was created for Debian by Bas Zoetekouw. It was derived from
559 the documentation provided by the authors and it may be used, distributed and
560 modified under the terms of the GNU General Public License, version 2.
562 On Debian systems, the text of the GNU General Public License can be found in
563 /usr/share/common\-licenses/GPL\-2.
566 btrace (8), blktrace (8), verify_blkparse (1), blkrawverify (1), btt (1)