From patchwork Fri Jan 9 18:31:09 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1395 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=1767983573; bh=OMGd1wXA6psHJ2kOEAP1OoObHsKUvooyQVpNSA4du3Q=; 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=Lc/CM2zg6D2ht/4bVMZedmYXEmtKimfHBUllf+N5s1sTBM+dWsx/O8k4FY09cFJFC ReatyWPVJNQYWQtaVTwqpM5l8plTe/byUDR+GYFa033m2OYVvoWAuBhwwkHgOjPeEi ajYRg4EmxIQNdXp5hhYCHNuwJzJuIWi/4xddpsNOgteLKp6cvb6qviMh+tReNUv+w6 y29XRCBUzrItB8SQTU2B7CXZ+ckrKWP+teq62BhZJYSnrEAucDfSIBTuCqehKL1Li+ 1D1tvb470mx1N1zxE/+buKYE4v8iqk2iaUul7lSciyOSECYn6nbJX3LG6UQqUpXf4D K+QZrrOYB91mw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C44D569218 for ; Fri, 9 Jan 2026 11:32:53 -0700 (MST) 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 o8tCfkK8ii1m for ; Fri, 9 Jan 2026 11:32:53 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767983573; bh=OMGd1wXA6psHJ2kOEAP1OoObHsKUvooyQVpNSA4du3Q=; 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=Lc/CM2zg6D2ht/4bVMZedmYXEmtKimfHBUllf+N5s1sTBM+dWsx/O8k4FY09cFJFC ReatyWPVJNQYWQtaVTwqpM5l8plTe/byUDR+GYFa033m2OYVvoWAuBhwwkHgOjPeEi ajYRg4EmxIQNdXp5hhYCHNuwJzJuIWi/4xddpsNOgteLKp6cvb6qviMh+tReNUv+w6 y29XRCBUzrItB8SQTU2B7CXZ+ckrKWP+teq62BhZJYSnrEAucDfSIBTuCqehKL1Li+ 1D1tvb470mx1N1zxE/+buKYE4v8iqk2iaUul7lSciyOSECYn6nbJX3LG6UQqUpXf4D K+QZrrOYB91mw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B2AA669224 for ; Fri, 9 Jan 2026 11:32:53 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767983572; bh=fvTfK/B4nkFUiF1cgP4x8ZccX/WlBsagAq688bxe1Yg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ehMROmC2K0ulT8y5oN1sa2J1Aylastz1ZJeMe6wKJVvOei5bvkP5EGpkd/wK743vd Ogq82A5Hg1uGeNOaT/vlQzgK1NK5TdLiQNMiHbvCV39Q0g03Cwn0T5ICYBNkgZzXXA 9JKuYgWBBrFYa9qT4Fu+/kNoAYtTvc7jBcT7umU9cm3cyJL16Y5eO89C8DYToeuLg8 sl9xbRvCtVBSmdT1NkmMi+dySvgLuSZSNYF9okK8X+LYwQapVC85BXuy4Uia4NExOf 4BTqleiTtIYATDM8B8yzR/u8yo/CXXspMSgyz0Su3sx/ruokCp7eWySvf7wC8rtmdo 90lB+fI6mDr0A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D736469211; Fri, 9 Jan 2026 11:32:52 -0700 (MST) 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 Df3zJZl0-Bl7; Fri, 9 Jan 2026 11:32:52 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767983568; bh=Btcmy8Fc8AECEsIaNSXa3rsm3OQ68nk9WIse+01alYM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lbij437qTNkQZrwrZV0egu9ZgLEn0zfPmkcbEYcmEsAeEXmUCnPXhha0uEHQAd8qT iUCbfaGErti6tbv98P3qqczSpPh7XfE9n2r1yYnSNTEupHrzWeibiAeQ5eumwxy/GJ rYLpeoLQIqVv9y2e2ifbG8g0JzrwWDLVM26M13uiJdlfK8aRH/KtPXSffc6rK9H6h0 8bpoIRy29pvYeEz/tu68lPrnspOKWyPBmPV5mRPxhJVC6zZfZcEo6QEmKm2gWKLOYm Qrib+1JWTixkPpQIVcvAmmBU2HoZvMGja8XabzFKIQyC4rbZRaC4tjiofreeS0JQKr 2+bPyK08X1Qsw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 1CA3769209; Fri, 9 Jan 2026 11:32:48 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Fri, 9 Jan 2026 11:31:09 -0700 Message-ID: <20260109183116.3262115-18-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260109183116.3262115-1-sjg@u-boot.org> References: <20260109183116.3262115-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 5VFK7AWGLSRUI2ZDNZFF5GUGPUGGSMGY X-Message-ID-Hash: 5VFK7AWGLSRUI2ZDNZFF5GUGPUGGSMGY 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 , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 17/18] buildman: Extract _print_build_summary() from build_boards() 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 Move the summary printing code from build_boards() into a separate _print_build_summary() method. This improves readability and makes the summary logic easier to test independently. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- tools/buildman/builder.py | 56 ++++++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index d24fad9a550..3c0af07d624 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -2214,29 +2214,37 @@ class Builder: # Wait until we have processed all output self.out_queue.join() if not self._ide: - tprint() - - msg = f'Completed: {self.count} total built' - if self.already_done or self.kconfig_reconfig: - parts = [] - if self.already_done: - parts.append(f'{self.already_done} previously') - if self.already_done != self.count: - parts.append(f'{self.count - self.already_done} newly') - if self.kconfig_reconfig: - parts.append(f'{self.kconfig_reconfig} reconfig') - msg += ' (' + ', '.join(parts) + ')' - duration = datetime.now() - self._start_time - if duration > timedelta(microseconds=1000000): - if duration.microseconds >= 500000: - duration = duration + timedelta(seconds=1) - duration -= timedelta(microseconds=duration.microseconds) - rate = float(self.count) / duration.total_seconds() - msg += f', duration {duration}, rate {rate:1.2f}' - tprint(msg) - if self.thread_exceptions: - tprint( - f'Failed: {len(self.thread_exceptions)} thread exceptions', - colour=self.col.RED) + self._print_build_summary() return (self.fail, self.warned, self.thread_exceptions) + + def _print_build_summary(self): + """Print a summary of the build results + + Show the number of boards built, how many were already done, duration + and build rate. Also show any thread exceptions that occurred. + """ + tprint() + + msg = f'Completed: {self.count} total built' + if self.already_done or self.kconfig_reconfig: + parts = [] + if self.already_done: + parts.append(f'{self.already_done} previously') + if self.already_done != self.count: + parts.append(f'{self.count - self.already_done} newly') + if self.kconfig_reconfig: + parts.append(f'{self.kconfig_reconfig} reconfig') + msg += ' (' + ', '.join(parts) + ')' + duration = datetime.now() - self._start_time + if duration > timedelta(microseconds=1000000): + if duration.microseconds >= 500000: + duration = duration + timedelta(seconds=1) + duration -= timedelta(microseconds=duration.microseconds) + rate = float(self.count) / duration.total_seconds() + msg += f', duration {duration}, rate {rate:1.2f}' + tprint(msg) + if self.thread_exceptions: + tprint( + f'Failed: {len(self.thread_exceptions)} thread exceptions', + colour=self.col.RED)