From 64bbb86598ada3fa401c61aab5ef6c37bec6d6f3 Mon Sep 17 00:00:00 2001 From: David Nellans Date: Tue, 24 Aug 2010 22:13:30 +0200 Subject: [PATCH] Add option to skip delays when replaying traces Signed-off-by: Jens Axboe --- HOWTO | 7 +++++++ blktrace.c | 10 +++++++++- fio.1 | 8 +++++++- fio.h | 1 + options.c | 7 +++++++ 5 files changed, 31 insertions(+), 2 deletions(-) diff --git a/HOWTO b/HOWTO index 0ef7ca42..2bbaad0a 100644 --- 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 -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 68ba964a..6cf8d461 100644 --- a/blktrace.c +++ b/blktrace.c @@ -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 c5c10af4..1c0dc795 100644 --- 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 57881072..ad477626 100644 --- 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; diff --git a/options.c b/options.c index 7a9d5d39..82a7289e 100644 --- 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, -- 2.25.1