From patchwork Wed Aug 20 14:46:03 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 79 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755701205; bh=suyemF8hjYcGmAldocH8Fi/lCEZXYT1YYRE68o+2mzU=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Re1mjXyDC3a++tbE85fjQD2y6q12fAposvMZUGL0t0daFSWmQNMXmfpNpOMnWCkBL as6X//U4w9eFMbasnq2KhzrzdbVzSDBR4zbqEIrRGx+nC1BlxdBahbzztCCZr13VOd Y1C4mdkCPKHL/eSFxT/Vmpmntx4WVq7Xst0hePWcFObmMeaQjmF/Qg9T0ASds7KoEd V0FIhY3GpGlCmQgSCQn3wvgHYKOBMCnyKLdorn4IflmbT6HzqGHqIF5XbrtlHuzrOd 17f3rnz6sJn9RuyYnFOp+yaKECpqluVTu7J16S9Sk0YE+otvHzS5Rhp5YLHsU7TXda a4Gva/FeuCFjA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1D72267699 for ; Wed, 20 Aug 2025 08:46:45 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id l1MgQQMU9GTr for ; Wed, 20 Aug 2025 08:46:45 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755701205; bh=suyemF8hjYcGmAldocH8Fi/lCEZXYT1YYRE68o+2mzU=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Re1mjXyDC3a++tbE85fjQD2y6q12fAposvMZUGL0t0daFSWmQNMXmfpNpOMnWCkBL as6X//U4w9eFMbasnq2KhzrzdbVzSDBR4zbqEIrRGx+nC1BlxdBahbzztCCZr13VOd Y1C4mdkCPKHL/eSFxT/Vmpmntx4WVq7Xst0hePWcFObmMeaQjmF/Qg9T0ASds7KoEd V0FIhY3GpGlCmQgSCQn3wvgHYKOBMCnyKLdorn4IflmbT6HzqGHqIF5XbrtlHuzrOd 17f3rnz6sJn9RuyYnFOp+yaKECpqluVTu7J16S9Sk0YE+otvHzS5Rhp5YLHsU7TXda a4Gva/FeuCFjA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 020426768B for ; Wed, 20 Aug 2025 08:46:45 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755701204; bh=WtNjXJbvR5pW7vmlqHnRyPThB0bUwusqR4S5TXGUfpY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D1mc5rMDvDnWZRE1hl40f3ASrM8cITFaScoSGuu1/sXiMetvR9v/pD3RL8BtAI28d gOECyMtspItTPJSkC5GNQoXad9b/3Qa7YgQxV5/wqDsH3WAy5WfIHN+JKWcgx7NHXv nD5asyXeNsL/9AMsOKjOhTIKajZrf0nN0qpUHRssnuVDLCBkDUPtlnJokhdZIbYvf/ byH1HQn9lS+2uBliGysUuyJqylQGIMvkZBox9SfECQtDt7wI8Ozv5g8NWzdVlw+cgW KgEAk3FlbdsqHk+xKgsrI9MPQTK90LCzJhIM0OOwTappA+QvJLQ5Huyy9rvqjsXbP9 0rVhHi36Vrkzg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0857667694; Wed, 20 Aug 2025 08:46:44 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id TXvoJUMBwnbF; Wed, 20 Aug 2025 08:46:43 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755701203; bh=uH6zz9Au5TgsIa4bzXKsSpXGcPMcZwoI3MHek2nb3XM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PWTz4dSTIGDeMVAUKvohlGJFCaT34VgNOVByOoEb1FHSaLFYAjdfC8wlpHyl6iIzE lt1Bssd1+D8dbl31GN609uaRqiwmiru5G5dq/c973nRc6yYfkvTQYxfpGOkcWdNxnN 0ozsndRrcdyUSkRs4t+C23nGI4TR4vZ+oLIDvSeXI5rZP1nI1jyxvoJ4wzK+jIDZgD 0gs0C8e1ZFvl3N7veeByhsufCRKcjC+bixb2QoB4JV00Gc3keEZ2aucNxCczPMpUCi B4aTeGVDh+Up56+6/xXZq8wTTO69ltup+JtXjvZGLajnmHhKhtKPM5Zu8C5yNVbPRC LMvTQO5JjFY1g== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 6A4A5674F4; Wed, 20 Aug 2025 08:46:43 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Wed, 20 Aug 2025 08:46:03 -0600 Message-ID: <20250820144621.1073679-2-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250820144621.1073679-1-sjg@u-boot.org> References: <20250820144621.1073679-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: KB6C67ILG26FJO6LXHDTAPC74PWCFLIU X-Message-ID-Hash: KB6C67ILG26FJO6LXHDTAPC74PWCFLIU X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 01/14] test/py: Support a timing report when max_count is 0 List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass If only a single test runs, it does not set the max_count variable, so it remains as zero. Handle this situation as a special case. Signed-off-by: Simon Glass --- test/py/conftest.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/py/conftest.py b/test/py/conftest.py index f0101ed6b3d..2baceda51b2 100644 --- a/test/py/conftest.py +++ b/test/py/conftest.py @@ -579,7 +579,10 @@ def show_timings(): value (int): Value to display, i.e. the relative length of the bar """ if value: - bar_length = int((value / max_count) * max_bar_length) + if max_count: + bar_length = int((value / max_count) * max_bar_length) + else: + bar_length = 1 print(f"{key:>8} : {get_time_delta(msecs):>7} |{'#' * bar_length} {value}", file=buf) # Create the buckets we will use, each has a count and a total time