From patchwork Tue Jan 6 22:03:36 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1321 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=1767737145; bh=8gH13Ut7jKqzKyBdm9mlJfw8Lgs6gSTZpnvusYkjeBk=; 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=s72OJrvefCuxb2XYO4JS20LQnmsgy4LT9nR/uD5cAHAU9NwR5CnNxUPu6dUaP/74q z5mohGGjkEskefcb9tyPhFC4ijzANz4yZEpZxKKR+8kpNKSaZmA7lA4vRNwi0lr8Kq 0jmZlIGNGdeWv5W0BgETPHDbfRxTJ009Ogi+5rCKSkrorgkWSYTEnGcUiZKzW4v9k0 4S+cdiBPQzoujhO82aH8oqhIvAlCnOgetIRDfsgEdQnjOK2lnOfBnRFHZ2l10o2m+m 4htyq7YRuPqmKfZTXepxGXnjxD6lkFGjCReRAGlnOKDSQmtFBQEY+WqQ4ogwiYcC1g cBBJKEs0vWwzQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 03EE95FF82 for ; Tue, 6 Jan 2026 15:05:45 -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 Rm3bQWPjz1kt for ; Tue, 6 Jan 2026 15:05:44 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737144; bh=8gH13Ut7jKqzKyBdm9mlJfw8Lgs6gSTZpnvusYkjeBk=; 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=prn+AQJRbl06vbCor9cib2G2pKp0cvS0uy18dtr5L9HFBCk7ilxFSLgXsHyqg3sfI L4f+8eQV4Zu+m5889n0AacIp20UmlBunLz8No6SiN3oA8X1BbmDZixSE0HZYd20w0q 37egGEETrfTjPRz+J/v/Ih2OnqH4sSl50Pwc4mYu/mQeMTIA8wCO99Mgnz2NqVcar/ TRZ2xnScXBeoJFrCJKwjF+FRfZgvJaxJ3W4tBbEI6ZLEjkxeLOi85DYDLXXHxC/A9X ji4dKn9F/XXjwIzOVttNPIc8T7CxI+7OoJlSlON/8JeXLfhnwF1/Pqpmkn9EYN2hp1 ZQcRIWktRH5RQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E73C069146 for ; Tue, 6 Jan 2026 15:05:44 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737142; bh=npBjD7EYuZq7bwovZwg7jXoXnEzYuyeluTBQLAHd93U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mRDswH7Ow8urjPhhlJGe3xP5UAk01zoiZG5H7HuK+BsfPQLCGI8ck57X3q0RYJ3da pktfb8eJ8UxR/rSbt/1Q/FeWiB7TnVWLFmtQ2zirpgPRGJN4s93s5hiTjw8plpXelJ geBVK624LOO4J9mqUi8KznWAgJk6WboP60JhqUd7w8SIocr98d2+SGj0nyaHyIDhMm MA/+xWRsjCs84OdlsmgrroNNWmpbMikt2E9v1rEowC83fIkx1Ph3j5PHNC1T2xV9v7 4Ly/9oscxkV+Ix1Ao5dn3UP5tpxqkmMLgmBw62Th4St48oHls805Tl7gorrtJVCr9n DwZi0Kc/RvBAA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E70365FF82; Tue, 6 Jan 2026 15:05:42 -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 7Cqciqz9_KUA; Tue, 6 Jan 2026 15:05:42 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737138; bh=vuyLCq6uYwxH+UNj8uKjRlRBHW3FwfqqVGwJDQ3Zg7Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SgAap7CvYl6+WT1EQyjPjVjPSP7Q54bbtGI4g3E54vB7XJnDU2NU8Xsq/9tAbp7un 0ssxNK4C0EgAzl5hSccnRlKi8zghsAZMNZee+eN8g+E44A13xx88ACY14fNkQDkRaC aL+pK4CfMR0oXEzlDfP3pCG4jUlKxDKIkbOSpSGEyL8zR+D48Dem+LK6dsz+6Iho9B gbkognDy2d4Dq5MehOttstP6xMeaWmrg7DCDO6drkHSLD0sX2kUcNPEwGdWz6GeLm0 N9oSq1TP0XNWiHjJCMRb1cIcPzvZx2eXkk1Kwe+WlDXbSFeypBTUS5K5eNvaGpouj4 8/beofMWIR0eg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 80F1C690CB; Tue, 6 Jan 2026 15:05:38 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Tue, 6 Jan 2026 15:03:36 -0700 Message-ID: <20260106220403.2915630-19-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260106220403.2915630-1-sjg@u-boot.org> References: <20260106220403.2915630-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: SZ3AV5E7N5TRR7BTBJC67JBVU7FLALH7 X-Message-ID-Hash: SZ3AV5E7N5TRR7BTBJC67JBVU7FLALH7 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: Simon Glass , Claude X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 18/29] buildman: Refactor print_size_summary() more in builder.py 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 Extract the architecture size-printing code into _print_arch_size_summary() to improve readability and reduce complexity in print_size_summary() Co-developed-by: Claude Signed-off-by: Simon Glass --- tools/buildman/builder.py | 55 +++++++++++++++++++++++++-------------- 1 file changed, 35 insertions(+), 20 deletions(-) diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index 5c33b737740..9d7357b5e06 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -1353,26 +1353,41 @@ class Builder: result['_total_diff'] = total result['_outcome'] = board_dict[result['_target']] - count = len(target_list) - printed_arch = False - for name in sorted(totals): - diff = totals[name] - if diff: - # Display the average difference in this name for this - # architecture - avg_diff = float(diff) / count - color = self.col.RED if avg_diff > 0 else self.col.GREEN - msg = f' {name} {avg_diff:+1.1f}' - if not printed_arch: - tprint(f'{arch:>10s}: (for {count}/{arch_count[arch]} ' - 'boards)', newline=False) - printed_arch = True - tprint(msg, colour=color, newline=False) - - if printed_arch: - tprint() - if show_detail: - self.print_size_detail(target_list, show_bloat) + self._print_arch_size_summary(arch, target_list, arch_count, + totals, show_detail, show_bloat) + + def _print_arch_size_summary(self, arch, target_list, arch_count, totals, + show_detail, show_bloat): + """Print size summary for a single architecture + + Args: + arch (str): Architecture name + target_list (list): List of size-change dicts for this arch + arch_count (dict): Dict of arch name to board count + totals (dict): Dict of name to total size diff + show_detail (bool): Show size delta detail for each board + show_bloat (bool): Show detail for each function + """ + count = len(target_list) + printed_arch = False + for name in sorted(totals): + diff = totals[name] + if diff: + # Display the average difference in this name for this + # architecture + avg_diff = float(diff) / count + color = self.col.RED if avg_diff > 0 else self.col.GREEN + msg = f' {name} {avg_diff:+1.1f}' + if not printed_arch: + tprint(f'{arch:>10s}: (for {count}/{arch_count[arch]} ' + 'boards)', newline=False) + printed_arch = True + tprint(msg, colour=color, newline=False) + + if printed_arch: + tprint() + if show_detail: + self.print_size_detail(target_list, show_bloat) def print_result_summary(self, board_selected, board_dict, err_lines,