diff options
author | Jiri Olsa <[email protected]> | 2015-02-17 17:31:18 +0100 |
---|---|---|
committer | Arnaldo Carvalho de Melo <[email protected]> | 2015-03-23 12:46:51 -0300 |
commit | bc84f464862489e687c98dea1a8ff20dc4413f93 (patch) | |
tree | 4b9b11a9c897750695ceda0fc91c25a6c552098d | |
parent | 907fb509f0f1e35848d9e20b00176319af79101c (diff) |
perf tools: Try to lookup kernel module map before creating one
Currently we assume machine__new_module is called only once for each
module so we create its map&dso unconditionally.
However it's possible that it's called multiple times for same module.
Like for perf record:
1) via machine__create_module during machine init
2) via kernel MMAP event processing
Trying to lookup kernel module map before creating one.
Signed-off-by: Jiri Olsa <[email protected]>
Acked-by: Namhyung Kim <[email protected]>
Cc: Adrian Hunter <[email protected]>
Cc: Corey Ashford <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Link: http://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
-rw-r--r-- | tools/perf/util/machine.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index 1de5438ad070..e3353307330c 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c @@ -498,6 +498,11 @@ struct map *machine__new_module(struct machine *machine, u64 start, if (kmod_path__parse_name(&m, filename)) return NULL; + map = map_groups__find_by_name(&machine->kmaps, MAP__FUNCTION, + m.name); + if (map) + goto out; + dso = machine__module_dso(machine, &m, filename); if (dso == NULL) goto out; |