summaryrefslogtreecommitdiff
path: root/blkparse.c
diff options
context:
space:
mode:
authorLuis Useche <luis@cis.fiu.edu>2008-05-05 20:53:10 +0200
committerJens Axboe <jens.axboe@oracle.com>2008-05-05 20:53:10 +0200
commit7072ee3f2f12a1363d6f7378df3f268350e5bd52 (patch)
tree5c8082e46f1e2312cc354aeb6fb5af6883e76c51 /blkparse.c
parenta26daeb87cd49c2d6640965337cf625ae800c35a (diff)
downloadblktrace-7072ee3f2f12a1363d6f7378df3f268350e5bd52.tar.gz
blktrace-7072ee3f2f12a1363d6f7378df3f268350e5bd52.tar.bz2
Fix problem with -w option
This patch fixes the problem when the -w option is used in the file mode (i.e., no fifo mode). It just consists of moving the checking of the stopwatch_end after the time is updated with genesis. This also includes the checking of the stopwatch_start. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'blkparse.c')
-rw-r--r--blkparse.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/blkparse.c b/blkparse.c
index a2badc6..6226e69 100644
--- a/blkparse.c
+++ b/blkparse.c
@@ -2418,17 +2418,19 @@ static int handle(struct ms_stream *msp)
struct blk_io_trace *bit;
t = ms_peek(msp);
- if (t->bit->time > stopwatch_end)
- return 0;
bit = t->bit;
pdi = msp->pdi;
pci = get_cpu_info(pdi, msp->cpu);
pci->nelems++;
-
bit->time -= genesis_time;
+
+ if (t->bit->time > stopwatch_end)
+ return 0;
+
pdi->last_reported_time = bit->time;
- if (bit->action & (act_mask << BLK_TC_SHIFT))
+ if ((bit->action & (act_mask << BLK_TC_SHIFT))&&
+ t->bit->time >= stopwatch_start)
dump_trace(bit, pci, pdi);
ms_deq(msp);