Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C6838C3DA78 for ; Sun, 15 Jan 2023 21:18:41 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4C1A3855E9; Sun, 15 Jan 2023 22:16:58 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="Ij42Yk0w"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C9E30855CB; Sun, 15 Jan 2023 22:16:37 +0100 (CET) Received: from mail-io1-xd34.google.com (mail-io1-xd34.google.com [IPv6:2607:f8b0:4864:20::d34]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 838A385531 for ; Sun, 15 Jan 2023 22:16:33 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd34.google.com with SMTP id s26so5027855ioa.11 for ; Sun, 15 Jan 2023 13:16:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=uSIlXanAxod6NRpd2FFLZtIihRyIMFERb8w3g+Cvpi4=; b=Ij42Yk0wGdYPAYZP0V9bqknrHU4Mx55Z+q6wUUEdG1Q5lF6UJxqf9Fb3Se6K/KAY7h S1ruP7YRDJvkX5FIUj0Wt2ubS3o3GHjeiTvEbUqZohoksOimzyT/zCWk0ij38M6y351+ BNJ2iAeCL7KxbFNJMu+zDjlphB9H5iOi2BIi0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uSIlXanAxod6NRpd2FFLZtIihRyIMFERb8w3g+Cvpi4=; b=6gGnOnWiEXSYpyksHjsGzoYigOAz1Rkhye9vBGz1SDjp3G7Dn0yxkHe/yFSrK4u6yD bwTbY6qfvgsJ5hOTFni/b0U861CXtYsDsJZC+Vmnka46DEEz77iXX+xQpoiRsijlB+rM oNPVqe1SxFjUjFBNW6lYyRQ3mHCtFYO5V/Fxvse8XzaOfEzuoNuq9Dk9yVDZbEwFfjLs BJyaPW/bVVvhut6pdPLSw04JYJHRwJPWPJWk64M+oU6eiYHlP3CPi0DexAWrsiA0/ILj mmlltfodRloaJ4c4deWAFXuvqNgGLrItn5dol3YGJDvILOa2fJTdlyTOPefX2uf3RD/4 Hvmg== X-Gm-Message-State: AFqh2kq8onyco4t06GAdiqzlDr7NI+hjYS0xOcxW4hLGGEZhyD7xI+cW LaL0ssMZ6gKB1SIqxEBI//v0Ezhys/nvAJD8U4w= X-Google-Smtp-Source: AMrXdXuCW1Sa7vA2y9eXhDHE6LJ2V8mpIrEkR2V2/ksvhfm4v8YZTnH3tsi+GTgwhLKEw+L04RTXmw== X-Received: by 2002:a6b:d910:0:b0:6df:427:1ecd with SMTP id r16-20020a6bd910000000b006df04271ecdmr12372382ioc.8.1673817392083; Sun, 15 Jan 2023 13:16:32 -0800 (PST) Received: from sjg1.roam.corp.google.com (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id j6-20020a6bf906000000b007046e9e138esm4329107iog.22.2023.01.15.13.16.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Jan 2023 13:16:31 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Heinrich Schuchardt , Simon Glass Subject: [PATCH 12/24] trace: Show a few more stats about tracing Date: Sun, 15 Jan 2023 14:15:49 -0700 Message-Id: <20230115211602.1127661-13-sjg@chromium.org> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog In-Reply-To: <20230115211602.1127661-1-sjg@chromium.org> References: <20230115211602.1127661-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Add a few more useful items into the output. Update the buffers to use hex consistently. Signed-off-by: Simon Glass --- lib/trace.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/trace.c b/lib/trace.c index 3551ef3a23c..c3354a256fb 100644 --- a/lib/trace.c +++ b/lib/trace.c @@ -319,6 +319,10 @@ void trace_print_stats(void) printf("%15d call depth limit\n", hdr->depth_limit); print_grouped_ull(hdr->ftrace_too_deep_count, 10); puts(" calls not traced due to depth\n"); + print_grouped_ull(hdr->ftrace_size, 10); + puts(" max function calls\n"); + printf("\ntrace buffer %lx call records %lx\n", + (ulong)map_to_sysmem(hdr), (ulong)map_to_sysmem(hdr->ftrace)); } void notrace trace_set_enabled(int enabled) @@ -381,7 +385,7 @@ int notrace trace_init(void *buff, size_t buff_size) hdr = (struct trace_hdr *)buff; needed = sizeof(*hdr) + func_count * sizeof(uintptr_t); if (needed > buff_size) { - printf("trace: buffer size %zd bytes: at least %zd needed\n", + printf("trace: buffer size %zx bytes: at least %zx needed\n", buff_size, needed); return -ENOSPC; } @@ -426,7 +430,7 @@ int notrace trace_early_init(void) hdr = map_sysmem(CONFIG_TRACE_EARLY_ADDR, CONFIG_TRACE_EARLY_SIZE); needed = sizeof(*hdr) + func_count * sizeof(uintptr_t); if (needed > buff_size) { - printf("trace: buffer size is %zd bytes, at least %zd needed\n", + printf("trace: buffer size is %zx bytes, at least %zx needed\n", buff_size, needed); return -ENOSPC; } -- 2.39.0.314.g84b9a713c41-goog