aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2013-04-04 06:18:24 -0400
committerChris Mason <clm@fb.com>2014-09-24 12:02:08 -0700
commit7c883a9412d9dad32c23084c86272602bb7ffd5c (patch)
tree2b7869bafed787d2dce8a5867972585652cabf6c
parente4d4b5dc17dd1b2ec78e409efc8a36230772a377 (diff)
downloadblktrace-7c883a9412d9dad32c23084c86272602bb7ffd5c.tar.gz
iowatcher: 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--iowatcher/plot.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/iowatcher/plot.c b/iowatcher/plot.c
index 6d652dd..e187685 100644
--- a/iowatcher/plot.c
+++ b/iowatcher/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;