Fix problem with -w option
authorLuis Useche <luis@cis.fiu.edu>
Mon, 5 May 2008 18:53:10 +0000 (20:53 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Mon, 5 May 2008 18:53:10 +0000 (20:53 +0200)
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>
blkparse.c

index a2badc6a2fa571074aaacf3582f70efaa7a6369d..6226e697b0d0444703ffb99fccc87e0824f56d82 100644 (file)
@@ -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);