From: Jens Axboe Date: Tue, 15 May 2007 11:23:19 +0000 (+0200) Subject: blktrace fixup + documentation X-Git-Tag: fio-1.16.2~22 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=6df8adaaadb71340b47f2c3e971297b656082ca5 blktrace fixup + documentation Add a little documentation on using blktrace data files. Signed-off-by: Jens Axboe --- diff --git a/HOWTO b/HOWTO index 0b438714..167ed7c7 100644 --- 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 - 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 -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 diff --git a/blktrace.c b/blktrace.c index 864e9dc7..1669fe55 100644 --- a/blktrace.c +++ b/blktrace.c @@ -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]++; + td->o.size += t->bytes; 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; } + td->o.size = 0; + ios[0] = ios[1] = 0; ttime = 0; do {