iowatcher: Ignore trace records beyond max_seconds
authorJan Kara <jack@suse.cz>
Thu, 6 Sep 2012 08:14:59 +0000 (10:14 +0200)
committerChris Mason <chris.mason@oracle.com>
Tue, 11 Sep 2012 00:53:05 +0000 (20:53 -0400)
Currently we report error when we find a trace record beyond max_seconds.
When we allow user to set end of displayed period, records after the end
of period are no longer a bug so just ignore them.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
iowatcher/blkparse.c

index 675a7716babb5df57b0e728b0c75b4a2cad44413..ab7a637d06348b045eecf12e175569ec425a39fa 100644 (file)
@@ -638,10 +638,8 @@ void add_tput(struct trace *trace, struct graph_line_data *gld)
                return;
 
        seconds = SECONDS(io->time);
-       if (seconds > gld->max_seconds) {
-               fprintf(stderr, "Bad record %d %d %d\n", seconds, gld->max_seconds, action);
-               abort();
-       }
+       if (seconds > gld->max_seconds)
+               return;
 
        gld->data[seconds].sum += io->bytes;
        gld->data[seconds].count = 1;
@@ -685,10 +683,8 @@ void add_pending_io(struct trace *trace, struct graph_line_data *gld)
                return;
 
        seconds = SECONDS(io->time);
-       if (seconds > gld->max_seconds) {
-               fprintf(stderr, "Bad record %d %d\n", seconds, gld->max_seconds);
-               abort();
-       }
+       if (seconds > gld->max_seconds)
+               return;
 
        ret = hash_dispatched_io(trace->io);
        if (ret)
@@ -759,10 +755,8 @@ void add_iop(struct trace *trace, struct graph_line_data *gld)
                return;
 
        seconds = SECONDS(io->time);
-       if (seconds > gld->max_seconds) {
-               fprintf(stderr, "Bad record %d %d\n", seconds, gld->max_seconds);
-               abort();
-       }
+       if (seconds > gld->max_seconds)
+               return;
 
        gld->data[seconds].sum += 1;
        gld->data[seconds].count = 1;