From a2eea81b53fc1a71b91b20d82bcadffdd4ecb6cd Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Tue, 15 May 2007 13:10:41 +0200 Subject: [PATCH] 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 --- blktrace.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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]++; -- 2.25.1