diff options
author | Jose Quaresma <quaresma.jose@gmail.com> | 2023-07-10 22:24:17 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-07-14 17:31:05 +0100 |
commit | 174e1790b7740037ed879021b426f31eea8be703 (patch) | |
tree | 99d93677cdd84661f332f4ec76296a4ce6cdb9d8 | |
parent | e62c3540f27fb7133cb0aae293482b19c4566510 (diff) | |
download | poky-174e1790b7740037ed879021b426f31eea8be703.tar.gz |
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 <jose.quaresma@foundries.io>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | scripts/pybootchartgui/pybootchartgui/draw.py | 6 |
1 files changed, 3 insertions, 3 deletions
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): | |||
646 | offset = trace.min or min(trace.start.keys()) | 646 | offset = trace.min or min(trace.start.keys()) |
647 | for start in sorted(trace.start.keys()): | 647 | for start in sorted(trace.start.keys()): |
648 | for process in sorted(trace.start[start]): | 648 | for process in sorted(trace.start[start]): |
649 | elapsed_time = trace.processes[process][1] - start | ||
649 | if not options.app_options.show_all and \ | 650 | if not options.app_options.show_all and \ |
650 | trace.processes[process][1] - start < options.app_options.mintime: | 651 | elapsed_time < options.app_options.mintime: |
651 | continue | 652 | continue |
652 | task = process.split(":")[1] | 653 | task = process.split(":")[1] |
653 | 654 | ||
@@ -656,7 +657,7 @@ def render_processes_chart(ctx, options, trace, curr_y, w, h, sec_w): | |||
656 | #print(s) | 657 | #print(s) |
657 | 658 | ||
658 | x = chart_rect[0] + (start - offset) * sec_w | 659 | x = chart_rect[0] + (start - offset) * sec_w |
659 | w = ((trace.processes[process][1] - start) * sec_w) | 660 | w = elapsed_time * sec_w |
660 | 661 | ||
661 | #print("proc at %s %s %s %s" % (x, y, w, proc_h)) | 662 | #print("proc at %s %s %s %s" % (x, y, w, proc_h)) |
662 | col = None | 663 | col = None |
@@ -684,7 +685,6 @@ def render_processes_chart(ctx, options, trace, curr_y, w, h, sec_w): | |||
684 | draw_label_in_box(ctx, PROC_TEXT_COLOR, process, x, y + proc_h - 4, w, proc_h) | 685 | draw_label_in_box(ctx, PROC_TEXT_COLOR, process, x, y + proc_h - 4, w, proc_h) |
685 | 686 | ||
686 | # Show elapsed time for each task | 687 | # Show elapsed time for each task |
687 | elapsed_time = f"{trace.processes[process][1] - start}s" | ||
688 | draw_text(ctx, elapsed_time, PROC_TEXT_COLOR, x + w + 4, y + proc_h - 4) | 688 | draw_text(ctx, elapsed_time, PROC_TEXT_COLOR, x + w + 4, y + proc_h - 4) |
689 | 689 | ||
690 | y = y + proc_h | 690 | y = y + proc_h |