]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
draw.py: tolerate total_time == 0
authormephi42 <mephi42@gmail.com>
Wed, 31 May 2017 19:23:00 +0000 (21:23 +0200)
committerArmin Kuster <akuster808@gmail.com>
Sat, 4 May 2019 01:33:23 +0000 (18:33 -0700)
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>
scripts/pybootchartgui/pybootchartgui/draw.py

index 201ce4577fcba4c2dd476135fc48824d6748ee88..b21690d61dd51fa90afa7213fc14873f1a250e95 100644 (file)
@@ -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