From: Mauro Queiros Date: Mon, 29 May 2023 10:09:02 +0000 (+0000) Subject: pybootchartgui: show elapsed time for each task X-Git-Tag: uninative-4.1~620 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3efebd3404de548f0757863da237f2d18ce60013;p=thirdparty%2Fopenembedded%2Fopenembedded-core.git pybootchartgui: show elapsed time for each task Currently, finding the elapsed time of each task in buildtimes.svg is a manual effort of checking the top axis and finding and subtracting the end and start time of the task. This change adds the elapsed time for each task, so that manual effort of comparing start/end time is avoided. Signed-off-by: Mauro Queiros Signed-off-by: Alexandre Belloni Signed-off-by: Richard Purdie --- diff --git a/scripts/pybootchartgui/pybootchartgui/draw.py b/scripts/pybootchartgui/pybootchartgui/draw.py index 6d445aad4f4..e71fe09ea65 100644 --- a/scripts/pybootchartgui/pybootchartgui/draw.py +++ b/scripts/pybootchartgui/pybootchartgui/draw.py @@ -682,6 +682,11 @@ def render_processes_chart(ctx, options, trace, curr_y, w, h, sec_w): draw_rect(ctx, PROC_BORDER_COLOR, (x, y, w, proc_h)) 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 return curr_y