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