From: Jan Kara Date: Thu, 6 Sep 2012 08:14:59 +0000 (+0200) Subject: iowatcher: Ignore trace records beyond max_seconds X-Git-Tag: blktrace-1.1.0~2^2~43^2~3 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=35686f9be692c9b9dde821df8b0947e6fe5dce7f;p=blktrace.git iowatcher: Ignore trace records beyond max_seconds 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 Signed-off-by: Chris Mason --- diff --git a/iowatcher/blkparse.c b/iowatcher/blkparse.c index 675a771..ab7a637 100644 --- a/iowatcher/blkparse.c +++ b/iowatcher/blkparse.c @@ -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;