From: mephi42 Date: Wed, 31 May 2017 19:23:00 +0000 (+0200) Subject: draw.py: tolerate total_time == 0 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=550f713252a32ecfdc81c9407b1ed6630a5c4fd0;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git 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 --- diff --git a/scripts/pybootchartgui/pybootchartgui/draw.py b/scripts/pybootchartgui/pybootchartgui/draw.py index 201ce4577fc..b21690d61dd 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