blktrace fixup + documentation
authorJens Axboe <jens.axboe@oracle.com>
Tue, 15 May 2007 11:23:19 +0000 (13:23 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Tue, 15 May 2007 11:23:19 +0000 (13:23 +0200)
Add a little documentation on using blktrace data files.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
HOWTO
blktrace.c

diff --git a/HOWTO b/HOWTO
index 0b438714c56cba93b9f319178231b258bb2ee47e..167ed7c7f0adb472f186bee73d8d0d364e1484f3 100644 (file)
--- a/HOWTO
+++ b/HOWTO
@@ -618,7 +618,12 @@ write_iolog=str    Write the issued io patterns to the specified file. See
 
 read_iolog=str Open an iolog with the specified file name and replay the
                io patterns it contains. This can be used to store a
 
 read_iolog=str Open an iolog with the specified file name and replay the
                io patterns it contains. This can be used to store a
-               workload and replay it sometime later.
+               workload and replay it sometime later. The iolog given
+               may also be a blktrace binary file, which allows fio
+               to replay a workload captured by blktrace. See blktrace
+               for how to capture such logging data. For blktrace replay,
+               the file needs to be turned into a blkparse binary data
+               file first (blktrace <device> -d file_for_fio.bin).
 
 write_bw_log   If given, write a bandwidth log of the jobs in this job
                file. Can be used to store data of the bandwidth of the
 
 write_bw_log   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 864e9dc7900bf4971fcc70dc7720a0b89be7b42e..1669fe556bc3324d2b40567e0afdab0f0e359667 100644 (file)
@@ -100,6 +100,7 @@ static void handle_trace(struct thread_data *td, struct blk_io_trace *t,
 
        rw = (t->action & BLK_TC_ACT(BLK_TC_WRITE)) != 0;
        ios[rw]++;
 
        rw = (t->action & BLK_TC_ACT(BLK_TC_WRITE)) != 0;
        ios[rw]++;
+       td->o.size += t->bytes;
        store_ipo(td, t->sector, t->bytes, rw, ttime);
 }
 
        store_ipo(td, t->sector, t->bytes, rw, ttime);
 }
 
@@ -120,6 +121,8 @@ int load_blktrace(struct thread_data *td, const char *filename)
                return 1;
        }
 
                return 1;
        }
 
+       td->o.size = 0;
+
        ios[0] = ios[1] = 0;
        ttime = 0;
        do {
        ios[0] = ios[1] = 0;
        ttime = 0;
        do {