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