Home | History | Annotate | Download | only in doc
      1 \documentclass{article}
      2 \usepackage{epsfig,placeins}
      3 
      4 %
      5 % Copyright (C) 2007-2009 Alan D. Brunelle <Alan.Brunelle (a] hp.com>
      6 %
      7 %  This program is free software; you can redistribute it and/or modify
      8 %  it under the terms of the GNU General Public License as published by
      9 %  the Free Software Foundation; either version 2 of the License, or
     10 %  (at your option) any later version.
     11 %
     12 %  This program is distributed in the hope that it will be useful,
     13 %  but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 %  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 %  GNU General Public License for more details.
     16 %
     17 %  You should have received a copy of the GNU General Public License
     18 %  along with this program; if not, write to the Free Software
     19 %  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
     20 %
     21 %  vi :set textwidth=75
     22 
     23 \title{\texttt{btt} User Guide}
     24 \author{Alan D. Brunelle (Alan.Brunelle (a] hp.com)}
     25 \date{8 October 2009}
     26 
     27 \begin{document}
     28 \maketitle
     29 %--------------
     30 \section{\label{sec:intro}Introduction}
     31 
     32 \texttt{btt} is a post-processing tool for the block layer IO tracing
     33 tool called blktrace. As noted in its Users Guide, blktrace
     34 
     35   \begin{quotation}
     36     is a block layer IO tracing mechanism which provides detailed
     37     information about request queue operations up to user space.
     38   \end{quotation}
     39 
     40 blktrace is capable of producing tremendous amounts of output in the
     41 form of multiple individual traces per IO executed during the traced
     42 run. It is also capable of producing some general statistics concerning
     43 IO rates and the like. \texttt{btt} goes further and produces a variety
     44 of overall statistics about each of the individual handling of IOs, and
     45 provides data we believe is useful to plot to provide visual comparisons
     46 for evaluation.
     47 
     48 This document will discuss \texttt{btt} usage, provide some sample output,
     49 and also show some interesting plots generated from the data provided
     50 by the \texttt{btt} utility.
     51 
     52 \bigskip
     53 A short note on the ordering of this document -- the actual
     54 command-line usage section occurs relatively late in the document (see
     55 section~\ref{sec:cmd-line}), as we felt that discussing some of the
     56 capabilities and output formats would make the parameter discussion
     57 easier.
     58 
     59 \bigskip
     60   This document refers to the output formats generated by \texttt{btt}
     61   version 2.00.  However, the descriptions are general enough to cover
     62   output formats prior to that.
     63 
     64 \newpage\tableofcontents
     65 
     66 \newpage\section{\label{sec:getting-started}Getting Started}
     67 
     68   The simple pipeline to get going with \texttt{btt} is to perform the
     69   following steps:
     70 
     71   \begin{enumerate}
     72     \item Run \texttt{blktrace}, specifying whatever devices and other
     73     parameters you want. You must save the traces to disk in this step,
     74     btt does not work in live mode.
     75 
     76     \item After tracing completes, run \texttt{blkrawverify}, specifying
     77     all devices that were traced (or at least on all devices that you
     78     will use \texttt{btt} with -- section~\ref{sec:o-D} shows how you
     79     can dictate which devices to use with btt). If blkrawverify finds
     80     errors in the trace streams saved, it is best to recapture the data
     81     -- utilizing \texttt{btt} on \emph{unclean} trace files produces
     82     inconsistent results.
     83 
     84     While this step is optional, we have found that performing this
     85     helps to ensure data coming from \texttt{btt} makes the most sense.
     86 
     87     \item Run \texttt{blkparse} with the \texttt{-d} option specifying
     88     a file to store the combined binary stream. (e.g.: \texttt{blkparse
     89     -d bp.bin ...}).
     90 
     91     \texttt{blktrace} produces a series of binary files
     92     containing parallel trace streams -- one file per CPU per
     93     device. \texttt{blkparse} provides the ability to combine all the
     94     files into one time-ordered stream of traces for all devices.
     95 
     96     \item Run \texttt{btt} specifying the file produced by
     97     \texttt{blkparse} utilizing the \texttt{-i} option (e.g.: \texttt{btt
     98     -i bp.bin ...}).
     99 
    100   \end{enumerate}
    101 
    102 \newpage\section{\label{sec:output-overview}Output Overview}
    103 
    104   The major default areas of output provided by \texttt{btt}
    105   include\label{tl-defs}:
    106 
    107 \begin{description}
    108   \item[average component times across all IOs] The time line of each IO
    109   is broken down into 3 major regions:
    110 
    111     \begin{enumerate}
    112       \item Time needed to insert or merge an incoming IO onto the request
    113       queue. This is the average time from when the IO enters the block
    114       IO layer (queue trace) until it is inserted (insert trace).
    115 
    116       This is denoted as \emph{Q2I} time.
    117 
    118       This is also broken down into two component times\footnote{On
    119       occasion there are also some time spent \emph{sleeping} waiting
    120       for a request. That occurs between the Q and G operations. You
    121       will see these listed as \texttt{S2G} times.}:
    122 
    123         \begin{description}
    124 	  \item[Q2G] Time needed to \emph{get} a request (get request
    125 	  trace).
    126 
    127 	  \item[G2I] Time needed to put that request onto the request
    128 	  queue (insert trace).
    129         \end{description}
    130 
    131       For \emph{merged} requests -- an incoming request that is merged
    132       with a previously submitted request -- we calculate \emph{Q2M}, the
    133       amount of time between the queue trace and the merge trace.
    134 
    135       \item Time spent on the request queue. The average time from when
    136       the IO is inserted or merged onto the request queue, until it is
    137       issued (issue trace) to the lower level driver.
    138 
    139       Referred to as \emph{I2D} time\footnote{The \emph{issue} trace
    140       is represented by a D in the blkparse output, hence its usage in
    141       btt to refer to issue traces. Note that an I is used to refer to
    142       \emph{insert} traces.}.
    143 
    144       \item Driver and device time -- the average time from when the
    145       actual IO was issued to the driver until is completed (completion
    146       trace) back to the block IO layer.
    147 
    148       This is referred to as the \emph{D2C} time\
    149     \end{enumerate}
    150 
    151   Two other sets of results are presented in this section:
    152 
    153     \begin{enumerate}
    154       \item \emph{Q2Q} which measures the time between queue traces
    155       in the system. This provides some idea as to how quickly IOs are
    156       being handed to the block IO layer.
    157 
    158       \item \emph{Q2C} which measures the times for the complete life cycle
    159       of IOs during the run\footnote{One of the areas that needs some
    160       work in \texttt{btt} is to better understand the multiplex nature of
    161       IOs during a run. In theory, one would like ${Q2I} + {I2D} + {D2C}
    162       = {Q2C}$ however, typically there are multiple queue traces that
    163       are combined via merges into a single IO issued and completed. We
    164       currently average the queue-to-insert and queue-to-merge times,
    165       and thus tend to be quite close to the expected equation.}
    166 
    167     \end{enumerate}
    168 
    169   For each row in this output, we provide a minimum, average, maximum
    170   (which are all presented in seconds), and overall count. As an
    171   example\footnote{As with this display, the author has taken some liberty
    172   in reformatting the output for better display on the printed page.}:
    173 
    174 \begin{verbatim}
    175 ALL            MIN           AVG           MAX           N
    176 ---- ------------- ------------- ------------- -----------
    177 Q2Q    0.000000058   0.000012761   9.547941661     2262310
    178 Q2I    0.000000272   0.000005995   0.104588839     2262311
    179 I2D    0.000001446   0.094992714   0.239636864     2262311
    180 D2C    0.000193721   0.030406554   1.634221408     2262311
    181 Q2C    0.000207665   0.125405263   1.830917198     2262311
    182 \end{verbatim}
    183 
    184   When tracking \emph{device mapper} devices, we also break down the
    185   \emph{Q2A} and \emph{Q2C} times for those IOs.
    186 
    187   \item[Device Overhead]
    188 
    189   Using the data from the previous chart, we can then provide some idea
    190   as to where IO spend most of the time on average. The following output
    191   shows the percentage of time spent in each of the phases of an
    192 IO\footnote{It should be noted that incoming requests either go through:
    193 
    194 \begin{enumerate}
    195   \item Q2G + Q2I
    196 
    197   or
    198 
    199   \item Q2M
    200 \end{enumerate}
    201   before proceeding to I2D and D2C.}
    202 
    203 \begin{verbatim}
    204        DEV |       Q2G       G2I       Q2M       I2D       D2C
    205 ---------- | --------- --------- --------- --------- ---------
    206  (  8, 80) |   0.0013%   0.0004%   0.0006%  88.5005%  11.4988%
    207 ---------- | --------- --------- --------- --------- ---------
    208    Overall |   0.0003%   0.0001%   0.0041%  21.4998%  78.4958%
    209 \end{verbatim}
    210 
    211   \item[Device Merge Information]
    212 
    213   A key measurement when making changes in the system (software \emph{or}
    214   hardware) is to understand the block IO layer ends up merging incoming
    215   requests into fewer, but larger, IOs to the underlying driver. In this
    216   section, we show the number of incoming requests (Q), the number of
    217   issued requests (D) and the resultant ratio. We also provide values
    218   for the minimum, average and maximum IOs generated.
    219 
    220   Looking at the following example:
    221 
    222 \begin{verbatim}
    223        DEV |      #Q    #D Ratio | BLKmin BLKavg BLKmax   Total
    224 ---------- | ------- ----- ----- | ------ ------ ------ -------
    225  ( 68, 64) | 2262311 18178 124.5 |      2    124    128 2262382
    226 \end{verbatim}
    227 
    228   we see that (on average) the block IO layer is combining upwards of
    229   125 incoming requests into a single request down the IO stack. The
    230   resultant average IO size is 124 blocks.
    231 
    232   \item[Device Seek Information]
    233 
    234   Another useful measure is the variability in the sector distances
    235   between consecutively \emph{received -- queued} and \emph{submitted
    236   -- issued} IOs. The next two sections provides some rudimentary
    237   statistics to gauge the general nature of the sector differences
    238   between IOs. Values provided include the number of seeks (number of IOs
    239   submitted to lower level drivers), the \emph{mean} distance between
    240   IOs, the \emph{median} value for all seeks, and the \emph{mode} -
    241   the value(s) and the counts are provided for the latter.
    242 
    243   The first of the two sections displays values for Q2Q seek distances --
    244   providing a set of indicators showing how close incoming IO requests
    245   are to each other. The second section shows D2D seek distances --
    246   providing a set of indicators showing how close the IO requests are
    247   that are handled by underlying drivers.
    248 
    249 \begin{verbatim}
    250       DEV | NSEEKS    MEAN MEDIAN | MODE
    251 --------- | ------ ------- ------ | -------
    252 ( 68, 64) |  18178 19611.3      0 | 0(17522)
    253 \end{verbatim}
    254 
    255   We have almost exclusively seen median and mode values of 0, indicating
    256   that seeks tend to have an equal amount of forward and backwards
    257   seeks. The larger the count for the mode in comparison to the total
    258   number of seeks is indicative as to how many IOs are coming out of
    259   the block IO layer in adjacent sectors. (Obviously, the higher this
    260   percentage, the better the underlying subsystems can handle them.)
    261 
    262   \item[Request Queue Plug Information]
    263 
    264   During normal operation, requests queues are \emph{plugged} and during
    265   such times the IO request queue elements are not able to be processed
    266   by underlying drivers. The next section shows how often the request
    267   queue was in such a state.
    268 
    269 \begin{verbatim}
    270       DEV | # Plugs # Timer Us  | % Time Q Plugged
    271 --------- | ------- ----------  | ----------------
    272 ( 68, 64) |     833(         0) |   0.356511895%
    273 \end{verbatim}
    274 
    275   There are two major reasons why request queues are unplugged, and both
    276   are represented in the above table.
    277 
    278   \begin{enumerate}
    279     \item Explicit unplug request from some subsystem in the kernel.
    280 
    281     \item Timed unplugs, due to a request queue exceeding some temporal
    282     limit for being plugged.
    283   \end{enumerate}
    284 
    285   The total number of unplugs is equal to the number of plugs less the
    286   ones due to timer unplugs.
    287 
    288   \item[IOs per Unplug \& Unplugs-due-to-timeout]
    289 
    290   In this subsection one can see the average number of IOs on the request
    291   queue at the time of an unplug or unplug due to a timeout. The following
    292   sample shows a sample of both unplug sections:
    293 
    294 \begin{verbatim}
    295 ==================== Plug Information ====================
    296 
    297        DEV |    # Plugs # Timer Us  | % Time Q Plugged
    298 ---------- | ---------- ----------  | ----------------
    299  (  8,  0) |       1171(       123) |   0.280946640%
    300  (  8, 32) |          4(         0) |   0.000325469%
    301 ---------- | ---------- ----------  | ----------------
    302    Overall |    # Plugs # Timer Us  | % Time Q Plugged
    303    Average |        587(        61) |   0.140636055%
    304 
    305        DEV |    IOs/Unp   IOs/Unp(to)
    306 ---------- | ----------   ----------
    307  (  8,  0) |        9.2          8.8
    308  (  8, 32) |        2.5          0.0
    309 ---------- | ----------   ----------
    310        DEV |    IOs/Unp   IOs/Unp(to)
    311    Overall |        9.2          8.8
    312 \end{verbatim}
    313 
    314   This table and the preceding one have to be considered together --
    315   in the sample output in the immediately preceding table one can see
    316   how the larger number of data values for device (8,0) dominates in
    317   the overall average.
    318 
    319   \newpage\item[Active Requests At Q Information]
    320 
    321   An important consideration when analyzing block IO schedulers is to
    322   know how many requests the scheduler has to work with. The metric
    323   provided in this section details how many requests (on average) were
    324   being held by the IO scheduler when an incoming IO request was being
    325   handled. To determine this, \texttt{btt} keeps track of how many Q
    326   requests came in, and subtracts requests that have been issued (D).
    327 
    328   Here is a sample output of this sections:
    329 
    330 \begin{verbatim}
    331 ==================== Active Requests At Q Information ====================
    332 
    333        DEV |  Avg Reqs @ Q
    334 ---------- | -------------
    335  ( 65, 80) |          12.0
    336  ( 65,240) |          16.9
    337 ...
    338  ( 66,112) |          44.2
    339 ---------- | -------------
    340    Overall | Avgs Reqs @ Q
    341    Average |          17.4
    342 \end{verbatim}
    343 
    344   \item[I/O Active Period Information]
    345 
    346   In this subsection data is tabulated showing I/O activity on a
    347   per-device as well across all devices being traced. ``I/O activity''
    348   is defined as periods of time when the underlying device driver and
    349   device have at least one I/O to work upon. The values presented include:
    350 
    351   \begin{description}
    352     \item[\# Live] Number of periods of ``liveness.''
    353     \item[Avg. Act] Average length of each period ov ``liveness.''
    354     \item[Avg. !Act] Aerage length of each non-active period.
    355     \item[\% Live] Percent of total time spent with the driver/device active.
    356   \end{description}
    357 
    358   Here is a sample portion of this type of chart:
    359 
    360 \begin{verbatim}
    361        DEV |     # Live      Avg. Act     Avg. !Act % Live
    362 ---------- | ---------- ------------- ------------- ------
    363  (  8, 16) |         29   0.909596815   0.094646263  90.87
    364  (  8, 32) |        168   0.097848226   0.068231948  59.06
    365 ---------- | ---------- ------------- ------------- ------
    366  Total Sys |         33   0.799808811   0.082334758  90.92
    367 \end{verbatim}
    368 
    369   For information on generating data files that can be plotted with
    370   per-device and system-wide I/O activity see section~\ref{sec:o-Z}.
    371 
    372 \end{description}
    373 
    374 \newpage
    375 \subsection*{\label{sec:detailed-data}Detailed Data}
    376 
    377   In addition to the default sections output, if one supplies the
    378   \texttt{--all-data} or \texttt{-A} argument (see section~\ref{sec:o-A})
    379   to \texttt{btt} further sections are output:
    380 
    381 \begin{description}
    382   \item[Per Process] As traces are emitted, they are tagged with the
    383   process ID of the currently running thread in the kernel. The process
    384   names are also preserved, and mapped to the ID. For each of the parts
    385   of the time line discussed above on page~\pageref{tl-defs}, a chart is
    386   provided which breaks down the traces according to process ID (name).
    387 
    388   One must be aware, however, that the process ID may not have anything
    389   to do with the originating IO. For example, if an application is
    390   doing buffered IO, then the actual submitted IOs will most likely
    391   come from some page buffer management daemon thread (like pdflush,
    392   or kjournald for example). Similarly, completion traces are rarely
    393   (if ever?) going to be associated with the process which submitted
    394   the IO in the first place.
    395 
    396   Here is a sample portion of this type of chart, showing Q2Q times
    397   per process:
    398 
    399 \begin{verbatim}
    400           Q2Q         MIN         AVG         MAX       N
    401 ------------- ----------- ----------- ----------- -------
    402 mkfs.ext3     0.000000778 0.000009074 1.797176188 1899371
    403 mount         0.000000885 0.000672513 0.030638128      73
    404 pdflush       0.000000790 0.000006752 0.247231307  179791
    405 \end{verbatim}
    406 
    407   \item[Per Process Averages] The average columns from the above charts,
    408   are also presented in their own chart.
    409 
    410   \item[Per Device] Similar to the per-process display, \texttt{btt}
    411   will also break down the various parts of an IOs time line based upon a
    412   per-device criteria. Here's a portion of this area, displayed showing
    413   the issued to complete times (D2C).
    414 
    415 \begin{verbatim}
    416       D2C         MIN         AVG         MAX      N
    417 --------- ----------- ----------- ----------- ------
    418 ( 65, 80) 0.000140488 0.001076906 0.149739869 169112
    419 ( 65, 96) 0.000142762 0.001215221 0.173263182 155488
    420 ( 65,112) 0.000145221 0.001254966 0.124929936 165726
    421 ( 65,128) 0.000141896 0.001159596 0.775231052 169015
    422 ( 65,144) 0.000140832 0.001290985 0.211384698 210661
    423 ( 65,160) 0.000139915 0.001175554 0.073512063 133973
    424 ( 65,176) 0.000141254 0.001104870 0.073231310 145764
    425 ( 65,192) 0.000141453 0.001234460 0.167622507 140618
    426 ...
    427 \end{verbatim}
    428 
    429   \item[Per Device Averages] The average columns from the above charts,
    430   are also presented in their own chart.
    431 
    432   \item[Q2D Histogram] A display of histogram buckets for the Q to D times
    433   -- basically, from where an IO enters the block IO layer for a given
    434   device, and when it is dispatched. The buckets are arranged via the
    435   time in seconds, as in:
    436 
    437 \begin{verbatim}
    438 ==================== Q2D Histogram ====================
    439 
    440        DEV | <.005 <.010 <.025 <.050 <.075 <.100 <.250 <.500 < 1.0 >=1.0
    441  --------- | ===== ===== ===== ===== ===== ===== ===== ===== ===== =====
    442  ( 66, 80) |  61.2   7.9  12.1   7.9   3.0   1.4   1.5   0.2   0.0   4.6
    443  ( 65,192) |  42.3   5.0   8.7  30.0   8.9   3.0   1.8   0.1   0.0   0.1
    444  ( 65,128) |  34.3   5.3   8.9  32.0   9.7   3.7   5.3   0.6   0.0   0.1
    445 ...
    446  ( 65, 64) |  59.9   4.2   6.0  24.6   4.2   0.8   0.1   0.0   0.0   0.1
    447  ( 66, 64) |  62.6   8.1  12.7   7.9   2.4   0.6   0.1   0.0   0.0   5.4
    448 ========== | ===== ===== ===== ===== ===== ===== ===== ===== ===== =====
    449        AVG |  52.9   6.2  10.0  20.1   5.3   1.7   1.4   0.2   0.0   2.1
    450 \end{verbatim}
    451 
    452 \end{description}
    453 
    454 \newpage\section{\label{sec:data-files}Data Files Output}
    455 
    456   Besides the averages output by default, the following 5(+) files are also
    457   created with data points which may be plotted.
    458 
    459 \begin{description}
    460   \item[\emph{file}.dat] This file provides a notion of \emph{activity}
    461   for the system, devices and processes. The details of this file are
    462   provided in section~\ref{sec:activity}.
    463 
    464   \item[\emph{file}\_qhist.dat] Provides histogram data for the size of
    465   incoming IO requests, for more information see section~\ref{sec:qhist}.
    466 
    467   \item[\emph{file}\_dhist.dat] Provides histogram data for the size
    468   of IO requests submitted to lower layer drivers, for more information
    469   see section~\ref{sec:dhist}.
    470 
    471   \item[\emph{file}\_mbps\_fp.dat] Provides a set of data for
    472   mb-per-second values each second
    473   - for more information see section~\ref{sec:rstat}.
    474 
    475   \item[\emph{file}\_iops\_fp.dat] Provides a set of data for
    476   I/Os-per-second values each second
    477   - for more information see section~\ref{sec:rstat}.
    478 
    479 \end{description}
    480 
    481   In addition to the default data files output, there are optional data
    482   files which can be generated by btt. These include:
    483 
    484   \begin{description}
    485     \item[subset of \texttt{.avg} data, easily parsed ] When the
    486     \texttt{-X} option is specified \emph{and} the \texttt{-o} has also
    487     been specified, then a subset of the data produced by default is
    488     copied to another file that is \emph{more easily parsed.} Refer to
    489     section~\ref{sec:o-X} for full details.
    490 
    491     \item[iostat] iostat-like data can be distilled by btt, and is
    492     described in section~\ref{sec:iostat}.
    493 
    494     \item[per IO detail] Each and every IO traced can be output in a form
    495     that shows each of the IO components on consecutive lines (rather
    496     than grepping through a blkparse output file for example). The
    497     details on this file is included in section~\ref{sec:per-io}.
    498 
    499     \item[iostat] Latency information -- both Q2d, D2c and Q2C --
    500     on a per-IO basis can be generated. These are described in
    501     section~\ref{sec:lat}.
    502 
    503     \item[seek details] A set of data files containing all IO-to-IO
    504     sector differences can be output, with details found in
    505     section~\ref{sec:seek}.
    506 
    507     \item[unplug histogram details] A data file per device containing
    508     histogram output for the amount of IOs released at unplug time.
    509     Section~\ref{sec:o-u} has more details.
    510   \end{description}
    511 
    512 \newpage\section{\label{sec:activity}Activity Data File}
    513 
    514   The activity data file contains a series of data values that indicate
    515   those periods of time when queue and complete traces are being
    516   processed.  The values happen to be in a format easily handled by
    517   xmgrace\footnote{\texttt{http://plasma-gate.weizmann.ac.il/Grace/}
    518   ``Grace is a WYSIWYG 2D plotting tool for the X Window System and
    519   M*tif.''}, but is easy to parse for other plotting and/or analysis
    520   programs.
    521 
    522   The file is split into pairs of sets of data points, where each pair
    523   contains a set of queue activity and a set of completion activity. The
    524   points are presented with the first column (X values) being the time
    525   (in seconds), and the second column (Y values) providing an on/off
    526   type of setting. For each pair, the Y values have two settings off
    527   (low) and on (high). For example, here is a snippet of a file showing
    528   some Q activity:
    529 
    530 \begin{verbatim}
    531 # Total System
    532 #     Total System : q activity
    533 0.000000000   0.0
    534 0.000000000   0.4
    535 0.000070381   0.4
    536 0.000070381   0.0
    537 1.023482637   0.0
    538 1.023482637   0.4
    539 6.998746618   0.4
    540 6.998746618   0.0
    541 7.103336799   0.0
    542 7.103336799   0.4
    543 17.235419786   0.4
    544 17.235419786   0.0
    545 26.783361447   0.0
    546 26.783361447   0.4
    547 26.832454929   0.4
    548 26.832454929   0.0
    549 28.870431266   0.0
    550 28.870431266   0.4
    551 28.870431266   0.4
    552 28.870431266   0.0
    553 \end{verbatim}
    554 
    555   What this indicates is that there was q activity for the system
    556   from 0.000000000 through 0.000070381, but was inactive from there to
    557   1.023482637, and so on. Section~\ref{sec:o-d} contains details on how
    558   to adjust btt's notion of what constitutes activity.
    559 
    560   The pairs are arranged as follows:
    561 
    562   \begin{itemize}
    563     \item First there is the total system activity -- meaning activity
    564     in either queue or completion traces across all devices.
    565 
    566     \item Next comes per-device activity information -- for each device
    567     being traced, that request queues Q and C traces are presented.
    568 
    569     \item Last we present pairs per-process.
    570   \end{itemize}
    571 
    572   Using this, one is then able to plot regions of activity versus
    573   inactivity -- and one can gather a sense of deltas between the queueing
    574   of IOs and when they are completed. Figure~\ref{fig:activity} shows
    575   a very simplistic chart showing some activity:
    576 
    577   \begin{figure}[hb]
    578   \leavevmode\centering
    579   \epsfig{file=activity.eps,width=4.5in}
    580   \caption{\label{fig:activity}Simple Activity Chart}
    581   \end{figure}
    582 
    583   When the black line (system Q activity) is \emph{high}, then the system
    584   is seeing relatively continuous incoming queues. Conversely, when it is
    585   low, it represents an extended period of time where no queue requests
    586   were coming in. Similarly for the red line and C activity.
    587 
    588 \newpage\section{\label{sec:hist}Histogram Data Files}
    589 
    590   The histogram data files provide information concerning incoming and
    591   outgoing IO sizes (in blocks). For simplicity, the histogram buckets
    592   are one-for-one for sizes up to 1,024 blocks in the IO, and then a
    593   single bucket for all sizes greater than or equal to 1,024 blocks.
    594 
    595   The files are again in grace-friendly format, with the first set
    596   containing data for the first 1,023 buckets, and a separate set
    597   representing sizes $\ge 1024$ blocks. (This is done so that one can
    598   easily use a separate formatting specification for the latter set.)
    599 
    600   The first column (X values) is the various IO sizes, and the second
    601   column (Y values) represents the number of IOs of that size.
    602 
    603 \subsection*{\label{sec:qhist}Q Histogram Data File}
    604 
    605   Figure~\ref{fig:qhist} is a sample graph generated from data used during
    606   some real-world analysis\footnote{Note the logarithmic nature of the
    607   Y axis for this chart.}. With the visual representation provided by
    608   this, one can quickly discern some different characteristics between
    609   the 3 runs -- in particular, one can see that there is only a single
    610   red point (representing 8 blocks per IO), whereas the other two had
    611   multiple data points greater than 8 blocks.
    612 
    613   \begin{figure}[hb]
    614   \leavevmode\centering
    615   \epsfig{file=qhist.eps,width=4.5in}
    616   \caption{\label{fig:qhist}Q Histogram}
    617   \end{figure}
    618 
    619 \subsection*{\label{sec:dhist}D Histogram Data File}
    620 
    621   Figure~\ref{fig:dhist} is a sample graph generated from data used during
    622   some real-world analysis\footnote{Note the logarithmic nature of the
    623   Y axis for this chart.}. Again, visually, one can see that the black
    624   and blue dots are somewhat similar below about 192 blocks per IO going
    625   out. And then one can make the broad generalization of higher reds,
    626   lower blues and blacks in the middle.
    627 
    628   \begin{figure}[hb]
    629   \leavevmode\centering
    630   \epsfig{file=dhist.eps,width=4.5in}
    631   \caption{\label{fig:dhist}D Histogram}
    632   \end{figure}
    633 
    634 \newpage\section{\label{sec:rstat}Running Stats Files}
    635 
    636 There are two files produced for each of all devices being traced
    637 (prefixed with \emph{sys\_}) and per-device (prefixed with the device
    638 identifier).
    639 
    640 The two files are for reporting I/O rate (I/Os per second - name ends
    641 with \texttt{iops\_fp.dat}) and throughput (MiB per second - name ends
    642 with \texttt{mbps\_fp.dat}).
    643 
    644 The data in the files has two columns:\smallskip
    645 
    646 \begin{tabular}{lll}
    647 \textbf{File Type} & \textbf{X values} & \textbf{Y values}\\\hline
    648 \textbf{iops} & Runtime (seconds) & I/Os per second\\\hline
    649 \textbf{mbps} & Runtime (seconds) & MiB per second\\\hline
    650 \end{tabular}
    651 
    652 As an example:
    653 
    654 \begin{verbatim}
    655 # ls *fp.dat
    656 008,064_iops_fp.dat
    657 008,064_mbps_fp.dat
    658 sys_iops_fp.dat
    659 sys_mbps_fp.dat
    660 \end{verbatim}
    661 
    662 These can be plotted using various tools (e.g., xmgrace as in
    663 figure~\ref{fig:rstats}).
    664 
    665   \begin{figure}[b!]
    666   \leavevmode\centering
    667   \epsfig{file=rstats.eps,width=4.5in}
    668   \caption{\label{fig:rstats}Running Stats}
    669   \end{figure}
    670 
    671 \newpage\section{\label{sec:iostat}iostat Data File}
    672   \texttt{btt} attempts to produce the results from running an
    673   \texttt{iostat -x} command in parallel with the system as it is being
    674   traced. The fields (columns) generated by the \texttt{--iostat} or
    675   \texttt{-I} option can be seen from the following output snippet --
    676   note that the line has been split to fit on the printed page:
    677 
    678 \begin{verbatim}
    679 Device:       rrqm/s   wrqm/s     r/s     w/s    rsec/s    wsec/s
    680              rkB/s     wkB/s avgrq-sz avgqu-sz   await   svctm  %util   Stamp
    681 ...
    682 (  8, 16)       0.00     0.00    0.00 1005.30      0.00 152806.36     
    683               0.00  76403.18   152.00    31.00    0.00    0.00   0.00   71.79
    684 ...
    685 (  8, 16)       1.02     5.80    0.34    1.07      4.03     55.62
    686               2.02     27.81    42.13     0.61    0.00   21.90   0.00   TOTAL
    687 \end{verbatim}
    688 
    689   Note that the STAMP field contains the runtime (in seconds) for that
    690   line of data.
    691 
    692 \newpage\section{\label{sec:per-io}Per-IO Data File}
    693 
    694   \texttt{btt} can produce a text file containing time line data for each
    695   IO processed. The time line data contains rudimentary information for
    696   the following stages:
    697 
    698   \begin{itemize}
    699     \item queue traces
    700     \item get request traces
    701     \item insert traces
    702     \item merge traces
    703     \item issue traces
    704     \item completion traces
    705     \item remap traces
    706   \end{itemize}
    707 
    708   The \emph{--per-io-dump} or \emph{-p} option triggers this behavior,
    709   and will produce a file containing streams of IOs (separated by blank
    710   spaces). As an example, here is a snippet of 4 IOs that were merged
    711   together, you will note there are 3 merged IOs, and 1 inserted in the
    712   stream. The issue and completion traces are replicated per IO.
    713 
    714 \begin{verbatim}
    715  66,0  :     0.763283556 Q       6208+8  
    716              0.763300157 I       6208+8  
    717              0.763296365 G       6208+8  
    718              0.763338848 D       6208+32 
    719              0.763705760 C       6208+32 
    720 
    721  66,0  :     0.763314550 Q       6224+8  
    722              0.763315341 M       6224+8  
    723              0.763338848 D       6208+32 
    724              0.763705760 C       6208+32 
    725 
    726  66,0  :     0.763321010 Q       6232+8  
    727              0.763321775 M       6232+8  
    728              0.763338848 D       6208+32 
    729              0.763705760 C       6208+32 
    730 
    731  65,240:     0.763244173 Q       6216+8  
    732              0.763244974 M       6216+8  
    733              0.763374288 D       6208+32 
    734              0.763826610 C       6208+32 
    735 \end{verbatim}
    736 
    737   The columns provide the following information:
    738 
    739   \begin{enumerate}
    740     \item Device major/minor.
    741 
    742     \item Time of the trace (seconds from the start of the run)
    743 
    744     \item Trace type
    745 
    746     \item start block + number of blocks
    747   \end{enumerate}
    748  
    749 \newpage\section{\label{sec:lat}\label{sec:lat-q2d}\label{sec:lat-q2c}\label{sec:lat-d2c}Latency Data Files}
    750 
    751   The latency data files which can be optionally produced by \texttt{btt}
    752   provide per-IO latency information, one for queue time (Q2D), one
    753   for total IO time (Q2C) and one for latencies induced by lower layer
    754   drivers and devices (D2C).
    755 
    756   In both cases, the first column (X values) represent runtime (seconds),
    757   while the second column (Y values) shows the actual latency for a
    758   command at that time (either Q2D, D2C or Q2C).
    759 
    760 \newpage\section{\label{sec:seek}Seek Data Files}
    761 
    762   \texttt{btt} can also produce two data files containing all IO-to-IO sector
    763   deltas, providing seek information which can then be plotted. The
    764   produced data file contains 3 sets of data:
    765 
    766   \begin{enumerate}
    767      \item Combined data -- all read and write IOs
    768 
    769      \item Read data -- just seek deltas for reads
    770 
    771      \item Write data -- just seek deltas for writes
    772   \end{enumerate}
    773 
    774   The format of the output file names is to have the name generated by
    775   the following fields separated by underscores (\texttt{\_}):
    776  
    777   \begin{itemize}
    778     \item The prefix provided as the argument to the \texttt{-s} option.
    779     \item The major and minor numbers of the device separated by a comma.
    780     \item The string \texttt{q2q} or \texttt{d2d}, indicating the Q2Q or
    781           D2D seeks, respectively.
    782     \item One of the following characters:
    783     	\begin{description}
    784 	  \item[r] For read (device to system) IOs
    785 	  \item[w] For write (system to device) IOs
    786 	  \item[c] Combined -- both read and write IOs
    787 	\end{description}
    788   \end{itemize}
    789 
    790   An example name would be after specifying \texttt{-s seek} would be:
    791   \texttt{seek\_065,048\_q2q\_w.dat}.
    792 
    793   The format of the data is to have the runtime values (seconds since
    794   the start of the run) in column 1 (X values); and the difference in
    795   sectors from the previous IO in column 2 (Y values). Here is a snippet
    796   of the first few items from a file:
    797 
    798 \begin{verbatim}
    799 # Combined
    800      0.000034733           35283790.0
    801      0.000106453           35283790.0
    802      0.005239009           35283950.0
    803      0.006968575           35283886.0
    804      0.007218709           35283694.0
    805      0.012145393           35283566.0
    806      0.014980835          -35848914.0
    807      0.024239323          -35848914.0
    808      0.024249402          -35848914.0
    809      0.025707095          -35849072.0
    810      ...
    811 \end{verbatim}
    812 
    813   Figure~\ref{fig:seek} shows a simple graph that can be produced which
    814   provides visual details concerning seek patterns.
    815 
    816   \begin{figure}[h!]
    817   \leavevmode\centering
    818   \epsfig{file=seek.eps,width=4.5in}
    819   \caption{\label{fig:seek}Seek Chart}
    820   \end{figure}
    821   \FloatBarrier
    822 
    823   The seek difference is calculated in one of two ways:
    824 
    825   \begin{description}
    826     \item[default] By default, the seek distance is calculated as the
    827     \emph{closest} distance between the previous IO and this IO. The
    828     concept of \emph{closeness} means that it could either be the
    829     \emph{end} of the previous IO and the beginning of the next, or the
    830     end of this IO and the start of the next.
    831 
    832     \item[\texttt{-a}] If the \texttt{-a} or \texttt{--seek-absolute}
    833     option is specified, then the seek distance is simply the difference
    834     between the end of the previous IO and the start of this IO.
    835   \end{description}
    836 
    837 \newpage\subsection{\label{sec:sps-spec}Seeks Per Second}
    838 
    839   When the \texttt{-m} option provides a name, Q2Q and/or D2D seeks
    840   will trigger \texttt{btt} to output seeks-per-second information. The
    841   first column will contain a time value (seconds), and the second column
    842   will indicate the number of seeks per second at that point.
    843 
    844   When there is only a single data point within a 1-second window,
    845   \texttt{btt} will just output the time value for the point, and the
    846   value 1.0 in the second column. If there is no perceived difference
    847   in the times present for the current sample, then the second columns
    848   value is the number of seeks present at that time.
    849 
    850   Otherwise, if $\alpha$ and $\Omega$ are the first and last times
    851   seen within a 1-second window, and $\nu$ are the number of seeks seen
    852   in that time frame, then:
    853 
    854   \begin{description}
    855     \item[column 1] Midway point in time for this span, or: \hfill$\alpha +
    856     {{(\Omega - \alpha)} / 2}$
    857 
    858     \item[column 2] Average seeks per second over this span, or: \hfill$\nu  /
    859     {(\Omega - \alpha)}$
    860   \end{description}
    861 
    862   Figure~\ref{fig:sps} shows a simple pair of graphs generated from
    863   \texttt{-m} output:
    864 
    865   \begin{figure}[h!]
    866   \leavevmode\centering
    867   \epsfig{file=sps.eps,width=4.5in}
    868   \caption{\label{fig:sps}Seeks-per-second Chart}
    869   \end{figure}
    870   \FloatBarrier
    871 
    872 \newpage\section{\label{sec:cmd-line}Command Line}
    873 
    874 \begin{verbatim}
    875 Usage: btt 2.09
    876 [ -a               | --seek-absolute ]
    877 [ -A               | --all-data ]
    878 [ -B <output name> | --dump-blocknos=<output name> ]
    879 [ -d <seconds>     | --range-delta=<seconds> ]
    880 [ -D <dev;...>     | --devices=<dev;...> ]
    881 [ -e <exe,...>     | --exes=<exe,...>  ]
    882 [ -h               | --help ]
    883 [ -i <input name>  | --input-file=<input name> ]
    884 [ -I <output name> | --iostat=<output name> ]
    885 [ -l <output name> | --d2c-latencies=<output name> ]
    886 [ -L <freq>        | --periodic-latencies=<freq> ]
    887 [ -m <output name> | --seeks-per-second=<output name> ]
    888 [ -M <dev map>     | --dev-maps=<dev map>
    889 [ -o <output name> | --output-file=<output name> ]
    890 [ -p <output name> | --per-io-dump=<output name> ]
    891 [ -P <output name> | --per-io-trees=<output name> ]
    892 [ -q <output name> | --q2c-latencies=<output name> ]
    893 [ -Q <output name> | --active-queue-depth=<output name> ]
    894 [ -r               | --no-remaps ]
    895 [ -s <output name> | --seeks=<output name> ]
    896 [ -S <interval>    | --iostat-interval=<interval> ]
    897 [ -t <sec>         | --time-start=<sec> ]
    898 [ -T <sec>         | --time-end=<sec> ]
    899 [ -u <output name> | --unplug-hist=<output name> ]
    900 [ -V               | --version ]
    901 [ -v               | --verbose ]
    902 [ -X               | --easy-parse-avgs ]
    903 [ -z <output name> | --q2d-latencies=<output name> ]
    904 [ -Z               | --do-active
    905 \end{verbatim}
    906 
    907 \subsection{\label{sec:o-a}\texttt{--seek-absolute}/\texttt{-a}}
    908 
    909   When specified on the command line, this directs btt to calculate
    910   seek distances based solely upon the ending block address of one IO,
    911   and the start of the next.  By default \texttt{btt} uses the concept
    912   of the closeness to either the beginning or end of the previous IO. See
    913   section~\ref{sec:seek} for more details about seek distances.
    914 
    915 \subsection{\label{sec:o-A}\texttt{--all-data}/\texttt{-A}}
    916 
    917   Normally \texttt{btt} will not print out verbose information
    918   concerning per-process and per-device data (as outlined in
    919   section~\ref{sec:detailed-data}). If you desire that level of
    920   detail you can specify this option.
    921 
    922 \subsection{\label{sec:o-B}\texttt{--dump-blocknos}/\texttt{-B}}
    923 
    924   This option will output absolute block numbers to three files prefixed
    925   by the specified output name:
    926 
    927   \begin{description}
    928     \item[\emph{prefix}\_\emph{device}\_r.dat] All read block numbers are
    929     output, first column is time (seconds), second is the block number,
    930     and the third column is the ending block number.
    931 
    932     \item[\emph{prefix}\_\emph{device}\_w.dat] All write block numbers are
    933     output, first column is time (seconds), second is the block number,
    934     and the third column is the ending block number.
    935 
    936     \item[\emph{prefix}\_\emph{device}\_c.dat] All block numbers (read
    937     and write) are output, first column is time (seconds), second is
    938     the block number, and the third column is the ending block number.
    939   \end{description}
    940 
    941 \subsection{\label{sec:o-d}\texttt{--range-delta}/\texttt{-d}}
    942 
    943   Section~\ref{sec:activity} discussed how \texttt{btt} outputs a file
    944   containing Q and C activity, the notion of \emph{active} traces simply
    945   means that there are Q or C traces occurring within a certain period
    946   of each other. The default values is 0.1 seconds; with this option
    947   allowing one to change that granularity. The smaller the value, the
    948   more data points provided.
    949 
    950 \subsection{\label{sec:o-D}\texttt{--devices}/\texttt{-D}}
    951 
    952   Normally, \texttt{btt} will produce data for all devices detected in
    953   the traces parsed. With this option, one can reduce the analysis to
    954   one or more devices provided in the string passed to this option. The
    955   device identifiers are the major and minor number of each device, and
    956   each device identifier is separated by a colon (:). A valid specifier
    957   for devices 8,0 and 8,8 would then be: \texttt{"8,0:8,8"}.
    958 
    959 \subsection{\label{sec:o-e}\texttt{--exes}/\texttt{-e}}
    960 
    961   Likewise, \texttt{btt} will produce data for all processes (executables)
    962   found in the traces. With this option, one can specify which processes
    963   you want displayed in the output. The format of the string passed is
    964   a list of executable \emph{names} separated by commas (,). An example
    965   would be \texttt{"-e mkfs.ext3,mount"}.
    966 
    967 \subsection{\label{sec:o-h}\texttt{--help}/\texttt{-h}}
    968 
    969   Prints out the simple help information, as seen at the top of
    970   section~\ref{sec:cmd-line}.
    971 
    972 \subsection{\label{sec:o-i}\texttt{--input-file}/\texttt{-i}}
    973 
    974   Specifies the binary input file that \texttt{btt} will interpret traces
    975   in. See section~\ref{sec:getting-started} for information concerning
    976   binary trace files.
    977 
    978 \subsection{\label{sec:o-I}\texttt{--iostat}/\texttt{-I}}
    979 
    980   This option triggers \texttt{btt} to generate iostat-like output to the
    981   file specified. Refer to section~\ref{sec:iostat} for more information
    982   on the output produced.
    983 
    984 \subsection{\label{sec:o-l}\texttt{--d2c-latencies}/\texttt{-l}}
    985 
    986   This option instructs \texttt{btt} to generate the D2C latency file
    987   discussed in section~\ref{sec:lat-d2c}.
    988 
    989 \subsection{\label{sec:o-L}\texttt{--periodic-latencies}/\texttt{-L}}
    990 
    991   When given a value greater than 0, this option will create two data
    992   files (q2c \& d2c) per device containing a periodic timestamp \&
    993   average latency over that period.
    994 
    995 \subsection{\label{sec:o-m}\texttt{--seeks-per-second}\texttt{-m}}
    996 
    997   Tells \texttt{btt} to output seeks per second information.  Each device
    998   being measured can have up to 2 files output: One with Q2Q information
    999   and one with D2D seek information. Information on the output produced
   1000   can be found in section~\ref{sec:sps-spec}.
   1001 
   1002   \begin{quote}
   1003     \textbf{Note: This requires seek output to be selected -- see
   1004     section~\ref{sec:seek}.}
   1005   \end{quote}
   1006 
   1007 \subsection{\label{sec:o-M}\texttt{--dev-maps}/\texttt{-M}}
   1008 
   1009   Internal option, still under construction.
   1010 
   1011 \subsection{\label{sec:o-o}\texttt{--output-file}/\texttt{-o}}
   1012 
   1013   Normally \texttt{btt} sends the statistical output (covered in
   1014   section~\ref{sec:output-overview}) to standard out, if you specify
   1015   this option this data is redirected to the file specified.
   1016 
   1017 \subsection{\label{sec:o-p}\texttt{--per-io-dump}/\texttt{-p}}
   1018 
   1019   This option tells \texttt{btt} to generate the per IO dump file as
   1020   discussed in section~\ref{sec:per-io}.
   1021 
   1022 \subsection{\label{sec:o-P}\texttt{--per-io-tress}/\texttt{-P}}
   1023 
   1024 The \texttt{-P} option will generate a file that contains a list of all IO
   1025 "sequences" - showing only the Q, D \& C operation times. The D \& C
   1026 time values are separated from the Q time values with a vertical bar.
   1027 
   1028 \subsection{\label{sec:o-q}\texttt{--q2c-latencies}/\texttt{-q}}
   1029 
   1030   This option instructs \texttt{btt} to generate the Q2C latency file
   1031   discussed in section~\ref{sec:lat-q2c}.
   1032 
   1033 \subsection{\label{sec:o-Q}\texttt{--active-queue-depth}/\texttt{-Q}}
   1034 
   1035   This option tells \texttt{btt} to generate a data file (using the given
   1036   name as a base) which contains: A time stamp in the first column,
   1037   and then the number of \emph{active} requests issued to the device
   1038   driver. (The value is incremented when an \emph{issue} is performend,
   1039   and decremented when a \emph{complete} is performed.
   1040 
   1041 \subsection{\label{sec:o-r}\texttt{--no-remaps}/\texttt{-r}}
   1042 
   1043   Ignore remap traces; older kernels did not implement the full remap PDU.
   1044 
   1045 \subsection{\label{sec:o-s}\texttt{--seeks}/\texttt{-s}}
   1046 
   1047   This option instructs \texttt{btt} to generate the seek data file
   1048   discussed in section~\ref{sec:seek}.
   1049 
   1050 \subsection{\label{sec:o-S}\texttt{--iostat-interval}/\texttt{-S}}
   1051 
   1052   The normal \texttt{iostat} command allows one to specify the snapshot
   1053   interval, likewise, \texttt{btt} allows one to specify how many seconds
   1054   between its generation of snapshots of the data via this option. Details
   1055   about the iostat-like capabilities of \texttt{btt} may be found in
   1056   section~\ref{sec:iostat}.
   1057 
   1058 \subsection{\label{sec:o-tT}\texttt{--time-start}/\texttt{-t} and
   1059 \texttt{--time-end}/\texttt{T}}
   1060 
   1061   \begin{quote}
   1062     \emph{This \texttt{btt} capability is still under construction, results are
   1063     not always consistent at this point in time.}
   1064   \end{quote}
   1065 
   1066   These options allow one to dictate to \texttt{btt} when to start and stop
   1067   parsing of trace data in terms of seconds since the start of the run. The
   1068   trace chosen will be between the start time (or 0.0 if not
   1069   specified) and end time (or the end of the run) specified.
   1070 
   1071 \subsection{\label{sec:o-u}\texttt{--unplug-hist}/\texttt{-u}}
   1072 
   1073   This option instructs \texttt{btt} to generate a data file containing
   1074   histogram information for \emph{unplug} traces on a per device
   1075   basis. It shows how many times an unplug was hit with a specified
   1076   number of IOs released. There are 21 output values into the file, as
   1077   follows:
   1078 
   1079   \medskip
   1080   \begin{tabular}{ll}
   1081 \textbf{X value} & \textbf{Representing Counts} \\\hline
   1082 0 & 0\dots\/4 \\
   1083 1 & 5\dots\/9 \\
   1084 2 & 10\dots\/14 \\
   1085 \dots & \dots\dots\\
   1086 19 & 95\dots\/99 \\
   1087 20 & 100+ \\
   1088   \end{tabular}
   1089 
   1090   \medskip
   1091   The file name(s) generated use the text string passed as an argument for
   1092   the prefix, followed by the device identifier in \texttt{major,minor}
   1093   form, with a \texttt{.dat} extension (as an example, with \texttt{-u
   1094   up\_hist} specified on the command line: \texttt{up\_hist\_008,032.dat}.
   1095 
   1096 \subsection{\label{sec:o-V}\texttt{--version}/\texttt{-V}}
   1097 
   1098   Prints out the \texttt{btt} version, and exits.
   1099 
   1100 \subsection{\label{sec:o-v}\texttt{--verbose}/\texttt{-v}}
   1101 
   1102   While \texttt{btt} is processing data, it will put out periodic (1-second
   1103   granularity) values describing the progress it is making through the
   1104   input trace stream. The value describes how many traces have been
   1105   processed. At the end of the run, the overall number of traces, trace
   1106   rate (number of thousands of traces per second), and the real time for
   1107   trace processing and output are displayed. Example (note: the interim
   1108   trace counts are put out with carriage returns, hence, they overwrite
   1109   each time):
   1110 
   1111 \begin{verbatim}
   1112 # btt -i bp.bin -o btt -v
   1113 Sending range data to bttX.dat
   1114 Sending stats data to bttX.avg
   1115  287857 t
   1116 1414173 t
   1117 1691581 t
   1118 ...
   1119 4581291 traces @ 279.7 Ktps
   1120 16.379036+0.000005=16.379041
   1121 \end{verbatim}
   1122 
   1123 \subsection{\label{sec:o-X}\texttt{--easy-parse-avgs}/\texttt{-X}}
   1124 
   1125   \emph{Some} of the data produced by default can also be shipped
   1126   simultaneously to another file in an easy to parse form. When
   1127   the \texttt{-o} option is selected (thus producing a file with a
   1128   \texttt{.avg} exentsion), \emph{and} the \texttt{-X} flag is present,
   1129   then \texttt{btt} will generate this file.
   1130 
   1131   The format is space-delimited values starting with a 3-character
   1132   \emph{record} indicator, then the device information (either major,minor
   1133   or the device name when \texttt{-M} is specified), and then a number of
   1134   fields representing data values. The following table shows the record
   1135   identifiers and the fields provided:
   1136 
   1137   \bigskip
   1138   \begin{tabular}{|l|l|}\hline
   1139   \textbf{Record} & \textbf{Description}\\\hline
   1140   \texttt{DMI}	& Device Merge Information:\\
   1141 		& \#Q \#D Ratio BLKmin BLKavg BLKmax Total\\\hline
   1142   \texttt{QSK}	& Device Q2Q Seek Information:\\
   1143 		& NSEEKS MEAN MEDIAN MODE N-MODE mode\ldots\\\hline
   1144   \texttt{DSK}	& Device D2D Seek Information:\\
   1145 		& NSEEKS MEAN MEDIAN MODE N-MODE mode\ldots\\\hline
   1146   \texttt{PLG}	& Plug Information:\\
   1147 		& \#Plugs \#TimerUnplugs \%TimeQPlugged\\\hline
   1148   \texttt{UPG}	& Unplug Information:\\
   1149 		& IOsPerUnplug IOsPerUnplugTimeout\\\hline
   1150   \texttt{ARQ}	& Active Requests at Q Information:\\
   1151   		& AvgReqs@Q\\\hline\hline
   1152   \texttt{Q2Q}  & Queue-to-Queue times:\\
   1153   \texttt{Q2G}  & Queue-to-GetRequest times:\\
   1154   \texttt{S2G}  & Sleep-to-GetRequest times:\\
   1155   \texttt{G2I}  & GetRequest-to-Insert times:\\
   1156   \texttt{Q2M}  & Queue-to-Merge times:\\
   1157   \texttt{I2D}  & Insert-to-Issue times:\\
   1158   \texttt{M2D}  & Merge-to-Issue times:\\
   1159   \texttt{D2C}  & Issue-to-Complete times:\\
   1160   \texttt{Q2C}  & Queue-to-Complete times:\\
   1161                 & MIN AVG MAX N\\\hline
   1162   \end{tabular}
   1163 
   1164   \bigskip
   1165   A sample output file would look like:
   1166 
   1167   \begin{verbatim}
   1168 Q2Q 0.000000001 0.003511356 9.700000000 309906
   1169 Q2G 0.000000001 0.774586535 805.300000000 106732
   1170 S2G 0.000000001 0.072525952 0.370000000 578
   1171 G2I 0.000000001 0.000001125 0.010000000 106732
   1172 Q2M 0.000000001 0.730763626 751.820000000 204040
   1173 I2D 0.000000001 1.270720538 612.880000000 106948
   1174 M2D 0.000000001 0.992355230 428.930000000 203114
   1175 D2C 0.000000001 0.008681311 137.020000000 307343
   1176 Q2C 0.000000001 1.304370794 805.660000000 308921
   1177 DMI 8,16 309907 106729 2.903681286 8 182 1024 19504768
   1178 QSK 8,16 309907 167200.935561314 0 0 235708
   1179 DSK 8,16 106729 433247.436563633 0 0 33974
   1180 PLG 8,16 40824 382 0.008881420
   1181 UPG 8,16 1.993361748 1.866492147
   1182 ARQ 8,16 12.938165321
   1183   \end{verbatim}
   1184 
   1185 \subsection{\label{sec:o-z}\texttt{--q2d-latencies}/\texttt{-z}}
   1186 
   1187   This option instructs \texttt{btt} to generate the Q2D latency file
   1188   discussed in section~\ref{sec:lat-q2d}.
   1189 
   1190 \subsection{\label{sec:o-Z}\texttt{--q2d-latencies}/\texttt{-Z}}
   1191 
   1192   This option generates per-device (and total system) data files. Each
   1193   file contain a data line which resembles a timing graph: low meaning
   1194   I/O inactive, high meaning I/O active. A sample section of two ``active'' regions would be:
   1195 
   1196 \begin{verbatim}
   1197 0.000000000 1.0
   1198 0.000025733 1.0
   1199 0.000025733 1.9
   1200 0.000107089 1.9
   1201 0.000107089 1.0
   1202 0.000107089 1.0
   1203 0.005637386 1.0
   1204 0.005637386 1.9
   1205 0.017323909 1.9
   1206 \end{verbatim}
   1207 
   1208   Which shows an active area from 0.000025733 through
   1209   0.000107089 followed by another at 0.005637386 through
   1210   0.017323909. Figure~\ref{fig:live_plot} shows a sample plot that can
   1211   be generated by such data.
   1212 
   1213 \begin{figure}[b!]
   1214 \leavevmode\centering
   1215 \epsfig{file=live.eps,width=5.5in}
   1216 \caption{\label{fig:live_plot}Sample graph using data from \texttt{-Z}}
   1217 \end{figure}
   1218 
   1219 \newpage\section{\label{sec:bno_plot}bno\_plot.py}
   1220 
   1221 Included with the distribution is a simple 3D plotting utility based
   1222 upon the block numbers output when \texttt{-B} is specified (see
   1223 section~\ref{sec:o-B} for more details about the \texttt{-B option}). The
   1224 display will display \emph{each} IO generated, with the time (seconds)
   1225 along the X-axis, the block number (start) along the Y-axis and the
   1226 number of blocks transferred in the IO represented along the Z-axis.
   1227 
   1228 The script requires Python\footnote{\texttt{www.python.org}} and
   1229 gnuplot\footnote{\texttt{www.gnuplot.info}}, and will enter interactive
   1230 mode after the image is produced. In this interactive mode one can enter
   1231 gnuplot commands at the \texttt{'gnuplot>'} prompt, and/or can change
   1232 the viewpoint within the 3D image by \emph{left-click-hold} and moving
   1233 the mouse. A sample screen shot can be seen in figure~\ref{fig:bno_plot}.
   1234 
   1235 \subsection*{\texttt{bno\_plot.py} Command Line Options}
   1236 
   1237 \begin{quotation}
   1238 \begin{verbatim}
   1239 
   1240 $ bno_plot.py --help
   1241 
   1242 bno_plot.py
   1243 	[ -h | --help       ]
   1244 	[ -K | --keys-below ]
   1245 	[ -v | --verbose    ]
   1246 	[ <file...>         ]
   1247 
   1248 Utilizes gnuplot to generate a 3D plot of the block number
   1249 output from btt.  If no <files> are specified, it will
   1250 utilize all files generated after btt was run with -B
   1251 blknos (meaning: all files of the form blknos*[rw].dat).
   1252 
   1253 The -K option forces bno_plot.py to put the keys below the
   1254 graph, typically all keys for input files are put in the
   1255 upper right corner of the graph. If the number of devices
   1256 exceed 10, then bno_plot.py will automatically push the
   1257 keys under the graph.
   1258 
   1259 To exit the plotter, enter 'quit' or ^D at the 'gnuplot> '
   1260 prompt.
   1261 \end{verbatim}
   1262 \end{quotation}
   1263 
   1264 \begin{figure}[b!]
   1265 \leavevmode\centering
   1266 \epsfig{file=bno_plot.eps,width=5.5in}
   1267 \caption{\label{fig:bno_plot}Sample \texttt{bno\_plot.py} Screen Shot}
   1268 \end{figure}
   1269 
   1270 \clearpage
   1271 \newpage\section{\label{sec:appendix}Sample \texttt{btt}
   1272 Output}
   1273   Here is a complete output file from a btt run, illustrating a lot of the
   1274   capabilities of btt.
   1275 \input{sample-btt-output.tex}
   1276 
   1277 \end{document}
   1278 \subsection{\label{sec:o-B}\texttt{--dump-blocknos}/\texttt{-B}}
   1279