From: Jens Axboe Date: Tue, 15 May 2007 11:10:41 +0000 (+0200) Subject: blktrace support now works X-Git-Tag: fio-1.16.2~23 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=a2eea81b53fc1a71b91b20d82bcadffdd4ecb6cd blktrace support now works One little buglet - the blktrace offset is the sector, not the byte offset. For now it's hardcoded at 512, should really get the value from the device. Signed-off-by: Jens Axboe --- diff --git a/blktrace.c b/blktrace.c index 3f0938f2..864e9dc7 100644 --- a/blktrace.c +++ b/blktrace.c @@ -64,7 +64,10 @@ static void store_ipo(struct thread_data *td, unsigned long long offset, memset(ipo, 0, sizeof(*ipo)); INIT_LIST_HEAD(&ipo->list); - ipo->offset = offset; + /* + * the 512 is wrong here, it should be the hardware sector size... + */ + ipo->offset = offset * 512; ipo->len = bytes; ipo->delay = ttime / 1000; if (rw) @@ -86,6 +89,14 @@ static void handle_trace(struct thread_data *td, struct blk_io_trace *t, if ((t->action & 0xffff) != __BLK_TA_QUEUE) return; + if (t->action & BLK_TC_ACT(BLK_TC_PC)) + return; + + /* + * should not happen, need to look into that... + */ + if (!t->bytes) + return; rw = (t->action & BLK_TC_ACT(BLK_TC_WRITE)) != 0; ios[rw]++;