Add option to skip delays when replaying traces
authorDavid Nellans <dnellans@fusionio.com>
Tue, 24 Aug 2010 20:13:30 +0000 (22:13 +0200)
committerJens Axboe <jaxboe@fusionio.com>
Tue, 24 Aug 2010 20:13:30 +0000 (22:13 +0200)
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
HOWTO
blktrace.c
fio.1
fio.h
options.c

diff --git a/HOWTO b/HOWTO
index 0ef7ca42120d175c3115207861f50b964a07958e..2bbaad0a5d574dfe21a80513027a603179deb7ef 100644 (file)
--- a/HOWTO
+++ b/HOWTO
@@ -986,6 +986,13 @@ read_iolog=str     Open an iolog with the specified file name and replay the
                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
index 68ba964a3a363c6f5e85ac19e5410134e1943238..6cf8d461fb0aea44bc292eccc2b983747f5a5432 100644 (file)
@@ -341,8 +341,16 @@ int load_blktrace(struct thread_data *td, const char *filename)
                                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 c5c10af44ae6c3df8d17980bd3e2b883d5cc717a..1c0dc795c245120b6e6f3f9b681553db80753477 100644 (file)
--- a/fio.1
+++ b/fio.1
@@ -740,6 +740,12 @@ Write the issued I/O patterns to the specified file.
 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 @@ fio_generate_plots script uses gnuplot to turn these text files into nice
 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 57881072b2156162209eb7c386e80f50a0c1cc45..ad47762675fe86281f479c0b11dc58f8ce35cb0a 100644 (file)
--- a/fio.h
+++ b/fio.h
@@ -254,6 +254,7 @@ struct thread_options {
        unsigned int gtod_cpu;
        unsigned int gtod_offload;
        enum fio_cs clocksource;
+       unsigned int no_stall;
 
        char *read_iolog_file;
        char *write_iolog_file;
index 7a9d5d392ad60afbc9f7431362746d3ed79bffb9..82a7289e517ff1d316f8b14fa59f592b11903f57 100644 (file)
--- a/options.c
+++ b/options.c
@@ -1481,6 +1481,13 @@ static struct fio_option options[FIO_MAX_OPTS] = {
                .off1   = td_var_offset(read_iolog_file),
                .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,