San Mehat | e20e134 | 2009-06-03 15:36:35 -0700 | [diff] [blame] | 1 | .TH BTREPLAY 8 "December 8, 2007" "blktrace git\-20071207142532" "" |
| 2 | |
| 3 | |
| 4 | .SH NAME |
| 5 | btreplay \- recreate IO loads recorded by blktrace |
| 6 | |
| 7 | |
| 8 | .SH SYNOPSIS |
| 9 | .B btreplay [ \fIoptions\fR ] <\fIdev\fR...> |
| 10 | |
| 11 | |
| 12 | .SH DESCRIPTION |
| 13 | |
| 14 | .P |
| 15 | The \fIbtrecord\fR and \fIbtreplay\fR tools provide the ability to |
| 16 | record and replay IOs captured by the \fIblktrace\fR utility. Attempts |
| 17 | are made to maintain ordering, CPU mappings and time-separation of IOs. |
| 18 | |
| 19 | |
| 20 | .P |
| 21 | The \fIblktrace\fR utility provides the ability to collect detailed |
| 22 | traces from the kernel for each IO processed by the block IO layer. The |
| 23 | traces provide a complete timeline for each IO processed, including |
| 24 | detailed information concerning when an IO was first received by the block |
| 25 | IO layer \(em indicating the device, CPU number, time stamp, IO direction, |
| 26 | sector number and IO size (number of sectors). Using this information, |
| 27 | one is able to \fBreplay\fR the IO again on the same machine or another |
| 28 | set up entirely. |
| 29 | |
| 30 | .P |
| 31 | The basic operating work-flow to replay IOs would be something like: |
| 32 | |
| 33 | .IP \- 2 |
| 34 | Run \fIblktrace\fR to collect traces. Here you specify the |
| 35 | device or devices that you wish to trace and later replay IOs upon. Note: |
| 36 | the only traces you are interested in are \fBQUEUE\fR requests \(em |
| 37 | thus, to save system resources (including storage for traces), one could |
| 38 | specify the \fI-a queue\fR command line option to \fIblktrace\fR. |
| 39 | |
| 40 | .IP \- 2 |
| 41 | While \fIblktrace\fR is running, you run the workload that you |
| 42 | are interested in. |
| 43 | |
| 44 | .IP \- 2 |
| 45 | When the work load has completed, you stop the \fIblktrace\fR |
| 46 | utility (thus saving all traces over the complete workload). |
| 47 | |
| 48 | .IP \- 2 |
| 49 | You extract the pertinent IO information from the traces saved by |
| 50 | \fIblktrace\fR using the \fIbtrecord\fR utility. This will parse |
| 51 | each trace file created by \fIblktrace\fR, and crafty IO descriptions |
| 52 | to be used in the next phase of the workload processing. |
| 53 | |
| 54 | .IP \- 2 |
| 55 | Once \fIbtrecord\fR has successfully created a series of data |
| 56 | files to be processed, you can run the \fIbtreplay\fR utility which |
| 57 | attempts to generate the same IOs seen during the sample workload phase. |
| 58 | |
| 59 | |
| 60 | .SH OPTIONS |
| 61 | |
| 62 | \-c <\fInum\fR> |
| 63 | .br |
| 64 | \-\-cpus=<\fInum\fR> |
| 65 | .RS |
| 66 | Set number of CPUs to use. |
| 67 | .RE |
| 68 | |
| 69 | \-d <\fIdir\fR> |
| 70 | .br |
| 71 | \-\-input\-directory=<\fIdir\fR> |
| 72 | .RS |
| 73 | Set input directory. |
| 74 | This option requires a single parameter providing the directory |
| 75 | name for where input files are to be found. The default directory is the |
| 76 | current directory (\fI.\fR). |
| 77 | .RE |
| 78 | |
| 79 | \-F |
| 80 | .br |
| 81 | \-\-find\-records |
| 82 | .RS |
| 83 | Find record files automatically |
| 84 | This option instructs \fIbtreplay\fR to go find all the record files in the |
| 85 | directory specified (either via the \fI-d\fR option, or in the default |
| 86 | directory (\fI.\fR). |
| 87 | .RE |
| 88 | |
| 89 | \-h |
| 90 | .br |
| 91 | \-\-help |
| 92 | .RS |
| 93 | Show help and exit. |
| 94 | .RE |
| 95 | |
| 96 | \-i <\fIbasename\fR> |
| 97 | .br |
| 98 | \-\-input\-base=<\fIbasename\fR> |
| 99 | .RS |
| 100 | Set base name for input files. |
| 101 | Each input file has 3 fields: |
| 102 | .IP 1. 3 |
| 103 | Device identifier (taken directly from the device name of the |
| 104 | \fIblktrace\fR output file). |
| 105 | .IP 2. 3 |
| 106 | \fIbtrecord\fR base name \(em by default ``replay''. |
| 107 | .IP 3. 3 |
| 108 | The CPU number (again, taken directly from the |
| 109 | \fIblktrace\fR output file name). |
| 110 | .P |
| 111 | This option requires a single parameter that will override the default name |
| 112 | (replay), and replace it with the specified value. |
| 113 | .RE |
| 114 | |
| 115 | \-I <\fInum\fR> |
| 116 | .br |
| 117 | \-\-iterations=<\fInum\fR> |
| 118 | .RS |
| 119 | Set number of iterations to run. |
| 120 | This option requires a single parameter which specifies the number of times |
| 121 | to run through the input files. The default value is 1 |
| 122 | .RE |
| 123 | |
| 124 | \-M <\fIfilename\fR> |
| 125 | .br |
| 126 | \-\-map\-devs=<\fIfilename\fR> |
| 127 | .RS |
| 128 | Specify device mappings. |
| 129 | This option requires a single parameter which specifies the name of a |
| 130 | file contain device mappings. The file must be very simply managed, with |
| 131 | just two pieces of data per line: |
| 132 | |
| 133 | .IP \- 2 |
| 134 | The device name on the recorded system (with the '\fI/dev/\fR' |
| 135 | removed). Example: \fI/dev/sda\fR would just be \fIsda\fR. |
| 136 | |
| 137 | .IP \- 2 |
| 138 | The device name on the replay system to use (again, without the |
| 139 | '\fI/dev/\fR' path prepended). |
| 140 | |
| 141 | .P |
| 142 | An example file for when one would map devices \fI/dev/sda\fR and |
| 143 | \fI/dev/sdb\fR on the recorded system to \fIdev/sdg\fR and |
| 144 | \fIsdh\fR on the replay system would be: |
| 145 | |
| 146 | .nf |
| 147 | .IP |
| 148 | sda sdg |
| 149 | sdb sdh |
| 150 | .fi |
| 151 | |
| 152 | .P |
| 153 | The only entries in the file that are allowed are these two element lines \(em |
| 154 | we do not (yet?) support the notion of blank lines, or comment lines, or the |
| 155 | like. |
| 156 | |
| 157 | .P |
| 158 | The utility allows for multiple \fI-M\fR options to be |
| 159 | supplied on the command line. |
| 160 | .RE |
| 161 | |
| 162 | \-N |
| 163 | .br |
| 164 | \-\-no\-stalls |
| 165 | .RS |
| 166 | Disable pre-bunch stalls. |
| 167 | When specified on the command line, all pre-bunch stall indicators will be |
| 168 | ignored. IOs will be replayed without inter-bunch delays. |
| 169 | .RE |
| 170 | |
| 171 | \-v |
| 172 | .br |
| 173 | \-\-verbose |
| 174 | .RS |
| 175 | Enable verbose output. |
| 176 | When specified on the command line, this option instructs \fIbtreplay\fR |
| 177 | to store information concerning each \fBstall\fR and IO operation |
| 178 | performed by \fIbtreplay\fR. The name of each file so created will be |
| 179 | the input file name used with an extension of \fI.rep\fR appended onto |
| 180 | it. Thus, an input file of the name \fIsdab.replay.3\fR would generate a |
| 181 | verbose output file with the name \fIsdab.replay.3.rep\fR in the |
| 182 | directory specified for input files. |
| 183 | .P |
| 184 | In addition, \fIbtreplay\fR will also output to \fIstderr\fR the |
| 185 | names of the input files being processed. |
| 186 | .RE |
| 187 | |
| 188 | \-V |
| 189 | .br |
| 190 | \-\-version |
| 191 | .RS |
| 192 | Show version number and exit. |
| 193 | .RE |
| 194 | |
| 195 | \-W |
| 196 | .br |
| 197 | \-\-write-enable |
| 198 | .RS |
| 199 | Enable writing during replay. |
| 200 | As a precautionary measure, by default \fIbtreplay\fR will not |
| 201 | process \fBwrite\fR requests. In order to enable \fIbtreplay\fR to |
| 202 | actually \fBwrite\fR to devices one must explicitly specify the |
| 203 | \fI\-W\fR option. |
| 204 | .RE |
| 205 | |
| 206 | |
| 207 | .SH AUTHORS |
| 208 | \fIbtreplay\fR was written by Alan D. Brunelle. This |
| 209 | man page was created from the \fIbtreplay\fR documentation by Bas Zoetekouw. |
| 210 | |
| 211 | |
| 212 | .SH "REPORTING BUGS" |
| 213 | Report bugs to <linux\-btrace@vger.kernel.org> |
| 214 | |
| 215 | .SH COPYRIGHT |
| 216 | Copyright \(co 2007 Alan D. Brunelle, Alan D. Brunelle and Nathan Scott. |
| 217 | .br |
| 218 | This is free software. You may redistribute copies of it under the terms of |
| 219 | the GNU General Public License <http://www.gnu.org/licenses/gpl.html>. |
| 220 | There is NO WARRANTY, to the extent permitted by law. |
| 221 | .br |
| 222 | This manual page was created for Debian by Bas Zoetekouw. It was derived from |
| 223 | the documentation provided by the authors and it may be used, distributed and |
| 224 | modified under the terms of the GNU General Public License, version 2. |
| 225 | .br |
| 226 | On Debian systems, the text of the GNU General Public License can be found in |
| 227 | /usr/share/common\-licenses/GPL\-2. |
| 228 | |
| 229 | .SH "SEE ALSO" |
| 230 | The full documentation for btreplay can be found in /usr/share/doc/blktrace on Debian systems. |
| 231 | .br |
| 232 | blktrace (8), blkparse (1), btrecord (8) |
| 233 | |