Fix ETA display for iolog replay
authorJens Axboe <jens.axboe@oracle.com>
Mon, 3 Sep 2007 08:09:37 +0000 (10:09 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Mon, 3 Sep 2007 08:09:37 +0000 (10:09 +0200)
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 <jens.axboe@oracle.com>
filesetup.c
log.c

index 8630abdee40f7293f1c33894ab88f3569d2f1f20..ff1385cdd02675f252b68502b4d59badd022d7d1 100644 (file)
@@ -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 7a3327e5d29c2909700ba3413ae1bd903ce1f197..759771ae6a5d3167b7fcb36f92990164d3faf351 100644 (file)
--- 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);