diff options
author | Jiri Olsa <jolsa@kernel.org> | 2020-08-08 14:26:56 +0200 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2020-08-13 09:57:40 -0300 |
commit | b2fe96a350deb93d080ee7136b1e9fcf6cda83e2 (patch) | |
tree | 08113632495aea7e19a6e99b4793e71f261c8ff7 /tools/perf/util/header.c | |
parent | 1c695c88a1092b4013e3fffbe0ca685149165403 (diff) | |
download | lwn-b2fe96a350deb93d080ee7136b1e9fcf6cda83e2.tar.gz lwn-b2fe96a350deb93d080ee7136b1e9fcf6cda83e2.zip |
perf tools: Fix module symbol processing
The 'dso->kernel' condition is true also for kernel modules now,
and there are several places that were omited by the initial change:
- we need to identify modules separately in dso__process_kernel_symbol
- we need to set 'dso->kernel' for module from buildid table
- there's no need to use 'dso->kernel || kmodule' in one condition
Committer testing:
Before:
# perf test -v object
<SNIP>
Objdump command is: objdump -z -d --start-address=0xffffffff813e682f --stop-address=0xffffffff813e68af /usr/lib/debug/lib/modules/5.7.14-200.fc32.x86_64/vmlinux
Bytes read match those read by objdump
Reading object code for memory address: 0xffffffffc02dc257
File is: /lib/modules/5.7.14-200.fc32.x86_64/kernel/arch/x86/crypto/crc32c-intel.ko.xz
On file address is: 0xffffffffc02dc2e7
dso__data_read_offset failed
test child finished with -1
---- end ----
Object code reading: FAILED!
#
After:
# perf test object
26: Object code reading : Ok
# perf test object
26: Object code reading : Ok
# perf test object
26: Object code reading : Ok
# perf test object
26: Object code reading : Ok
# perf test object
26: Object code reading : Ok
#
Fixes: 02213cec64bb ("perf maps: Mark module DSOs with kernel type")
Reported-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Diffstat (limited to 'tools/perf/util/header.c')
-rw-r--r-- | tools/perf/util/header.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index e1db72c73e89..9cf4efdcbbbd 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c @@ -2090,9 +2090,8 @@ static int __event_process_build_id(struct perf_record_header_build_id *bev, if (!kmod_path__parse_name(&m, filename) && m.kmod) dso__set_module_info(dso, &m, machine); - else - dso->kernel = dso_space; + dso->kernel = dso_space; free(m.name); } |