Add option to skip delays when replaying traces
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
diff --git a/HOWTO b/HOWTO
index 0ef7ca4..2bbaad0 100644
--- a/HOWTO
+++ b/HOWTO
@@ -986,6 +986,13 @@
for how to capture such logging data. For blktrace replay,
the file needs to be turned into a blkparse binary data
file first (blkparse <device> -o /dev/null -d file_for_fio.bin).
+
+replay_no_stall=int When replaying I/O with read_iolog the default behavior
+ is to attempt to respect the time stamps within the log and replay
+ them with the appropriate delay between IOPS. By setting this variable
+ fio will not respect the timestamps and attempt to replay them as fast
+ as possible while still respecting ordering. The result is the same
+ I/O pattern to a given device, but different timings.
write_bw_log=str If given, write a bandwidth log of the jobs in this job
file. Can be used to store data of the bandwidth of the
diff --git a/blktrace.c b/blktrace.c
index 68ba964..6cf8d46 100644
--- a/blktrace.c
+++ b/blktrace.c
@@ -341,8 +341,16 @@
delay = t.time - ttime;
if ((t.action & BLK_TC_ACT(BLK_TC_WRITE)) && read_only)
skipped_writes++;
- else
+ else {
+ /*
+ * set delay to zero if no_stall enabled for
+ * fast replay
+ */
+ if (td->o.no_stall)
+ delay = 0;
+
handle_trace(td, &t, delay, ios, rw_bs);
+ }
ttime = t.time;
cpu = t.cpu;
diff --git a/fio.1 b/fio.1
index c5c10af..1c0dc79 100644
--- a/fio.1
+++ b/fio.1
@@ -740,6 +740,12 @@
Replay the I/O patterns contained in the specified file generated by
\fBwrite_iolog\fR, or may be a \fBblktrace\fR binary file.
.TP
+.BI replay_no_stall \fR=\fPint
+While replaying I/O patterns using \fBread_iolog\fR the default behavior
+attempts to respect timing information between I/Os. Enabling
+\fBreplay_no_stall\fR causes I/Os to be replayed as fast as possible while
+still respecting ordering.
+.TP
.B write_bw_log \fR=\fPstr
If given, write a bandwidth log of the jobs in this job file. Can be used to
store data of the bandwidth of the jobs in their lifetime. The included
@@ -747,7 +753,7 @@
graphs. See \fBwrite_log_log\fR for behaviour of given filename. For this
option, the postfix is _bw.log.
.TP
-.B write_lat_log
+.B write_lat_log \fR=\fPstr
Same as \fBwrite_bw_log\fR, but writes I/O completion latencies. If no
filename is given with this option, the default filename of "jobname_type.log"
is used. Even if the filename is given, fio will still append the type of log.
diff --git a/fio.h b/fio.h
index 5788107..ad47762 100644
--- a/fio.h
+++ b/fio.h
@@ -254,6 +254,7 @@
unsigned int gtod_cpu;
unsigned int gtod_offload;
enum fio_cs clocksource;
+ unsigned int no_stall;
char *read_iolog_file;
char *write_iolog_file;
diff --git a/options.c b/options.c
index 7a9d5d3..82a7289 100644
--- a/options.c
+++ b/options.c
@@ -1482,6 +1482,13 @@
.help = "Playback IO pattern from file",
},
{
+ .name = "replay_no_stall",
+ .type = FIO_OPT_INT,
+ .off1 = td_var_offset(no_stall),
+ .def = "0",
+ .help = "Playback IO pattern file as fast as possible without stalls",
+ },
+ {
.name = "exec_prerun",
.type = FIO_OPT_STR_STORE,
.off1 = td_var_offset(exec_prerun),