From 09ed8975c4b13be4469899b210f0e0936021ee8f Mon Sep 17 00:00:00 2001 From: Naohiro Aota Date: Fri, 13 Mar 2015 14:18:40 +0900 Subject: perf probe: Find compilation directory path for lazy matching If we use lazy matching, it failed to open a souce file if perf command is invoked outside of compilation directory: $ perf probe -a '__schedule;clear_*' Failed to open kernel/sched/core.c: No such file or directory Error: Failed to add events. (-2) OTOH, other commands like "probe -L" can solve the souce directory by themselves. Let's make it possible for lazy matching too! Signed-off-by: Naohiro Aota Acked-by: Masami Hiramatsu Cc: He Kuang Cc: Jiri Olsa Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1426223923-1493-1-git-send-email-naota@elisp.net Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/probe-finder.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tools/perf/util/probe-finder.h') diff --git a/tools/perf/util/probe-finder.h b/tools/perf/util/probe-finder.h index 92590b2c7e1c..ebf8c8c81453 100644 --- a/tools/perf/util/probe-finder.h +++ b/tools/perf/util/probe-finder.h @@ -55,6 +55,10 @@ extern int debuginfo__find_available_vars_at(struct debuginfo *dbg, struct variable_list **vls, int max_points, bool externs); +/* Find a src file from a DWARF tag path */ +int get_real_path(const char *raw_path, const char *comp_dir, + char **new_path); + struct probe_finder { struct perf_probe_event *pev; /* Target probe event */ -- cgit v1.2.1