summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChengen Du <chengen.du@canonical.com>2023-11-30 21:57:23 +0800
committerArnaldo Carvalho de Melo <acme@redhat.com>2023-12-06 09:46:15 -0300
commitd0acce68285e8645038a72c6792483160ca36e5a (patch)
tree1e6d47e7646dd0613cdeb23ccf9529ea389251ce
parent030ac3cad28992ae9099a857848861053273cc8f (diff)
downloadlinux-d0acce68285e8645038a72c6792483160ca36e5a.tar.gz
linux-d0acce68285e8645038a72c6792483160ca36e5a.tar.bz2
linux-d0acce68285e8645038a72c6792483160ca36e5a.zip
perf symbols: Parse NOTE segments until the build id is found
In the ELF file, multiple NOTE segments may exist. To locate the build id, the process shall persist in parsing NOTE segments until the build id is found. Signed-off-by: Chengen Du <chengen.du@canonical.com> Acked-by: Ian Rogers <irogers@google.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: https://lore.kernel.org/r/20231130135723.17562-1-chengen.du@canonical.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/perf/util/symbol-minimal.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/tools/perf/util/symbol-minimal.c b/tools/perf/util/symbol-minimal.c
index a81a14769bd1..1da8b713509c 100644
--- a/tools/perf/util/symbol-minimal.c
+++ b/tools/perf/util/symbol-minimal.c
@@ -159,9 +159,10 @@ int filename__read_build_id(const char *filename, struct build_id *bid)
goto out_free;
ret = read_build_id(buf, buf_size, bid, need_swap);
- if (ret == 0)
+ if (ret == 0) {
ret = bid->size;
- break;
+ break;
+ }
}
} else {
Elf64_Ehdr ehdr;
@@ -210,9 +211,10 @@ int filename__read_build_id(const char *filename, struct build_id *bid)
goto out_free;
ret = read_build_id(buf, buf_size, bid, need_swap);
- if (ret == 0)
+ if (ret == 0) {
ret = bid->size;
- break;
+ break;
+ }
}
}
out_free: