From 35686f9be692c9b9dde821df8b0947e6fe5dce7f Mon Sep 17 00:00:00 2001 From: Jan Kara Date: Thu, 6 Sep 2012 10:14:59 +0200 Subject: [PATCH] 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 --- iowatcher/blkparse.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) 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; -- 2.25.1