From patchwork Thu Feb 19 19:21:26 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1902 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=1771528929; bh=Kd7gkJdmu9W41STIdxCkoZ1HJMp9ty8GHN2PZ2T53kc=; 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=Zkkoa35rkUSUs48dS/AfDNTqJESycQUIr3nM5wqkU8e8LjOj9cJLRCI0Sx1Qa3fhU AM/sR94T82zTc3/HclFBUdXMhXgZ7JsRbOMqzV+IDDozfIeOFsKShIoggmbveKZC2e bi+Z+Zt5yZTYDJVa6gUOBSkkuvRAjCGhr7mOsilszSs7COBMDVwcixvJJcSh6gUUf4 fFImlDLgAO376Akj5lQPJkHueH5EF+FINehac9cihW2qU4Osj5HqDl31BugRQILQbn vtcwSUVObUcm3jXt3/xpVXfWsR1KP541gUGSlvPaFpAuaEyG9cOTSnt769idc+R9yR Wu7ZhPrqFOKGA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A858369C7C for ; Thu, 19 Feb 2026 12:22:09 -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 WVXyjzxHlkGB for ; Thu, 19 Feb 2026 12:22:09 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1771528929; bh=Kd7gkJdmu9W41STIdxCkoZ1HJMp9ty8GHN2PZ2T53kc=; 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=Zkkoa35rkUSUs48dS/AfDNTqJESycQUIr3nM5wqkU8e8LjOj9cJLRCI0Sx1Qa3fhU AM/sR94T82zTc3/HclFBUdXMhXgZ7JsRbOMqzV+IDDozfIeOFsKShIoggmbveKZC2e bi+Z+Zt5yZTYDJVa6gUOBSkkuvRAjCGhr7mOsilszSs7COBMDVwcixvJJcSh6gUUf4 fFImlDLgAO376Akj5lQPJkHueH5EF+FINehac9cihW2qU4Osj5HqDl31BugRQILQbn vtcwSUVObUcm3jXt3/xpVXfWsR1KP541gUGSlvPaFpAuaEyG9cOTSnt769idc+R9yR Wu7ZhPrqFOKGA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9091669C77 for ; Thu, 19 Feb 2026 12:22:09 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1771528926; bh=yZ0mhnzSR33ybs0+Wa6NHc/Ntav4k8bCTgWhtXUwIsk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wL/4+lg11XaREKoPJKFHD3Qb/mUOGf81QvTIlqfMCXJZD54+QulL57wls0KNss+Ca lM1oUIf7OTuzfmR29g37gVRUe5FJL0gBERwPBI2y/AU0cLbOf0XnkWKd7uXZmEkZlE JQZdYx/9NfF5y2v1hkFUrZTcIwflbdWaYBfDLevsOX5tIF5Y4nxNPI2iuxmabssU7K 4fvNF8Q/ubj40QmE2rlEY4xz9M5DgpU0DsNifs6RmNRLpqSyJkKYVYrUJcOk8tFKDj LUktCE7mSNEHhw3kEy53nxJShaBMrNPBXtdRO24obJtYQa7fxy+6po9kemCYxX3i9t A/Dc6Ua8TUCBg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D710E69C74; Thu, 19 Feb 2026 12:22:06 -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 uvUwIDLT3xZk; Thu, 19 Feb 2026 12:22:06 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1771528926; bh=aao8u33+mt8r0n2yN57dOwPEyaRSzbD73bbnpPHiGQc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=w29OgJs75HkbQIZS2yKtQcxhANAj9zTi5fVdP83lMzXlo9QllMJPNMLjrbd10+7zt iNUUsnlpaerXfmkorjGaYUjMPcO3icQYwcnRnl8dvoFm2G8aIjEVKIjJ5dIxoeE5U9 sBqqhtNOSzFWjDAC+JTmo81InQh+c/LvZVtB75LkSd1kQbNk93KOVsSLoH1KV7z198 o2rJv8/Hi9pELsoFLP+fNvquhcPyDtma+gdjB7R21dKHJTqQ04skJ+l9SaZ8Sj3Lko MQ27Nu/qDAa2RTa135w15QQEiIYIe/Ze1lhpDqaSrlEVeHyEV/FfA9EhGLZJTI6Io0 gVAMhePB21gHA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 3BFF469C01; Thu, 19 Feb 2026 12:22:06 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 19 Feb 2026 12:21:26 -0700 Message-ID: <20260219192130.737116-6-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260219192130.737116-1-sjg@u-boot.org> References: <20260219192130.737116-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: TLBHKH3PP5FOXWSPCHLVHC3TXLQJFLZC X-Message-ID-Hash: TLBHKH3PP5FOXWSPCHLVHC3TXLQJFLZC 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 Opus 4 . 6" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 5/5] test: trace: Handle trace-cmd caller-info output format 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 Newer versions of trace-cmd append a "<-- caller" suffix to function trace lines, e.g.: u-boot-1 0..... 60.805596: function: initf_malloc <-- initcall_run_f This results in 7 fields per line instead of 5 after splitting, so the existing `len(items) == 5` filter rejects every line, leaving the vals dictionary empty and causing the test to fail. Change the filter to `len(items) >= 5` so that the function name (at index 4) and timestamp (at index 2) are extracted regardless of trailing fields. Co-developed-by: Claude Opus 4.6 Signed-off-by: Simon Glass --- test/py/tests/test_trace.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/test/py/tests/test_trace.py b/test/py/tests/test_trace.py index 498949372aa..d82bae0acc0 100644 --- a/test/py/tests/test_trace.py +++ b/test/py/tests/test_trace.py @@ -144,14 +144,13 @@ def check_function(ubman, fname, proftool, map_fname, trace_dat): cmd = f"trace-cmd report -l {trace_dat} |grep -E '(initf_|initr_)'" out = utils.run_and_log(ubman, ['sh', '-c', cmd]) - # Format: + # Format (older trace-cmd): # u-boot-1 0..... 60.805596: function: initf_malloc - # u-boot-1 0..... 60.805597: function: initf_malloc - # u-boot-1 0..... 60.805601: function: initf_bootstage - # u-boot-1 0..... 60.805607: function: initf_bootstage + # Format (newer trace-cmd, includes caller): + # u-boot-1 0..... 60.805596: function: initf_malloc <-- initcall_run_f lines = [line.replace(':', '').split() for line in out.splitlines()] - vals = {items[4]: float(items[2]) for items in lines if len(items) == 5} + vals = {items[4]: float(items[2]) for items in lines if len(items) >= 5} base = None max_delta = 0 for timestamp in vals.values():