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 <[email protected]>
Cc: Wang Nan <[email protected]>
Signed-off-by: Namhyung Kim <[email protected]>
---
 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

Reply via email to