From 174e1790b7740037ed879021b426f31eea8be703 Mon Sep 17 00:00:00 2001 From: Jose Quaresma Date: Mon, 10 Jul 2023 22:24:17 +0000 Subject: pybootchartgui: calcule elapsed_time when starting the loop Instaed of calculate the elapsed time over the loop when needed do it on the loop startup. (From OE-Core rev: 63a19626f10873cd7a4aabee7c9777fdede83bcb) Signed-off-by: Jose Quaresma Signed-off-by: Alexandre Belloni Signed-off-by: Richard Purdie --- scripts/pybootchartgui/pybootchartgui/draw.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts/pybootchartgui') diff --git a/scripts/pybootchartgui/pybootchartgui/draw.py b/scripts/pybootchartgui/pybootchartgui/draw.py index e71fe09ea6..ddfa9a6192 100644 --- a/scripts/pybootchartgui/pybootchartgui/draw.py +++ b/scripts/pybootchartgui/pybootchartgui/draw.py @@ -646,8 +646,9 @@ def render_processes_chart(ctx, options, trace, curr_y, w, h, sec_w): offset = trace.min or min(trace.start.keys()) for start in sorted(trace.start.keys()): for process in sorted(trace.start[start]): + elapsed_time = trace.processes[process][1] - start if not options.app_options.show_all and \ - trace.processes[process][1] - start < options.app_options.mintime: + elapsed_time < options.app_options.mintime: continue task = process.split(":")[1] @@ -656,7 +657,7 @@ def render_processes_chart(ctx, options, trace, curr_y, w, h, sec_w): #print(s) x = chart_rect[0] + (start - offset) * sec_w - w = ((trace.processes[process][1] - start) * sec_w) + w = elapsed_time * sec_w #print("proc at %s %s %s %s" % (x, y, w, proc_h)) col = None @@ -684,7 +685,6 @@ def render_processes_chart(ctx, options, trace, curr_y, w, h, sec_w): draw_label_in_box(ctx, PROC_TEXT_COLOR, process, x, y + proc_h - 4, w, proc_h) # Show elapsed time for each task - elapsed_time = f"{trace.processes[process][1] - start}s" draw_text(ctx, elapsed_time, PROC_TEXT_COLOR, x + w + 4, y + proc_h - 4) y = y + proc_h -- cgit v1.2.3-54-g00ecf