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 <jens.axboe@oracle.com>
diff --git a/filesetup.c b/filesetup.c
index 8630abd..ff1385c 100644
--- a/filesetup.c
+++ b/filesetup.c
@@ -454,7 +454,12 @@
 	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 7a3327e..759771a 100644
--- a/log.c
+++ b/log.c
@@ -256,6 +256,7 @@
 			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 @@
 		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);