diff options
author | Masami Hiramatsu <[email protected]> | 2014-09-17 08:40:54 +0000 |
---|---|---|
committer | Arnaldo Carvalho de Melo <[email protected]> | 2014-09-17 18:01:14 -0300 |
commit | 2b394bc4468c2f5e6814a8dbb2a923c0448f8497 (patch) | |
tree | 9e118f2c74d2650eafb89b61a21ffe5bfdbb6384 /tools/perf/util/scripting-engines/trace-event-python.c | |
parent | c657f423aed0d836c807ea1d6d8d28b3914446fa (diff) |
perf probe: Do not access kallsyms when analyzing user binaries
Do not access kallsyms to show available variables and show source lines
in user binaries.
This behavior always requires the root privilege when sysctl sets
kernel.kptr_restrict=1, but we don't need it just for analyzing user
binaries.
Without this patch (by normal user, kptr_restrict=1):
----
$ perf probe -x ./perf -V add_cmdname
Failed to init vmlinux path.
Error: Failed to show vars.
$ perf probe -x ./perf -L add_cmdname
Failed to init vmlinux path.
Error: Failed to show lines.
----
With this patch:
----
$ perf probe -x ./perf -V add_cmdname
Available variables at add_cmdname
@<perf_unknown_cmd_config+144>
(No matched variables)
@<list_commands_in_dir+160>
(No matched variables)
@<add_cmdname+0>
char* name
size_t len
struct cmdnames* cmds
$ perf probe -x ./perf -L add_cmdname
<add_cmdname@/home/fedora/ksrc/linux-3/tools/perf/util/help.c:0>
0 void add_cmdname(struct cmdnames *cmds, const char *name, size_t len)
1 {
2 struct cmdname *ent = malloc(sizeof(*ent) + len + 1);
4 ent->len = len;
5 memcpy(ent->name, name, len);
6 ent->name[len] = 0;
...
----
Signed-off-by: Masami Hiramatsu <[email protected]>
Cc: david lerner <[email protected]>
Cc: [email protected]
Cc: [email protected]
Link: http://lkml.kernel.org/r/[email protected]
[ Added missing 'bool user' argument to the !DWARF show_line_range() stub ]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/perf/util/scripting-engines/trace-event-python.c')
0 files changed, 0 insertions, 0 deletions