From: Jens Axboe Date: Mon, 3 Sep 2007 08:09:37 +0000 (+0200) Subject: Fix ETA display for iolog replay X-Git-Tag: fio-1.17.1~1 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=ea966f8188915643670fd0a13d1bf37d45936da5 Fix ETA display for iolog replay Valerie Henson reported (and supplied a patch) to fix the issue with ETA display not being anywhere near correct when replaying an iolog. Fix this by ensuring that td->total_io_size is always set correctly. Signed-off-by: Jens Axboe --- diff --git a/filesetup.c b/filesetup.c index 8630abde..ff1385cd 100644 --- a/filesetup.c +++ b/filesetup.c @@ -454,7 +454,12 @@ int setup_files(struct thread_data *td) if (!td->o.zone_size) td->o.zone_size = td->o.size; - td->total_io_size = td->o.size * td->o.loops; + /* + * iolog already set the total io size, if we read back + * stored entries. + */ + if (!td->o.read_iolog_file) + td->total_io_size = td->o.size * td->o.loops; return 0; err_offset: log_err("%s: you need to specify valid offset=\n", td->o.name); diff --git a/log.c b/log.c index 7a3327e5..759771ae 100644 --- a/log.c +++ b/log.c @@ -256,6 +256,7 @@ static int read_iolog2(struct thread_data *td, FILE *f) ipo->file_action = file_action; } list_add_tail(&ipo->list, &td->io_log_list); + td->total_io_size += bytes; } free(str); @@ -316,6 +317,7 @@ static int read_iolog(struct thread_data *td, FILE *f) if (bytes > td->o.max_bs[rw]) td->o.max_bs[rw] = bytes; list_add_tail(&ipo->list, &td->io_log_list); + td->total_io_size += bytes; } free(str);