]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
pybootchartgui: show elapsed time for each task
authorMauro Queiros <Mauro.Queiros@criticaltechworks.com>
Mon, 29 May 2023 10:09:02 +0000 (10:09 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 31 May 2023 15:52:42 +0000 (16:52 +0100)
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 <Mauro.Queiros@criticaltechworks.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/pybootchartgui/pybootchartgui/draw.py

index 6d445aad4f40d2dbf83a727aadf3eed85cfcef6e..e71fe09ea65e91bc4b1359049f3622be4e3404c4 100644 (file)
@@ -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