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 3AD86C46467 for ; Sun, 15 Jan 2023 21:19:50 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 04AA085601; Sun, 15 Jan 2023 22:17:15 +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="X0+0sCqH"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C48E5855D3; Sun, 15 Jan 2023 22:16:47 +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 491A8855BA for ; Sun, 15 Jan 2023 22:16:37 +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 d22so4046007iof.5 for ; Sun, 15 Jan 2023 13:16:37 -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=c6WJNL3E4etRH69sbYHhnnsdO6Sgk474f6IwhI2ZthY=; b=X0+0sCqHNBt9/rHi9h7v8ZtC+QtKXoKT1rCdDUe+kyTE+r8l1KieSVvo/00BOf2mrw Q0wlsDyzYyeQVz0mpdLmZAz+DnGDP94sCnfu4o0UroKfmNGvZwlCvj4y12yR9aukD4Do ImI70U34CBDGejMVx8yRd7pV3fm/nW2n3p53Y= 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=c6WJNL3E4etRH69sbYHhnnsdO6Sgk474f6IwhI2ZthY=; b=A83B8fCUYbrPWJuWn3XAwl+2W3KspJy/dz5BuZPZZp8MS69FaYWZwCtHiK3MrmqINQ Huv5D1Ln9IQ7Fp1gy5EDcaTa4NSddfwfddLt55CWeJgTWVYXA8XbN7gahah1LWnJIIwz 4lXaXqWAKMParbWoLUsCQK9MJlxXFRlSFOrVBWDuehEFXyCA651rRwqBd+2RazX1Aqjm f9ZXUuSvDlcd7YkxeDAlsclAopLGTuY+gg6MNl/LgqwY71CkyfFcWes85EeOGka7JR7B wVG2cTtOnLvpxU9FWayKwVfrAPNzNOVy9xFyrfOqLZo00HWYjKRF0No8dam9w2GCIIup QtFQ== X-Gm-Message-State: AFqh2kpGjwhbXENBCQ68AZHswhvoSv80nW8eoKXHi6BSWxAw4wbCc2Lj N/eHW2Np6jmx33/Bc8Z+LvxQQbVnKBG50z5A2oM= X-Google-Smtp-Source: AMrXdXvcJILgAabXZ5MvCtgdvIEelGBGvEzuNpwCDWuG4BzuiBQB8N4C3xsR2zlU9J+Hak2bkZO28g== X-Received: by 2002:a05:6602:18a:b0:6e1:58c5:9dc with SMTP id m10-20020a056602018a00b006e158c509dcmr57715317ioo.6.1673817396791; Sun, 15 Jan 2023 13:16:36 -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.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Jan 2023 13:16:36 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Heinrich Schuchardt , Simon Glass Subject: [PATCH 18/24] trace: Use text_base from the trace header Date: Sun, 15 Jan 2023 14:15:55 -0700 Message-Id: <20230115211602.1127661-19-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 Use the information in the trace header instead of reading it from the trace records. Add debugging to check that System.map and the trace header agree on this value. Signed-off-by: Simon Glass --- tools/proftool.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/proftool.c b/tools/proftool.c index 0d74e1169a9..b5b8a9f7938 100644 --- a/tools/proftool.c +++ b/tools/proftool.c @@ -179,6 +179,7 @@ struct trace_call *call_list; /* list of all calls in the input trace file */ int call_count; /* number of calls */ int verbose; /* Verbosity level 0=none, 1=warn, 2=notice, 3=info, 4=debug */ ulong text_offset; /* text address of first function */ +ulong text_base; /* CONFIG_TEXT_BASE from trace file */ /* debugging helpers */ static void outf(int level, const char *fmt, ...) @@ -289,7 +290,8 @@ static int read_system_map(FILE *fin) if (func_count > 1) func[-1].code_size = func->offset - func[-1].offset; } - notice("%d functions found in map file\n", func_count); + notice("%d functions found in map file, start addr %lx\n", func_count, + start); text_offset = start; return 0; @@ -415,6 +417,7 @@ static int read_trace(FILE *fin) break; /* EOF */ else if (err) return 1; + text_base = hdr.text_base; switch (hdr.type) { case TRACE_CHUNK_FUNCS: @@ -1342,6 +1345,8 @@ static int write_flyrecord(struct twriter *tw, int *missing_countp, tw->ptr += tputq(fout, len); tw->ptr += tputs(fout, str); + debug("trace text base %lx, map file %lx\n", text_base, text_offset); + ret = write_pages(tw, missing_countp, skip_countp); if (ret < 0) { fprintf(stderr, "Cannot output pages\n"); -- 2.39.0.314.g84b9a713c41-goog