[PATCH/RFC 4/9] perf symbols: Load kernel module symbols ASAP

From: Namhyung Kim
Date: Fri Jun 23 2017 - 01:50:53 EST


When loading kernel symbols from /proc/kallsyms, it might have different
addresses for modules. We should honor the mmap event recorded in a
perf.data so load the module symbols when it sees the event so that it
cannot be overridden by symbols in /proc/kallsyms later.

Cc: Adrian Hunter <adrian.hunter@xxxxxxxxx>
Cc: Wang Nan <wangnan0@xxxxxxxxxx>
Signed-off-by: Namhyung Kim <namhyung@xxxxxxxxxx>
---
tools/perf/util/machine.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index d838f893e639..799efe920f0c 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -656,6 +656,9 @@ struct map *machine__findnew_module_map(struct machine *machine, u64 start,

map_groups__insert(&machine->kmaps, map);

+ if (dso->has_build_id)
+ map__load(map);
+
/* Put the map here because map_groups__insert alread got it */
map__put(map);
out:
--
2.13.1