]> git.baikalelectronics.ru Git - kernel.git/commit
perf tools: Fix maps__find_symbol_by_name()
authorAdrian Hunter <adrian.hunter@intel.com>
Fri, 7 Sep 2018 08:51:16 +0000 (11:51 +0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 11 Sep 2018 17:12:51 +0000 (14:12 -0300)
commit4a1d9af12d083589684ddb31b00f185a73232b17
treebaf3600125c5b9937d9f5903b56e7e7651a0c2ec
parent2268ae6028e0a4dfb8922d428dc3c45c9bd13f30
perf tools: Fix maps__find_symbol_by_name()

Commit f5c73be142f9 ("perf machine: Create maps for x86 PTI entry
trampolines") revealed a problem with maps__find_symbol_by_name() that
resulted in probes not being found e.g.

$ sudo perf probe xsk_mmap
xsk_mmap is out of .text, skip it.
Probe point 'xsk_mmap' not found.
   Error: Failed to add events.

maps__find_symbol_by_name() can optionally return the map of the found
symbol. It can get the map wrong because, in fact, the symbol is found
on the map's dso, not allowing for the possibility that the dso has more
than one map. Fix by always checking the map contains the symbol.

Reported-by: Björn Töpel <bjorn.topel@intel.com>
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Tested-by: Björn Töpel <bjorn.topel@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: stable@vger.kernel.org
Fixes: f5c73be142f9 ("perf machine: Create maps for x86 PTI entry trampolines")
Link: http://lkml.kernel.org/r/20180907085116.25782-1-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/map.c