summaryrefslogtreecommitdiff
path: root/overlay/chart.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-08-17 21:14:10 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2013-08-17 21:14:10 +0100
commiteed59eac47bae095513a5b1b6286fdd556d8a760 (patch)
tree3937d8c00440dacc50358b1156bd0228a04fc55f /overlay/chart.c
parentcc9de398cf5232e547e9131d72782732a552fc56 (diff)
overlay: Show per-process wait times
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'overlay/chart.c')
-rw-r--r--overlay/chart.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/overlay/chart.c b/overlay/chart.c
index 185eaf07..46adbac2 100644
--- a/overlay/chart.c
+++ b/overlay/chart.c
@@ -83,9 +83,11 @@ void chart_add_sample(struct chart *chart, double value)
{
int pos;
- pos = chart->current_sample % chart->num_samples;
+ if (chart->num_samples == 0)
+ return;
+
+ pos = chart->current_sample++ % chart->num_samples;
chart->samples[pos] = value;
- chart->current_sample++;
}
static void chart_update_range(struct chart *chart)