All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Steve Sakoman" <steve@sakoman.com>
To: openembedded-core@lists.openembedded.org
Subject: [OE-core][dunfell 10/25] pybootchart/draw: Avoid divide by zero error
Date: Mon, 10 May 2021 04:28:52 -1000	[thread overview]
Message-ID: <6c4355cd13ae47c327ddc5e9b66623e44ba5b118.1620656333.git.steve@sakoman.com> (raw)
In-Reply-To: <cover.1620656333.git.steve@sakoman.com>

From: Richard Purdie <richard.purdie@linuxfoundation.org>

When disk stats don't run frequenctly enough, we see divide by zero
errors. The code already has a fallback path so ensure we use it
for this case too.

[YOCTO #14360]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit b71d30aef5dc2c360432c0dd4147859dd303ea48)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
---
 scripts/pybootchartgui/pybootchartgui/draw.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/pybootchartgui/pybootchartgui/draw.py b/scripts/pybootchartgui/pybootchartgui/draw.py
index 53324b9f8b..29eb7505bc 100644
--- a/scripts/pybootchartgui/pybootchartgui/draw.py
+++ b/scripts/pybootchartgui/pybootchartgui/draw.py
@@ -271,7 +271,7 @@ def draw_chart(ctx, color, fill, chart_bounds, data, proc_tree, data_range):
     # 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.
-    if data_range:
+    if data_range and (data_range[1] - data_range[0]):
         yscale = float(chart_bounds[3]) / (data_range[1] - data_range[0])
         ybase = data_range[0]
     else:
-- 
2.25.1


  parent reply	other threads:[~2021-05-10 14:30 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-10 14:28 [OE-core][dunfell 00/25] Patch review Steve Sakoman
2021-05-10 14:28 ` [OE-core][dunfell 01/25] tar: Fix CVE-2021-20193 Steve Sakoman
2021-05-10 14:28 ` [OE-core][dunfell 02/25] binutils: fix CVE-2021-3487 Steve Sakoman
2021-05-10 14:28 ` [OE-core][dunfell 03/25] yocto-uninative: Update to 3.1 which includes a patchelf fix Steve Sakoman
2021-05-10 14:28 ` [OE-core][dunfell 04/25] wireless-regdb: upgrade 2020.11.20 -> 2021.04.21 Steve Sakoman
2021-05-10 14:28 ` [OE-core][dunfell 05/25] linux-yocto/5.4: update to v5.4.114 Steve Sakoman
2021-05-10 14:28 ` [OE-core][dunfell 06/25] linux-yocto/5.4: update to v5.4.116 Steve Sakoman
2021-05-10 14:28 ` [OE-core][dunfell 07/25] ptest-runner: libgcc must be installed for pthread_cancel to work Steve Sakoman
2021-05-10 14:28 ` [OE-core][dunfell 08/25] kernel.bbclass: Remove do_install[prefunc] no longer needed Steve Sakoman
2021-05-10 14:28 ` [OE-core][dunfell 09/25] gstreamer1.0-plugins-good: on wayland qt5 needs qtwayland Steve Sakoman
2021-05-10 14:28 ` Steve Sakoman [this message]
2021-05-10 14:28 ` [OE-core][dunfell 11/25] rootfs.py: find .ko.gz and .ko.xz kernel modules as well Steve Sakoman
2021-05-10 14:28 ` [OE-core][dunfell 12/25] cml1.bbclass: Return sorted list of cfg files Steve Sakoman
2021-05-10 14:28 ` [OE-core][dunfell 13/25] perf: fix python-audit RDEPENDS Steve Sakoman
2021-05-10 14:28 ` [OE-core][dunfell 14/25] make-mod-scripts: add HOSTCXX definitions and gmp-native dependency Steve Sakoman
2021-05-10 14:28 ` [OE-core][dunfell 15/25] diffoscope: add native libraries to LD_LIBRARY_PATH Steve Sakoman
2021-05-10 14:28 ` [OE-core][dunfell 16/25] Revert "oeqa: Set LD_LIBRARY_PATH when executing native commands" Steve Sakoman
2021-05-10 14:28 ` [OE-core][dunfell 17/25] classes/image: Use xargs to set file timestamps Steve Sakoman
2021-05-10 14:29 ` [OE-core][dunfell 18/25] sanity.bbclass: mention CONNECTIVITY_CHECK_URIS in network failure message Steve Sakoman
2021-05-10 14:29 ` [OE-core][dunfell 19/25] libevent: Increase ptest timing tolerance 50 ms -> 100 ms Steve Sakoman
2021-05-10 14:29 ` [OE-core][dunfell 20/25] oeqa/qemurunner: Improve logging thread exit handling for qemu shutdown test Steve Sakoman
2021-05-10 14:29 ` [OE-core][dunfell 21/25] lib/package_manager: Use shutil.copy instead of bb.utils.copyfile for intercepts Steve Sakoman
2021-05-10 14:29 ` [OE-core][dunfell 22/25] ovmf: update to 202002 Steve Sakoman
2021-05-10 14:29 ` [OE-core][dunfell 23/25] ovmf: update to 202005 Steve Sakoman
2021-05-10 14:29 ` [OE-core][dunfell 24/25] ovmf: update edk2-stable202005 -> edk2-stable202008 Steve Sakoman
2021-05-10 14:29 ` [OE-core][dunfell 25/25] reproducible.py: add quilt-ptest and valgrind-ptest Steve Sakoman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6c4355cd13ae47c327ddc5e9b66623e44ba5b118.1620656333.git.steve@sakoman.com \
    --to=steve@sakoman.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.