• Namhyung Kim's avatar
    perf probe: Do not rely on map__load() filter to find symbols · 564c62a4
    Namhyung Kim authored
    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: default avatarNamhyung 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: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    564c62a4
probe-event.c 57.8 KB