summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormephi42 <mephi42@gmail.com>2017-05-31 21:23:00 +0200
committerArmin Kuster <akuster808@gmail.com>2019-05-03 18:33:23 -0700
commit550f713252a32ecfdc81c9407b1ed6630a5c4fd0 (patch)
tree5069036a022c4365d8ec7d82f9ac219988b2103a
parent404bbb2a0fc6442dbe277e877de64f4ee0c4eebb (diff)
downloadopenembedded-core-contrib-550f713252a32ecfdc81c9407b1ed6630a5c4fd0.tar.gz
draw.py: tolerate total_time == 0
Sometimes I get all 0s in sample.cpu_sample.sample_value, and pybootchartgui crashes with division by zero. Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--scripts/pybootchartgui/pybootchartgui/draw.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/pybootchartgui/pybootchartgui/draw.py b/scripts/pybootchartgui/pybootchartgui/draw.py
index 201ce4577f..b21690d61d 100644
--- a/scripts/pybootchartgui/pybootchartgui/draw.py
+++ b/scripts/pybootchartgui/pybootchartgui/draw.py
@@ -825,7 +825,7 @@ def draw_cuml_graph(ctx, proc_tree, chart_bounds, duration, sec_w, stat_type):
# all the sample times
times = sorted(time_hash)
- if len (times) < 2:
+ if len (times) < 2 or total_time == 0:
print("degenerate boot chart")
return