diff options
author | Masami Hiramatsu <mhiramat@kernel.org> | 2016-07-12 06:04:34 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-07-13 22:09:04 -0400 |
commit | f6eb0518f325ef0d6557fbef5c7ebe48a81e74db (patch) | |
tree | af7a0881cb30ba72babb657a0ae489c442f0511c /tools | |
parent | b4ee6d415e731b9d8a51451da0ebe33450c355d2 (diff) |
perf probe: Fix to show correct error message for $vars and $params
Fix to show correct error messages for $vars and $params because
those special variables requires debug information to find the
real variables or function parameters.
E.g. without this fix;
----
# perf probe -x /lib64/libc-2.23.so getaddrinfo \$params
Failed to write event: Invalid argument
Please upgrade your kernel to at least 3.14 to have access to feature $params
Error: Failed to add events.
----
Perf ends up with an error, but the message is not correct. With this
fix, perf shows correct error message as below.
----
# perf probe -x /lib64/libc-2.23.so getaddrinfo \$params
The /usr/lib64/libc-2.23.so file has no debug information.
Rebuild with -g, or install an appropriate debuginfo package.
Error: Failed to add events.
----
Reported-and-Tested-by: Arnaldo Carvalho de Melo <acme@kernel.org>
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
Cc: Hemant Kumar <hemant@linux.vnet.ibm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/146831787438.17065.6152436996780110699.stgit@devbox
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/util/probe-event.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c index 2b222a7955c9..fef9768df429 100644 --- a/tools/perf/util/probe-event.c +++ b/tools/perf/util/probe-event.c | |||
@@ -1547,7 +1547,9 @@ bool perf_probe_event_need_dwarf(struct perf_probe_event *pev) | |||
1547 | return true; | 1547 | return true; |
1548 | 1548 | ||
1549 | for (i = 0; i < pev->nargs; i++) | 1549 | for (i = 0; i < pev->nargs; i++) |
1550 | if (is_c_varname(pev->args[i].var)) | 1550 | if (is_c_varname(pev->args[i].var) || |
1551 | !strcmp(pev->args[i].var, "$params") || | ||
1552 | !strcmp(pev->args[i].var, "$vars")) | ||
1551 | return true; | 1553 | return true; |
1552 | 1554 | ||
1553 | return false; | 1555 | return false; |