1e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat%
2e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat% Copyright (C) 2007 Alan D. Brunelle <Alan.Brunelle@hp.com>
3e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat%
4e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat%  This program is free software; you can redistribute it and/or modify
5e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat%  it under the terms of the GNU General Public License as published by
6e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat%  the Free Software Foundation; either version 2 of the License, or
7e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat%  (at your option) any later version.
8e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat%
9e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat%  This program is distributed in the hope that it will be useful,
10e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat%  but WITHOUT ANY WARRANTY; without even the implied warranty of
11e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat%  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat%  GNU General Public License for more details.
13e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat%
14e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat%  You should have received a copy of the GNU General Public License
15e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat%  along with this program; if not, write to the Free Software
16e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat%  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat%
18e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat%  vi :set textwidth=75
19e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat%
20e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\documentclass{article}
21e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\usepackage{multirow,graphicx,placeins}
22e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
23e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\begin{document}
24e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat%---------------------
25e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\title{\texttt{btrecord} and \texttt{btreplay} User Guide}
26e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\author{Alan D. Brunelle (Alan.Brunelle@hp.com)}
27e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\date{\today}
28e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\maketitle
29e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\begin{abstract}
30e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\input{abstract.tex}
31e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\end{abstract}
32e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\thispagestyle{empty}\newpage
33e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat%---------------------
34e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\tableofcontents\thispagestyle{empty}\newpage
35e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat%---------------------
36e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\section{Introduction}
37e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\input{abstract.tex}
38e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
39e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\bigskip 
40e20e1347b9914aa05e30548c15d7cd5e412cc0e2San MehatThis document presents the command line overview for
41e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\texttt{btrecord} and \texttt{btreplay}, and shows some commonly used
42e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatexample usages of it in everyday work here at OSLO's Scalability and
43e20e1347b9914aa05e30548c15d7cd5e412cc0e2San MehatPerformance Group.
44e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
45e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\subsection*{Build Note}
46e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
47e20e1347b9914aa05e30548c15d7cd5e412cc0e2San MehatTo build these tools, one needs to
48e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatplace the source directory next to a valid
49e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\texttt{blktrace}\footnote{\texttt{git://git.kernel.dk/blktrace.git}}
50e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatdirectory, as it includes \texttt{../blktrace} in the \texttt{Makefile}.
51e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
52e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
53e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat%---------------------
54e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\newpage\section{\texttt{btrecord} and \texttt{btreplay} Operating Model}
55e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
56e20e1347b9914aa05e30548c15d7cd5e412cc0e2San MehatThe \texttt{blktrace} utility provides the ability to collect detailed
57e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehattraces from the kernel for each IO processed by the block IO layer. The
58e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehattraces provide a complete timeline for each IO processed, including
59e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatdetailed information concerning when an IO was first received by the block
60e20e1347b9914aa05e30548c15d7cd5e412cc0e2San MehatIO layer -- indicating the device, CPU number, time stamp, IO direction,
61e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatsector number and IO size (number of sectors). Using this information,
62e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatone is able to \emph{replay} the IO again on the same machine or another
63e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatset up entirely.
64e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
65e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\subsection{Basic Workflow}
66e20e1347b9914aa05e30548c15d7cd5e412cc0e2San MehatThe basic operating work-flow to replay IOs would be something like:
67e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
68e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\begin{enumerate}
69e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  \item Run \texttt{blktrace} to collect traces. Here you specify the
70e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  device or devices that you wish to trace and later replay IOs upon. Note:
71e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  the only traces you are interested in are \emph{QUEUE} requests --
72e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  thus, to save system resources (including storage for traces), one could
73e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  specify the \texttt{-a queue} command line option to \texttt{blktrace}.
74e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
75e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  \item While \texttt{blktrace} is running, you run the workload that you
76e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  are interested in. 
77e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
78e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  \item When the work load has completed, you stop the \texttt{blktrace}
79e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  utility (thus saving all traces over the complete workload). 
80e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
81e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  \item You extract the pertinent IO information from the traces saved by
82e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  \texttt{blktrace} using the \texttt{btrecord} utility. This will parse
83e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  each trace file created by \texttt{blktrace}, and craft IO descriptions
84e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  to be used in the next phase of the workload processing.
85e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
86e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  \item Once \texttt{btrecord} has successfully created a series of data
87e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  files to be processed, you can run the \texttt{btreplay} utility which
88e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  attempts to generate the same IOs seen during the sample workload phase.
89e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\end{enumerate}
90e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
91e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\subsection{IO Stream Replay Characteristics}
92e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  The major characteristics of the IO stream that are kept intact include:
93e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
94e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  \begin{description}
95e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat    \item[Device] The IOs are replayed on the same device as was seen
96e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat    during the sample workload.
97e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
98e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat    \item[IO direction] The same IO direction (read/write) is maintained.
99e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
100e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat    \item[IO offset] The same device offset is maintained.
101e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
102e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat    \item[IO size] The same number of sectors are transferred.
103e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
104e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat    \item[Time differential] The time stamps stored during the
105e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat    \texttt{blktrace} run are used to determine the amount of time between
106e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat    IOs during the sample workload. \texttt{btreplay} \emph{attempts} to
107e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat    maintain the same time differential between IOs, but no guarantees as
108e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat    to complete accuracy are provided by the utility.
109e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
110e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat    \item[Device IO Stream Ordering] All IOs on a device are submitted in
111e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat    the precise order they were seen during the sample workload run. 
112e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  \end{description}
113e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
114e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  As noted above, the time between IOs may not be accurately maintained
115e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  during replays. In addition the actual ordering of IOs \emph{between}
116e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  devices is not necessarily maintained. (Each device with an IO stream
117e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  maintains its own concept of time, and thus there may be slippage of the
118e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  time kept between managing threads.)
119e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
120e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  \begin{quotation}
121e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat    We have prototyped a different approach, wherein a single managing
122e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat    thread handles all IOs across all devices. This approach, while
123e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat    guaranteeing correct ordering of IOs across all devices, resulted in
124e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat    much worse timing on a per IO basis. 
125e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  \end{quotation}
126e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
127e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\subsection{\texttt{btrecord/btreplay} Method of Operation}
128e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
129e20e1347b9914aa05e30548c15d7cd5e412cc0e2San MehatAs noted above, \texttt{btrecord} extracts \texttt{QUEUE} operations from
130e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\texttt{blktrace} output. These \texttt{QUEUE} operations indicate the
131e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatentrance of IOs into the block IO layer. In order to replay these IOs with
132e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatsome accuracy in regards to ordering and timeliness, we decided to take
133e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatmultiple sequential (in time) IOs and put them in a single \emph{bunch} of
134e20e1347b9914aa05e30548c15d7cd5e412cc0e2San MehatIOs that will be processed as a single \emph{asynchronous IO} call to the
135e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatkernel\footnote{Attempts to do them individually resulted in too large of a
136e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatturnaround time penalty (user-space to kernel and back). Note that in a
137e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatnumber of workloads, the IOs are coming in from the page cache handling
138e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatcode, and thus are submitted to the block IO layer with \emph{very small}
139e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehattime intervals between issues.}. To manage the size of the \emph{bunches},
140e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatthe \texttt{btrecord} utility provides you with two controlling knobs:
141e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
142e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\begin{description}
143e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  \item[\texttt{--max-bunch-time}] This is the amount of time to encompass
144e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  in one bunch -- only IOs within the time specified are eligible
145e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  for \emph{bunching.} The default time is 10 milliseconds (10,000,000
146e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  nanoseconds). Refer to section~\ref{sec:c-o-m} on page~\pageref{sec:c-o-m}
147e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  for more information.
148e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
149e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  \item[\texttt{--max-pkts}] A \emph{bunch} size can be anywhere from
150e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  1 to 512 packets in size and by default we max a bunch to contain no
151e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  more than 8 individual IOs. With this option, one can increase or
152e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  decrease the maximum \emph{bunch} size.  Refer to section~\ref{sec:c-o-M}
153e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  on page~\pageref{sec:c-o-M} for more information.
154e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\end{description}
155e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
156e20e1347b9914aa05e30548c15d7cd5e412cc0e2San MehatEach input data file (one per device per CPU) results in a new record
157e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatdata file (again, one per device per CPU) which contains information
158e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatabout \emph{bunches} of IOs to be replayed. \texttt{btreplay} operates on
159e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatthese record data files by spawning a new pair of threads per file. One
160e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatthread manages the submitting of AIOs per bunch in the record data file,
161e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatwhile the other thread manages reclaiming AIOs completed\footnote{We
162e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehathave found that having the same thread do both results in a further
163e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatreduction in replay timing accuracy.}.
164e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
165e20e1347b9914aa05e30548c15d7cd5e412cc0e2San MehatEach submitting thread simply reads the input file of \emph{bunches}
166e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatrecorded by \texttt{btrecord}, and attempts to faithfully reproduce the
167e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatordering and timing of IOs seen during the sample workload. The reclaiming
168e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatthread simply waits for AIO completions, freeing up resources for the
169e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatsubmitting thread to utilize to submit new AIOs.
170e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
171e20e1347b9914aa05e30548c15d7cd5e412cc0e2San MehatThe number of CPUs being used on the replay system can be different from
172e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatthe number on the recorded system. To help with mappings here the
173e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\texttt{--cpus} option allows one to state how many CPUs on the replay
174e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatsystem to utilize. If the number of CPUs on the replay system is less than
175e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehaton the recording system, we wrap CPU IDs. This \emph{may} result in an
176e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatoverload of CPU processing capabilities on the replay system. (Refer to
177e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatsection~\ref{sec:p-o-c} on page~\pageref{sec:p-o-c} for more details about the
178e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\texttt{--cpus} option.)
179e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
180e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\newpage\subsection{Known Deficiencies and Proposed Possible Fixes}
181e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
182e20e1347b9914aa05e30548c15d7cd5e412cc0e2San MehatThe overall known deficiencies with this current set of utilities is
183e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatoutlined here, in some cases ideas on additions and/or improvements are
184e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatincluded as well.
185e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
186e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\begin{enumerate}
187e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  \item Lack of IO ordering across devices. 
188e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
189e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  \begin{quote}
190e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat    \emph{We could institute the notion of global time across threads,
191e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat    and thus ensure IO ordering across devices, with some reduction in
192e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat    timing accuracy.}
193e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  \end{quote}
194e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
195e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  \item Lack of IO timing accuracy -- additional time between IO bunches.
196e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
197e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  \begin{quote}
198e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat    \emph{This is the primary problem with any IO replay mechanism -- how
199e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat    to guarantee per-IO timing accuracy with respect to other replayed IOs?
200e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat    One idea to reduce errors in this area would be to push the IO replay
201e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat    into the kernel, where you \emph{may} receive more responsive timings.}
202e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  \end{quote}
203e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
204e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  \item Bunching of IOs results in reduced time amongst IOs within a bunch.
205e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
206e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  \begin{quote}
207e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat    \emph{The user has \emph{some} control over this (via the
208e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat    \texttt{--max-pkts} option). One \emph{could} simply specify
209e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat    \texttt{-max-pkts=1} and then each IO would be treated individually. Of
210e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat    course, this would probably then run into the problem of excessive
211e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat    inter-IO times.}
212e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  \end{quote}
213e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
214e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  \item 1-to-1 mapping of devices -- for now the devices on the replay
215e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  machine must be the same as on the recording machine. 
216e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
217e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  \begin{quote}
218e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat    \emph{It should be relatively trivial to add in the notion of
219e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat    mapping -- simply include a file that is read which maps devices
220e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat    on one machine to devices (with offsets and sizes) on the replay
221e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat    machine\footnote{The notion of an offset and device size to replay on
222e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat    could be used to both allow for a single device to masquerade as more
223e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat    than one device, and could be utilized in case the replay device is
224e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat    smaller than the recorded device.}.}
225e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat    
226e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat    \medskip\emph{One could also add in the notion of CPU mappings as well --
227e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat    device $D_{rec}$ managed by CPU $C_{rec}$ on the recorded system
228e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat    shall be replayed on device $D_{rep}$ and CPU $C_{rep}$ on the
229e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat    replay machine.}
230e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
231e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat    \bigskip
232e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat    \begin{quote}
233e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat      With version 0.9.1 we now support the \texttt{-M} option to do this
234e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat      -- see section~\ref{sec:p-o-M} on page~\pageref{sec:p-o-M} for more
235e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat      information on device mapping.
236e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat    \end{quote}
237e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  \end{quote}
238e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
239e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\end{enumerate}
240e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
241e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat%---------------------
242e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\newpage\section{\label{sec:command-line}Command Line Options}
243e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\subsection{\texttt{btrecord} Command Line Options}
244e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\begin{figure}[h!]
245e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\begin{verbatim}
246e20e1347b9914aa05e30548c15d7cd5e412cc0e2San MehatUsage: btrecord -- version 0.9.3
247e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
248e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat	[ -d <dir>  : --input-directory=<dir> ] Default: .
249e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat	[ -D <dir>  : --output-directory=<dir>] Default: .
250e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat	[ -F        : --find-traces           ] Default: Off
251e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat	[ -h        : --help                  ] Default: Off
252e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat	[ -m <nsec> : --max-bunch-time=<nsec> ] Default: 10 msec
253e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat	[ -M <pkts> : --max-pkts=<pkts>       ] Default: 8
254e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat	[ -o <base> : --output-base=<base>    ] Default: replay
255e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat	[ -v        : --verbose               ] Default: Off
256e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat	[ -V        : --version               ] Default: Off
257e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat	<dev>...                                Default: None
258e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\end{verbatim}
259e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\caption{\label{fig:btrecord--help}\texttt{btrecord --help} Output}
260e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\end{figure}
261e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\FloatBarrier
262e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
263e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\subsubsection{\label{sec:c-o-d}\texttt{-d} or
264e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\texttt{--input-directory}\\Set Input Directory}
265e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
266e20e1347b9914aa05e30548c15d7cd5e412cc0e2San MehatThe \texttt{-d} option requires a single parameter providing the directory
267e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatname for where input files are to be found. The default directory is the
268e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatcurrent directory (\texttt{.}).
269e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
270e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\subsubsection{\label{sec:c-o-D}\texttt{-D} or
271e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\texttt{--output-directory}\\Set Output Directory}
272e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
273e20e1347b9914aa05e30548c15d7cd5e412cc0e2San MehatThe \texttt{-D} option requires a single parameter providing the directory
274e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatname for where output files are to be placed. The default directory is the
275e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatcurrent directory (\texttt{.}).
276e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
277e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\subsubsection{\texttt{-F} or \texttt{--find-traces}\\Find Trace Files
278e20e1347b9914aa05e30548c15d7cd5e412cc0e2San MehatAutomatically}
279e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
280e20e1347b9914aa05e30548c15d7cd5e412cc0e2San MehatThe \texttt{-F} option instructs \texttt{btrecord} to go find all the
281e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehattrace files in the directory specified (either via the \texttt{-d}
282e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatoption, or in the default directory '.').
283e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
284e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\subsubsection{\texttt{-h} or \texttt{--help}\\Display Help Message}
285e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\subsubsection{\texttt{-V} or \texttt{--version}\\Display
286e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\texttt{btrecord}Version}
287e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
288e20e1347b9914aa05e30548c15d7cd5e412cc0e2San MehatThe \texttt{-h} option displays the command line options and
289e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatdefaults, as presented in figure~\ref{fig:btrecord--help} on
290e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatpage~\pageref{fig:btrecord--help}.
291e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
292e20e1347b9914aa05e30548c15d7cd5e412cc0e2San MehatThe \texttt{-V} option displays the \texttt{btreplay} version, as shown here:
293e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
294e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\begin{verbatim}
295e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat$ btrecord --version
296e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatbtrecord -- version 0.9.0
297e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\end{verbatim}
298e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
299e20e1347b9914aa05e30548c15d7cd5e412cc0e2San MehatBoth commands exit immediately after processing the option.
300e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
301e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\subsubsection{\label{sec:c-o-m}\texttt{-m} or
302e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\texttt{--max-bunch-time}\\Set Maximum Time Per Bunch}
303e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
304e20e1347b9914aa05e30548c15d7cd5e412cc0e2San MehatThe \texttt{-m} option requires a single parameter which specifies an
305e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatamount of time (in nanoseconds) to include in any one bunch of IOs that
306e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatare to be processed. The smaller the value, the smaller the number of
307e20e1347b9914aa05e30548c15d7cd5e412cc0e2San MehatIOs processed at one time -- perhaps yielding in more realistic replay.
308e20e1347b9914aa05e30548c15d7cd5e412cc0e2San MehatHowever, after a certain point the amount of overhead per bunch may result
309e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatin additional real replay time, thus yielding less accurate replay times.
310e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
311e20e1347b9914aa05e30548c15d7cd5e412cc0e2San MehatThe default value is 10,000,000 nanoseconds (10 milliseconds).
312e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
313e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\subsubsection{\label{sec:c-o-M}\texttt{-M} or
314e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\texttt{--max-pkts}\\Set Maximum Packets Per Bunch}
315e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
316e20e1347b9914aa05e30548c15d7cd5e412cc0e2San MehatThe \texttt{-M} option requires a single parameter which specifies the
317e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatmaximum number of IOs to store in a single bunch. As with the \texttt{-m}
318e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatoption (section~\ref{sec:c-o-m}), smaller values \emph{may} or \emph{may not}
319e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatyield more accurate replay times.
320e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
321e20e1347b9914aa05e30548c15d7cd5e412cc0e2San MehatThe default value is 8, with a maximum value of up to 512 being supported.
322e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
323e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\subsubsection{\label{sec:c-o-o}\texttt{-o} or
324e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\texttt{--output-base}\\Set Base Name for Output Files}
325e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
326e20e1347b9914aa05e30548c15d7cd5e412cc0e2San MehatEach output file has 3 fields:
327e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
328e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\begin{enumerate}
329e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  \item Device identifier (taken directly from the device name of the
330e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  \texttt{blktrace} output file).
331e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
332e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  \item \texttt{btrecord} base name -- by default ``replay''.
333e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
334e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  \item And the CPU number (again, taken directly from the
335e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  \texttt{blktrace} output file name).
336e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\end{enumerate}
337e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
338e20e1347b9914aa05e30548c15d7cd5e412cc0e2San MehatThis option requires a single parameter that will override the default name
339e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat(replay), and replace it with the specified value.
340e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
341e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\subsubsection{\label{sec:c-o-v}\texttt{-v} or
342e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\texttt{--verbose}\\Select Verbose Output}
343e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
344e20e1347b9914aa05e30548c15d7cd5e412cc0e2San MehatThis option will output some simple statistics at the end of a successful
345e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatrun. Figure~\ref{fig:verb-out} (page~\pageref{fig:verb-out}) shows
346e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatan example of some output, while figure~\ref{fig:verb-defs}
347e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat(page~\pageref{fig:verb-defs}) shows what the fields mean.
348e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
349e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\begin{figure}[h!]
350e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\begin{verbatim}
351e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatsdab:0: 580661 pkts (tot), 126030 pkts (replay), 89809 bunches, 1.4 pkts/bunch
352e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatsdab:1: 2559775 pkts (tot), 430172 pkts (replay), 293029 bunches, 1.5 pkts/bunch
353e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatsdab:2: 653559 pkts (tot), 136522 pkts (replay), 102288 bunches, 1.3 pkts/bunch
354e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatsdab:3: 474773 pkts (tot), 117849 pkts (replay), 69572 bunches, 1.7 pkts/bunch
355e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\end{verbatim}
356e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\caption{\label{fig:verb-out}Verbose Output Example}
357e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\end{figure}
358e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\FloatBarrier
359e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
360e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\begin{figure}[h!]
361e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\begin{description}
362e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  \item[Field 1] The first field contains the device name and CPU
363e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  identifier. Thus: \texttt{sdab:0:} means the device \texttt{sdab} and
364e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  traces on CPU 0. 
365e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
366e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  \item[Field 2] The second field contains the total number of packets
367e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  processed for each device file. 
368e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
369e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  \item[Field 3] The next field shows the number of packets eligible for
370e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  replay. 
371e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
372e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  \item[Field 4] The fourth field contains the total number of IO bunches. 
373e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
374e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  \item[Field 5] The last field shows the average number of IOs per bunch
375e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  recorded.
376e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\end{description}
377e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\caption{\label{fig:verb-defs}Verbose Field Definitions}
378e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\end{figure}
379e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\FloatBarrier
380e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
381e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat%---------------------
382e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\newpage\subsection{\texttt{btreplay} Command Line Options}
383e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\begin{figure}[h!]
384e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\begin{verbatim}
385e20e1347b9914aa05e30548c15d7cd5e412cc0e2San MehatUsage: btreplay -- version 0.9.3
386e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
387e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat	[ -c <cpus> : --cpus=<cpus>           ] Default: 1
388e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat	[ -d <dir>  : --input-directory=<dir> ] Default: .
389e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat	[ -F        : --find-records          ] Default: Off
390e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat	[ -h        : --help                  ] Default: Off
391e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat	[ -i <base> : --input-base=<base>     ] Default: replay
392e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat	[ -I <iters>: --iterations=<iters>    ] Default: 1
393e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat	[ -M <file> : --map-devs=<file>       ] Default: None
394e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat	[ -N        : --no-stalls             ] Default: Off
395e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat	[ -x <int>  : --acc-factor=<int>      ] Default: 1
396e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat	[ -v        : --verbose               ] Default: Off
397e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat	[ -V        : --version               ] Default: Off
398e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat	[ -W        : --write-enable          ] Default: Off
399e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat	<dev...>                                Default: None
400e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\end{verbatim}
401e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\caption{\label{fig:btreplay--help}\texttt{btreplay --help} Output}
402e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\end{figure}
403e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\FloatBarrier
404e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
405e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\subsubsection{\label{sec:p-o-c}\texttt{-c} or
406e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\texttt{--cpus}\\Set Number of CPUs to Use}
407e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
408e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\subsubsection{\label{sec:p-o-d}\texttt{-d} or
409e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\texttt{--input-directory}\\Set Input Directory}
410e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
411e20e1347b9914aa05e30548c15d7cd5e412cc0e2San MehatThe \texttt{-d} option requires a single parameter providing the directory
412e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatname for where input files are to be found. The default directory is the
413e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatcurrent directory (\texttt{.}).
414e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
415e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\subsubsection{\texttt{-F} or \texttt{--find-records}\\Find RecordFiles
416e20e1347b9914aa05e30548c15d7cd5e412cc0e2San MehatAutomatically}
417e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
418e20e1347b9914aa05e30548c15d7cd5e412cc0e2San MehatThe \texttt{-F} option instructs \texttt{btreplay} to go find all the
419e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatrecord files in the directory specified (either via the \texttt{-d}
420e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatoption, or in the default directory '.').
421e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
422e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\subsubsection{\texttt{-h} or \texttt{--help}\\Display Help Message}
423e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\subsubsection{\texttt{-V} or \texttt{--version}\\Display
424e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\texttt{btreplay}Version}
425e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
426e20e1347b9914aa05e30548c15d7cd5e412cc0e2San MehatThe \texttt{-h} option displays the command line options and
427e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatdefaults, as presented in figure~\ref{fig:btreplay--help} on
428e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatpage~\pageref{fig:btreplay--help}.
429e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
430e20e1347b9914aa05e30548c15d7cd5e412cc0e2San MehatThe \texttt{-V} option displays the \texttt{btreplay} version, as show here:
431e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
432e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\begin{verbatim}
433e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat$ btreplay --version
434e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatbtreplay -- version 0.9.0
435e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\end{verbatim}
436e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
437e20e1347b9914aa05e30548c15d7cd5e412cc0e2San MehatBoth commands exit immediately after processing the option.
438e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
439e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\subsubsection{\label{sec:p-o-i}\texttt{-i} or
440e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\texttt{--input-base}\\Set Base Name for Input Files}
441e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
442e20e1347b9914aa05e30548c15d7cd5e412cc0e2San MehatEach input file has 3 fields:
443e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
444e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\begin{enumerate}
445e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  \item Device identifier (taken directly from the device name of the
446e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  \texttt{blktrace} output file).
447e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
448e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  \item \texttt{btrecord} base name -- by default ``replay''.
449e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
450e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  \item And the CPU number (again, taken directly from the
451e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  \texttt{blktrace} output file name).
452e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\end{enumerate}
453e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
454e20e1347b9914aa05e30548c15d7cd5e412cc0e2San MehatThis option requires a single parameter that will override the default name
455e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat(replay), and replace it with the specified value.
456e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
457e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\subsubsection{\label{sec:p-o-I}\texttt{-I} or
458e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\texttt{--iterations}\\Set Number of Iterations to Run}
459e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
460e20e1347b9914aa05e30548c15d7cd5e412cc0e2San MehatThis option requires a single parameter which specifies the number of times
461e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatto run through the input files. The default value is 1.
462e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
463e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\subsubsection{\label{sec:p-o-M}\texttt{-M} or \texttt{map-devs}\\
464e20e1347b9914aa05e30548c15d7cd5e412cc0e2San MehatSpecify Device Mappings}
465e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
466e20e1347b9914aa05e30548c15d7cd5e412cc0e2San MehatThis option requires a single parameter which specifies the name of a
467e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatfile containing device mappings. The file must be very simply managed, with
468e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatjust two pieces of data per line:
469e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
470e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\begin{enumerate}
471e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  \item The device name on the recorded system (with the \texttt{'/dev/'}
472e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  removed). Example: \texttt{/dev/sda} would just be \texttt{sda}.
473e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
474e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  \item The device name on the replay system to use (again, without the
475e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  \texttt{'/dev/'} path prepended).
476e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\end{enumerate}
477e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
478e20e1347b9914aa05e30548c15d7cd5e412cc0e2San MehatAn example file for when one would map devices \texttt{/dev/sda} and
479e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\texttt{/dev/sdb} on the recorded system to \texttt{dev/sdg} and
480e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\texttt{sdh} on the replay system would be:
481e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
482e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\begin{verbatim}
483e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatsda sdg
484e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatsdb sdh
485e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\end{verbatim}
486e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
487e20e1347b9914aa05e30548c15d7cd5e412cc0e2San MehatThe only entries in the file that are allowed are these two element lines
488e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat-- we do not (yet?) support the notion of blank lines, or comment lines, or
489e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatthe like.
490e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
491e20e1347b9914aa05e30548c15d7cd5e412cc0e2San MehatThe utility \emph{does} allow for multiple \texttt{-M} options to be
492e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatsupplied on the command line.
493e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
494e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\subsubsection{\label{sec:o-N}\texttt{-N} or \texttt{--no-stalls}\\Disable
495e20e1347b9914aa05e30548c15d7cd5e412cc0e2San MehatPre-bunch Stalls}
496e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
497e20e1347b9914aa05e30548c15d7cd5e412cc0e2San MehatWhen specified on the command line, all pre-bunch stall indicators will be
498e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatignored. IOs will be replayed without inter-bunch delays.
499e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
500e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\subsubsection{\label{sec:o-x}\texttt{-x} or \texttt{--acc-factor}\\Acceleration
501e20e1347b9914aa05e30548c15d7cd5e412cc0e2San MehatFactor}
502e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
503e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  While the \texttt{--no-stalls} option allows the traces to be replayed
504e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  with no waiting time, this option specifies some acceleration factor
505e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  to be used. If the value of two is used, then the stall time is
506e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  divided by half resulting in a reduction of the execution time by
507e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  this factor. Note that if this number is too high, the results will
508e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat  be equivalent of not having stall.
509e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
510e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\subsubsection{\label{sec:p-o-v}\texttt{-v} or
511e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\texttt{--verbose}\\Select Verbose Output}
512e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
513e20e1347b9914aa05e30548c15d7cd5e412cc0e2San MehatWhen specified on the command line, this option instructs \texttt{btreplay}
514e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatto store information concerning each \emph{stall} and IO operation
515e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatperformed by \texttt{btreplay}. The name of each file so created will be
516e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatthe input file name used with an extension of \texttt{.rep} appended onto
517e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatit. Thus, an input file of the name \texttt{sdab.replay.3} would generate a
518e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatverbose output file with the name \texttt{sdab.replay.3.rep} in the
519e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatdirectory specified for input files.
520e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
521e20e1347b9914aa05e30548c15d7cd5e412cc0e2San MehatIn addition, \texttt{btreplay} will also output to \texttt{stderr} the
522e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatnames of the input files being processed.
523e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
524e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\subsubsection{\label{sec:p-o-W}\texttt{-W} or
525e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\texttt{--write-enable}\\Enable Writing During Replay}
526e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
527e20e1347b9914aa05e30548c15d7cd5e412cc0e2San MehatAs a precautionary measure, by default \texttt{btreplay} will \emph{not}
528e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatprocess \emph{write} requests. In order to enable \texttt{btreplay} to
529e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehatactually \emph{write} to devices one must explicitly specify the
530e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\texttt{-W} option.
531e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat
532e20e1347b9914aa05e30548c15d7cd5e412cc0e2San Mehat\end{document}
533