aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2013-04-04 06:18:24 -0400
committerChris Mason <chris.mason@fusionio.com>2013-09-24 15:30:52 -0400
commitf57ca6aa2bbfbd0c9412010a6cadbd39926ff347 (patch)
tree7ffb5bc2df377d03d75049db07a1216654a1f6b9
parent85b5ed3fa1f71eb2c5fde43f85e862b486a77608 (diff)
downloadiowatcher-f57ca6aa2bbfbd0c9412010a6cadbd39926ff347.tar.gz
Do not add events out of time range to the plot
If the event is out of time range that should be plotted, do not add it. It will corrupt memory... Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
-rw-r--r--plot.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/plot.c b/plot.c
index 4f5e41d..f87acc2 100644
--- a/plot.c
+++ b/plot.c
@@ -206,8 +206,10 @@ void set_gdd_bit(struct graph_dot_data *gdd, u64 offset, double bytes, double ti
if (offset > gdd->max_offset || offset < gdd->min_offset)
return;
- gdd->total_ios++;
time = time / 1000000000.0;
+ if (time < gdd->min_seconds || time > gdd->max_seconds)
+ return;
+ gdd->total_ios++;
while (bytes > 0 && offset <= gdd->max_offset) {
row = (double)(offset - gdd->min_offset) / bytes_per_row;
col = (time - gdd->min_seconds) / secs_per_col;