summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-01-15 14:15:55 -0700
committerTom Rini <trini@konsulko.com>2023-02-11 12:22:35 -0500
commit88716b550365996277303fb55a06afdfee076184 (patch)
tree7380d8ef9bf3e0315521ea34fa2f11a9901973be /tools
parentb15a16adf514b47fef2a50111e9af6493bee2e6a (diff)
trace: Use text_base from the trace header
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 <sjg@chromium.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/proftool.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/proftool.c b/tools/proftool.c
index 0d74e1169a..b5b8a9f793 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");