From patchwork Fri Jun 19 07:21:30 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Mikanovich X-Patchwork-Id: 5167 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Fri, 19 Jun 2026 09:22:53 +0200 X-Sieve: CMU Sieve 2.4 Received: from mail-ed1-f61.google.com (mail-ed1-f61.google.com [209.85.208.61]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 65J7MphU000309 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 19 Jun 2026 09:22:51 +0200 Received: by mail-ed1-f61.google.com with SMTP id 4fb4d7f45d1cf-695c6b2814csf1572118a12.1 for ; Fri, 19 Jun 2026 00:22:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1781853765; cv=pass; d=google.com; s=arc-20240605; b=dvRuxTHx3M4eDk+VFUvU1Aep/NbMlSSxYEai21/POBEzDsTChrkkhtLEZ+4WS0e/b2 IrrbAeKW5R1oKdiX98prXJdsUfPLKhMnnc0N2LlU0C9CHtLe8D0Sm9NWqMJlPweLprQr A+PH+zaqksGpP87GSDvg1EMfJK7KbZsaozxBZ+k7Uvv/1vWPGWZLeo+w0/PEV+MUO0Hu 1BGA9+BSWXAmmk9w9CeGyn3bb9dAyqSxGw14Qgx8lDGkbh/NnGhEZqSksO4q75RGspjE 8I/7qUl0pGCi/ui+olob9a75Me7cCy+a1RJtiRGLWnuzRpFIBHxleeLURbEDBSCa+41P pMPA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:dkim-signature; bh=JzJ6E2Zx1ahGt9vvNT34kxiUJbm2nrjp2WK+zPLTs5M=; fh=w7TeQdUp1B5ZTNYkI5Gx8W96T1O8SU5U31cV76gDQzM=; b=U3TVu34D39GXpfPPRcNvFDLZ2qBaYOjKBBvmQ1XNzmrECZs2sE+t0dYAxKkYzSiEGn UvqKkZfgoVZNoVQymrvH0H3b29m9arw/I81rVDKFSx+I4V17cTIFOE12Y0TlpGYzMdQE zK/+QQfMF8ArgIeP4boVT3Dago5oZoF0KqZ3v49OVlYsYzq9xX+6Lp679ppqWPN9z0vD tniihrUCWDbfmQrMHK1l7HiCUzoRGW4zB0GWBqnCL/aW+yXBp4qfZaJ/aLoG4dZsfSEU wsxMnxdMBkLd1qbbeXDc3z7xDsgESLyHHmdWDEWiGbdxc6wMfPa6ox+9uN+Ha2GCuUbQ Q9Bw==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of amikan@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=amikan@ilbers.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20251104; t=1781853765; x=1782458565; darn=isar-build.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:sender:from:to:cc:subject:date:message-id :reply-to; bh=JzJ6E2Zx1ahGt9vvNT34kxiUJbm2nrjp2WK+zPLTs5M=; b=ugYaSuk0tqZoUA/RJNEDzVpCeHOUcP7WhSd/mVlH9KlnZRrVvw5tjYh1bDL/rRXjWZ SsSUlfhTLkF2dX5d4/AL5pP7Fwinqyi+6SY5785wmtDP+7arlhRJ8lHOUWyrANfQ1XZ1 ZnH3bJfcGg/7RbDY+XMKHCj1LJKrgeDf0XvUqnkV64ShulPQmpjBO+uumWDIhc1FIa7U 2RR/7x2cCFF7EQS0del7Pye3j9Cmk1Wt4hZpViHS0OBdU45iDY3e9VHRmv2+nBQ4f35e GkudXDvSJ/1vv0BdpASQDPCDhNdkkeTEkELP2vIXzToB3xVtl3IV4asehOeK9JNEUwlb nW5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781853765; x=1782458565; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-beenthere:x-gm-message-state:sender:from:to:cc:subject:date :message-id:reply-to; bh=JzJ6E2Zx1ahGt9vvNT34kxiUJbm2nrjp2WK+zPLTs5M=; b=pg5gVlVsaxT7msCia9K5nu32ciZa7iqQ/WIq5lSkqE6bMHak2gxH+e6/ye8tUjxSkN ETF2vaSl9k/USB3wr0tajKcs5hzjjVvx4Yp8DkCMq0BGeroh1hwYe/cY2TM845zx/sar Adr6JZrpVcWnEar4HYywSLgNj+H/+rg2Yo8YvTp/b4tr/xFOqMS9irzFueY0NXo5LuVD VlXhYgnDrMp0UWNGWoYc9K/Rw2pgLwK7zNKbpyO6GnXkeCmANvPYFofqDiAkjcLjeJlU SsFLhJTBrmislZgv5CMIQUNhybZqbm7Yl4qTrGW7NSmnR732Z8jYgLmL2JJXx5JodlCR avCw== Sender: isar-users@googlegroups.com X-Forwarded-Encrypted: i=2; AFNElJ+RmfAJ3SbWrMuGd/lr++PIyw8dhWD5yk+A1j3SJQ8io+CL+yQeHVRtwoj8TVF6inCYwzMYanY=@isar-build.org X-Gm-Message-State: AOJu0YyTrKw3P0ETSR1HuOdj8kQ2VLnSdvXSVxgokN0ttZGCb9oaU+gY LmPmpNT4YfRU9FI3F906B8s8OPMKDwjdCAjp9Xn+5OHGEzjD9s37oiVj X-Received: by 2002:a05:6402:3219:b0:68b:d10a:a490 with SMTP id 4fb4d7f45d1cf-69711deb3bbmr1117189a12.13.1781853765204; Fri, 19 Jun 2026 00:22:45 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com; h="AX0PUUdmZZc8wu8WBQZcit1z5Fx6lJSWwyvgujnEh3ZsTwP/lg==" Received: by 2002:a05:6402:2405:b0:67c:150d:3303 with SMTP id 4fb4d7f45d1cf-695bb71008dls1792878a12.2.-pod-prod-09-eu; Fri, 19 Jun 2026 00:22:43 -0700 (PDT) X-Received: by 2002:a05:6402:a291:10b0:697:6226:f39c with SMTP id 4fb4d7f45d1cf-6976226f70amr233737a12.1.1781853762918; Fri, 19 Jun 2026 00:22:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1781853762; cv=none; d=google.com; s=arc-20240605; b=Pd/PcZVDWCe0tZIfGB6ih6t30eHMLBiIjol22uMub5pKFri36eQT2cHt2kBkMuKC17 bvjKCe8EM8CHmZvyYrj4ESp4T9w7Tp2Sf8i36FOvfMLlqbZ4R/EGQ3K1vMpoTZj1G91q bTyorBfwCIMNXV0ruhhbEiHHgYv+NWzwPFS3I72t+3IotGcMwgztQSIOsdzY4vhJ2sy+ wwk1Pi4mpYbK2ijsLzd9oMzhC4uMq+HEz705Nn+FzgRvoKI3NzHRndn2axc/YKtLFyqF f0vulHTzCtT1qpiYTEoWUygaIAWqGZMlrRzY7jIQhMa13KKDqYxX8VxW65wRMiUVWyef fsHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=/rsXhCh0y//NA4jzyOZNyr7wilcsSUcFGDM2oRhxi2Y=; fh=/h9QQkzJ8EboVkWg45aWwpaUro6WMavIVd2OhN45RtE=; b=C+ql0mJid4H2XW6gd5bZYOaKRBbQ4ydqcBXaHByTPm9aUgNJmy8IbyOQioHPMR1nCj L6rT80ylmsgqjRDzkBV0Tl97liVoEI8rBJfHlon/TTORuA6ML9cI11JeuLR5YGzyD/0C hV6ejEyJaPMNwXA8oo4IGdDbrICT25bRWkdP5SkY00xI22QdG5QQHkLMNU0N4BRt1OBm Qew8eyo3Ax63rynRfH6RaKRS7A83NKTSnS5T3vk3oaRxso2a4Hp+xYc9Joj6SD6qYuGQ P0zfWPZeQeebvNUh0s4adDnZ+hsuSVpavxsXGTgXPIsApOWb8tu2g/av1XLeatS3WKYH k/7g==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of amikan@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=amikan@ilbers.de Received: from shymkent.ilbers.de (shymkent.ilbers.de. [85.214.156.166]) by gmr-mx.google.com with ESMTPS id 4fb4d7f45d1cf-69711e2c043si49583a12.5.2026.06.19.00.22.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 19 Jun 2026 00:22:42 -0700 (PDT) Received-SPF: pass (google.com: domain of amikan@ilbers.de designates 85.214.156.166 as permitted sender) client-ip=85.214.156.166; Received: from headcrash-nb.m.ilbers.de ([88.130.203.42]) (authenticated bits=0) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPSA id 65J7MewK032697 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 19 Jun 2026 09:22:42 +0200 From: Anton Mikanovich To: isar-users@googlegroups.com Cc: Anton Mikanovich Subject: [PATCH 2/7] pybootchartgui: Update to v5.0.3 Date: Fri, 19 Jun 2026 09:21:30 +0200 Message-ID: <20260619072238.52120-3-amikan@ilbers.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260619072238.52120-1-amikan@ilbers.de> References: <20260619072238.52120-1-amikan@ilbers.de> MIME-Version: 1.0 X-Spam-Status: No, score=-4.6 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2, RCVD_IN_RP_CERTIFIED,RCVD_IN_RP_RNBL,RCVD_IN_RP_SAFE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-Original-Sender: amikan@ilbers.de X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of amikan@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=amikan@ilbers.de Precedence: list Mailing-list: list isar-users@googlegroups.com; contact isar-users+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: isar-users@googlegroups.com X-Google-Group-Id: 914930254986 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= OE-core Revision: 236ac1b43308df722a78d3aa20aef065dfae5b2b. Signed-off-by: Anton Mikanovich --- scripts/pybootchartgui/pybootchartgui/draw.py | 156 +++++++++++++++++- .../pybootchartgui/pybootchartgui/parsing.py | 35 +++- .../pybootchartgui/pybootchartgui/samples.py | 25 +++ 3 files changed, 207 insertions(+), 9 deletions(-) diff --git a/scripts/pybootchartgui/pybootchartgui/draw.py b/scripts/pybootchartgui/pybootchartgui/draw.py index 29eb7505..c6e67833 100644 --- a/scripts/pybootchartgui/pybootchartgui/draw.py +++ b/scripts/pybootchartgui/pybootchartgui/draw.py @@ -80,6 +80,22 @@ MEM_BUFFERS_COLOR = (0.4, 0.4, 0.4, 0.3) # Swap color MEM_SWAP_COLOR = DISK_TPUT_COLOR +# avg10 CPU pressure color +CPU_PRESSURE_AVG10_COLOR = (0.0, 0.0, 0.0, 1.0) +# delta total CPU pressure color +CPU_PRESSURE_TOTAL_COLOR = CPU_COLOR +# avg10 IO pressure color +IO_PRESSURE_AVG10_COLOR = (0.0, 0.0, 0.0, 1.0) +# delta total IO pressure color +IO_PRESSURE_TOTAL_COLOR = IO_COLOR +# avg10 memory pressure color +MEM_PRESSURE_AVG10_COLOR = (0.0, 0.0, 0.0, 1.0) +# delta total memory pressure color +MEM_PRESSURE_TOTAL_COLOR = DISK_TPUT_COLOR + + + + # Process border color. PROC_BORDER_COLOR = (0.71, 0.71, 0.71, 1.0) # Waiting process color. @@ -267,7 +283,10 @@ def draw_chart(ctx, color, fill, chart_bounds, data, proc_tree, data_range): # avoid divide by zero if max_y == 0: max_y = 1.0 - xscale = float (chart_bounds[2]) / (max_x - x_shift) + if (max_x - x_shift): + xscale = float (chart_bounds[2]) / (max_x - x_shift) + else: + xscale = float (chart_bounds[2]) # If data_range is given, scale the chart so that the value range in # data_range matches the chart bounds exactly. # Otherwise, scale so that the actual data matches the chart bounds. @@ -337,6 +356,12 @@ def extents(options, xscale, trace): h += 30 + bar_h if trace.disk_stats: h += 30 + bar_h + if trace.cpu_pressure: + h += 30 + bar_h + if trace.io_pressure: + h += 30 + bar_h + if trace.mem_pressure: + h += 30 + bar_h if trace.monitor_disk: h += 30 + bar_h if trace.mem_stats: @@ -412,6 +437,108 @@ def render_charts(ctx, options, clip, trace, curr_y, w, h, sec_w): curr_y = curr_y + 30 + bar_h + # render CPU pressure chart + if trace.cpu_pressure: + max_sample_avg = max (trace.cpu_pressure, key = lambda s: s.avg10) + max_sample_total = max (trace.cpu_pressure, key = lambda s: s.deltaTotal) + draw_legend_line(ctx, "avg10 CPU Pressure (max %d%%)" % (max_sample_avg.avg10), CPU_PRESSURE_AVG10_COLOR, off_x, curr_y+20, leg_s) + draw_legend_box(ctx, "delta total CPU Pressure (max %d)" % (max_sample_total.deltaTotal), CPU_PRESSURE_TOTAL_COLOR, off_x + 240, curr_y+20, leg_s) + + # render delta total cpu + chart_rect = (off_x, curr_y+30, w, bar_h) + if clip_visible (clip, chart_rect): + draw_box_ticks (ctx, chart_rect, sec_w) + draw_annotations (ctx, proc_tree, trace.times, chart_rect) + draw_chart (ctx, CPU_PRESSURE_TOTAL_COLOR, True, chart_rect, \ + [(sample.time, sample.deltaTotal) for sample in trace.cpu_pressure], \ + proc_tree, None) + + # render avg10 cpu + if clip_visible (clip, chart_rect): + draw_chart (ctx, CPU_PRESSURE_AVG10_COLOR, False, chart_rect, \ + [(sample.time, sample.avg10) for sample in trace.cpu_pressure], \ + proc_tree, None) + + pos_x = off_x + ((max_sample_avg.time - proc_tree.start_time) * w / proc_tree.duration) + + shift_x, shift_y = -20, 20 + if (pos_x < off_x + 245): + shift_x, shift_y = 5, 40 + + + label = "%d%%" % (max_sample_avg.avg10) + draw_text (ctx, label, CPU_PRESSURE_AVG10_COLOR, pos_x + shift_x, curr_y + shift_y) + + curr_y = curr_y + 30 + bar_h + + # render I/O pressure chart + if trace.io_pressure: + max_sample_avg = max (trace.io_pressure, key = lambda s: s.avg10) + max_sample_total = max (trace.io_pressure, key = lambda s: s.deltaTotal) + draw_legend_line(ctx, "avg10 I/O Pressure (max %d%%)" % (max_sample_avg.avg10), IO_PRESSURE_AVG10_COLOR, off_x, curr_y+20, leg_s) + draw_legend_box(ctx, "delta total I/O Pressure (max %d)" % (max_sample_total.deltaTotal), IO_PRESSURE_TOTAL_COLOR, off_x + 240, curr_y+20, leg_s) + + # render delta total io + chart_rect = (off_x, curr_y+30, w, bar_h) + if clip_visible (clip, chart_rect): + draw_box_ticks (ctx, chart_rect, sec_w) + draw_annotations (ctx, proc_tree, trace.times, chart_rect) + draw_chart (ctx, IO_PRESSURE_TOTAL_COLOR, True, chart_rect, \ + [(sample.time, sample.deltaTotal) for sample in trace.io_pressure], \ + proc_tree, None) + + # render avg10 io + if clip_visible (clip, chart_rect): + draw_chart (ctx, IO_PRESSURE_AVG10_COLOR, False, chart_rect, \ + [(sample.time, sample.avg10) for sample in trace.io_pressure], \ + proc_tree, None) + + pos_x = off_x + ((max_sample_avg.time - proc_tree.start_time) * w / proc_tree.duration) + + shift_x, shift_y = -20, 20 + if (pos_x < off_x + 245): + shift_x, shift_y = 5, 40 + + + label = "%d%%" % (max_sample_avg.avg10) + draw_text (ctx, label, IO_PRESSURE_AVG10_COLOR, pos_x + shift_x, curr_y + shift_y) + + curr_y = curr_y + 30 + bar_h + + # render MEM pressure chart + if trace.mem_pressure: + max_sample_avg = max (trace.mem_pressure, key = lambda s: s.avg10) + max_sample_total = max (trace.mem_pressure, key = lambda s: s.deltaTotal) + draw_legend_line(ctx, "avg10 MEM Pressure (max %d%%)" % (max_sample_avg.avg10), MEM_PRESSURE_AVG10_COLOR, off_x, curr_y+20, leg_s) + draw_legend_box(ctx, "delta total MEM Pressure (max %d)" % (max_sample_total.deltaTotal), MEM_PRESSURE_TOTAL_COLOR, off_x + 240, curr_y+20, leg_s) + + # render delta total mem + chart_rect = (off_x, curr_y+30, w, bar_h) + if clip_visible (clip, chart_rect): + draw_box_ticks (ctx, chart_rect, sec_w) + draw_annotations (ctx, proc_tree, trace.times, chart_rect) + draw_chart (ctx, MEM_PRESSURE_TOTAL_COLOR, True, chart_rect, \ + [(sample.time, sample.deltaTotal) for sample in trace.mem_pressure], \ + proc_tree, None) + + # render avg10 mem + if clip_visible (clip, chart_rect): + draw_chart (ctx, MEM_PRESSURE_AVG10_COLOR, False, chart_rect, \ + [(sample.time, sample.avg10) for sample in trace.mem_pressure], \ + proc_tree, None) + + pos_x = off_x + ((max_sample_avg.time - proc_tree.start_time) * w / proc_tree.duration) + + shift_x, shift_y = -20, 20 + if (pos_x < off_x + 245): + shift_x, shift_y = 5, 40 + + + label = "%d%%" % (max_sample_avg.avg10) + draw_text (ctx, label, MEM_PRESSURE_AVG10_COLOR, pos_x + shift_x, curr_y + shift_y) + + curr_y = curr_y + 30 + bar_h + # render disk space usage # # Draws the amount of disk space used on each volume relative to the @@ -493,8 +620,8 @@ def render_charts(ctx, options, clip, trace, curr_y, w, h, sec_w): return curr_y -def render_processes_chart(ctx, options, trace, curr_y, w, h, sec_w): - chart_rect = [off_x, curr_y+header_h, w, h - curr_y - 1 * off_y - header_h ] +def render_processes_chart(ctx, options, trace, curr_y, width, h, sec_w): + chart_rect = [off_x, curr_y+header_h, width, h - curr_y - 1 * off_y - header_h ] draw_legend_box (ctx, "Configure", \ TASK_COLOR_CONFIGURE, off_x , curr_y + 45, leg_s) @@ -519,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] @@ -529,14 +657,23 @@ 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 + + def set_alfa(color, alfa): + clist = list(color) + clist[-1] = alfa + return tuple(clist) #print("proc at %s %s %s %s" % (x, y, w, proc_h)) col = None if task == "do_compile": col = TASK_COLOR_COMPILE + elif "do_compile" in task: + col = set_alfa(TASK_COLOR_COMPILE, 0.25) elif task == "do_configure": col = TASK_COLOR_CONFIGURE + elif "do_configure" in task: + col = set_alfa(TASK_COLOR_CONFIGURE, 0.25) elif task == "do_install": col = TASK_COLOR_INSTALL elif task == "do_populate_sysroot": @@ -554,7 +691,10 @@ def render_processes_chart(ctx, options, trace, curr_y, w, h, sec_w): draw_fill_rect(ctx, col, (x, y, w, proc_h)) 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 + process = "%ds %s" % (elapsed_time, process) + draw_label_in_box(ctx, PROC_TEXT_COLOR, process, x, y + proc_h - 4, w, width) + y = y + proc_h return curr_y @@ -695,7 +835,7 @@ def draw_processes_recursively(ctx, proc, proc_tree, y, proc_h, rect, clip) : cmdString = proc.cmd else: cmdString = '' - if (OPTIONS.show_pid or OPTIONS.show_all) and ipid is not 0: + if (OPTIONS.show_pid or OPTIONS.show_all) and ipid != 0: cmdString = cmdString + " [" + str(ipid // 1000) + "]" if OPTIONS.show_all: if proc.args: @@ -793,7 +933,7 @@ class CumlSample: if self.color is None: i = self.next() % HSV_MAX_MOD h = 0.0 - if i is not 0: + if i != 0: h = (1.0 * i) / HSV_MAX_MOD s = 0.5 v = 1.0 diff --git a/scripts/pybootchartgui/pybootchartgui/parsing.py b/scripts/pybootchartgui/pybootchartgui/parsing.py index b42dac6b..63a53b6b 100644 --- a/scripts/pybootchartgui/pybootchartgui/parsing.py +++ b/scripts/pybootchartgui/pybootchartgui/parsing.py @@ -49,6 +49,9 @@ class Trace: self.parent_map = None self.mem_stats = [] self.monitor_disk = None + self.cpu_pressure = [] + self.io_pressure = [] + self.mem_pressure = [] self.times = [] # Always empty, but expected by draw.py when drawing system charts. if len(paths): @@ -128,7 +131,7 @@ class Trace: def compile(self, writer): def find_parent_id_for(pid): - if pid is 0: + if pid == 0: return 0 ppid = self.parent_map.get(pid) if ppid: @@ -554,6 +557,29 @@ def _parse_monitor_disk_log(file): return disk_stats +def _parse_pressure_logs(file, filename): + """ + Parse file for "some" pressure with 'avg10', 'avg60' 'avg300' and delta total values + (in that order) directly stored on one line for both CPU and IO, based on filename. + """ + pressure_stats = [] + if filename == "cpu.log": + SamplingClass = CPUPressureSample + elif filename == "memory.log": + SamplingClass = MemPressureSample + else: + SamplingClass = IOPressureSample + for time, lines in _parse_timed_blocks(file): + for line in lines: + if not line: continue + tokens = line.split() + avg10 = float(tokens[0]) + avg60 = float(tokens[1]) + avg300 = float(tokens[2]) + delta = float(tokens[3]) + pressure_stats.append(SamplingClass(time, avg10, avg60, avg300, delta)) + + return pressure_stats # if we boot the kernel with: initcall_debug printk.time=1 we can # get all manner of interesting data from the dmesg output @@ -741,6 +767,13 @@ def _do_parse(writer, state, filename, file): state.cmdline = _parse_cmdline_log(writer, file) elif name == "monitor_disk.log": state.monitor_disk = _parse_monitor_disk_log(file) + #pressure logs are in a subdirectory + elif name == "cpu.log": + state.cpu_pressure = _parse_pressure_logs(file, name) + elif name == "io.log": + state.io_pressure = _parse_pressure_logs(file, name) + elif name == "memory.log": + state.mem_pressure = _parse_pressure_logs(file, name) elif not filename.endswith('.log'): _parse_bitbake_buildstats(writer, state, filename, file) t2 = time.process_time() diff --git a/scripts/pybootchartgui/pybootchartgui/samples.py b/scripts/pybootchartgui/pybootchartgui/samples.py index 9fc309b3..a70d8a5a 100644 --- a/scripts/pybootchartgui/pybootchartgui/samples.py +++ b/scripts/pybootchartgui/pybootchartgui/samples.py @@ -37,6 +37,31 @@ class CPUSample: return str(self.time) + "\t" + str(self.user) + "\t" + \ str(self.sys) + "\t" + str(self.io) + "\t" + str (self.swap) +class CPUPressureSample: + def __init__(self, time, avg10, avg60, avg300, deltaTotal): + self.time = time + self.avg10 = avg10 + self.avg60 = avg60 + self.avg300 = avg300 + self.deltaTotal = deltaTotal + +class IOPressureSample: + def __init__(self, time, avg10, avg60, avg300, deltaTotal): + self.time = time + self.avg10 = avg10 + self.avg60 = avg60 + self.avg300 = avg300 + self.deltaTotal = deltaTotal + +class MemPressureSample: + def __init__(self, time, avg10, avg60, avg300, deltaTotal): + self.time = time + self.avg10 = avg10 + self.avg60 = avg60 + self.avg300 = avg300 + self.deltaTotal = deltaTotal + + class MemSample: used_values = ('MemTotal', 'MemFree', 'Buffers', 'Cached', 'SwapTotal', 'SwapFree',)