diff options
| author | Namhyung Kim <namhyung@kernel.org> | 2026-10-13 10:21:53 -0700 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2026-10-15 10:07:41 -0300 |
| commit | eccce8cfafdacbcc65cf0e517c93f56b2c3fdb8f (patch) | |
| tree | b6a0db2636e9ce346dcd34c854efbee9064e15ff | |
| parent | 95f2cc56f46fd831e9e24e95e15e0388ebcfb7a6 (diff) | |
| download | linux-next-eccce8cfafdacbcc65cf0e517c93f56b2c3fdb8f.tar.gz linux-next-eccce8cfafdacbcc65cf0e517c93f56b2c3fdb8f.zip | |
perf symbol: Do not set binary type from symtab type
The DSO binary type is to access the binary (e.g. instruction) data
while symtab type is for the symbol table. They may or may not be in
the same file. We should track them separately and correctly.
As special binaries already set their type before loading symbols, leave
the binary type info and only update it when actually opening the DSO.
Reviewed-by: Ian Rogers <irogers@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
| -rw-r--r-- | tools/perf/util/dso.c | 3 | ||||
| -rw-r--r-- | tools/perf/util/symbol.c | 13 |
2 files changed, 2 insertions, 14 deletions
diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c index 8f274b8b1030..ce98613868e7 100644 --- a/tools/perf/util/dso.c +++ b/tools/perf/util/dso.c @@ -1492,9 +1492,10 @@ uint16_t dso__e_machine_endian(struct dso *dso, struct machine *machine, uint32_ bool *is_big_endian) { uint16_t e_machine = EM_NONE; + enum dso_binary_type dbt = dso__find_binary_type(dso); int fd; - switch (dso__binary_type(dso)) { + switch (dbt) { case DSO_BINARY_TYPE__KALLSYMS: case DSO_BINARY_TYPE__GUEST_KALLSYMS: case DSO_BINARY_TYPE__VMLINUX: diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index 8bd970839c6d..b61a574ce9a3 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c @@ -1944,19 +1944,6 @@ int dso__load(struct dso *dso, struct map *map) if (next_slot) { ss_pos++; - - /* - * The binary type is used to find the file containing - * the executed instructions, so prefer the types that - * refer to the actual object over debug-only files such - * as DSO_BINARY_TYPE__DEBUGLINK. - */ - if (dso__binary_type(dso) == DSO_BINARY_TYPE__NOT_FOUND || - symtab_type == DSO_BINARY_TYPE__BUILD_ID_CACHE || - (symtab_type == DSO_BINARY_TYPE__SYSTEM_PATH_DSO && - dso__binary_type(dso) != DSO_BINARY_TYPE__BUILD_ID_CACHE)) - dso__set_binary_type(dso, symtab_type); - if (syms_ss && runtime_ss) break; } else { |
