perf probe: Do not rely on map__load() filter to find symbols
authorNamhyung Kim <namhyung@kernel.org>
Wed, 14 Jan 2015 11:18:07 +0000 (20:18 +0900)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 21 Jan 2015 13:06:02 +0000 (10:06 -0300)
commit564c62a4d7f9a4b60920ee0b02cfe890471d87f4
treeb19e154acf61fcd58bf509b689db587aa09d491d
parent18bd726418f2a2e12f85104f0f4b5d5d077e1752
perf probe: Do not rely on map__load() filter to find symbols

The find_probe_trace_events_from_map() searches matching symbol from a
map (so from a backing dso).  For uprobes, it'll create a new map (and
dso) and loads it using a filter.  It's a little bit inefficient in that
it'll read out the symbol table everytime but works well anyway.

For kprobes however, it'll reuse existing kernel map which might be
loaded before.  In this case map__load() just returns with no result.
It makes kprobes always failed to find symbol even if it exists in the
map (dso).

To fix it, use map__find_symbol_by_name() instead.  It'll load a map
with full symbols and sorts them by name.  It needs to search sibing
nodes since there can be multiple (local) symbols with same name.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Link: http://lkml.kernel.org/r/1421234288-22758-3-git-send-email-namhyung@kernel.org
[ Use symbol__next_by_name ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/probe-event.c
This page took 0.045189 seconds and 5 git commands to generate.