Analyzing data and plotting histograms

To further analyze the data, you can use btt to create a summary, or create a data plot.

Procedure

You can run the binary file that is created by blkparse through btt for further analysis:
# btt -i events.bin -o btt.out

The file btt.out.avg now contains a summary of the data. The most interesting line is the one labeled D2C. It shows the latencies for SCSI requests from the point when they were dispatched to the device driver (D) to the completion of the request (C):

==================== All Devices ====================
       ALL           MIN            AVG         MAX            N
--------------- ------------- ------------- ------------- -----------
Q2Q               0.000000072   0.000086313   5.453721801   1257686
Q2I               0.000000359   0.000000516   0.023150311   1257687
I2D               0.000000933   0.003573727   0.487170508   1267275
D2C               0.000363719   0.034028080   0.708048174   1257687
Q2C               0.000395336   0.037609824   0.708064315   1257687

btt.out_qhist.dat has histogram data about the request sizes, more specifically these are the sizes of the request initially created. The unit of the histogram buckets are blocks counts, one block has 512 bytes in Linux. btt.out_dhist.dat shows the same histogram but from the requests issued to the device driver, this means after adjacent requests have been merged. The data from btt can be plotted directly with the Grace plotting tool:

# xmgrace btt.out_qhist.dat
# xmgrace btt.out_dhist.dat

Since the output from btt is a histogram in a plain text file, the data can also be imported into other plotting tools. btt can also produce a listing showing the history of each I/O request:

btt -p per_io.dump -i events.bin -o btt.out

per_io.dump now lists this from the initial request creation (Q) to completion (C) with start address of the request on the block device (15926) and the number of 512 byte blocks (8):

8,0 : 108.544109552 Q     15926+8
      108.544112927 I     15926+8
      108.544111412 G     15926+8
      108.544115662 D     15926+8
      108.548892005 C     15926+8

A detailed description is available in the blktrace User Guide, available as blktrace.pdf in the blktrace userspace utilities.