Re: [PATCH] tools/perf: doc: Add permission and sysctl notice

From: Masami Hiramatsu
Date: Wed May 26 2021 - 09:17:03 EST


On Wed, 26 May 2021 15:20:58 +0530
Ravi Bangoria <ravi.bangoria@xxxxxxxxxxxxx> wrote:

>
>
> On 5/26/21 2:31 PM, Masami Hiramatsu wrote:
> > Add a section to notify the permission and sysctl setting
> > for perf probe. And fix some indentations.
>
> Yes, it makes sense to have this detail in man page.
>
> Few minor points below ...
>
> >
> > +PERMISSIONS AND SYSCTL
> > +----------------------
> > +Since perf probe depends on ftrace (tracefs) and kallsyms (/proc/kallsyms), you have to care about the permission and some sysctl knobs.
> > +
> > + - Since tracefs and kallsyms requires root or privileged user to access it, the following perf probe commands also require it; --add, --del, --list (except for --cache option)
> > +
> > + - /proc/sys/kernel/kptr_restrict = 2 (restrict all users) also prevents perf probe to retrieve the important information from kallsyms. You also need to set to 1 (restrict non CAP_SYSLOG users) for the above commands.
> > +
> > + - Since the perf probe commands read the vmlinux and/or the debuginfo file, you need to ensure that you can read those files.
>
> 1) Last two points are applicable to kprobes only, not uprobes. Would
> it make sense to clarify that?

Ah, right. And the last one may be also related to uprobes.

> 2) For 3rd point, simple perf probe on function entry will work without
> vmlinux/debuginfo (by using kallsyms). Should we mention that?

Hmm, that depends on the options. If we use -k option, it will get the symbols from the given vmlinux.

>
> In any case,
>
> Acked-by: Ravi Bangoria <ravi.bangoria@xxxxxxxxxxxxx>

Thanks! I'll update it for uprobe.


>
> Ravi


--
Masami Hiramatsu <mhiramat@xxxxxxxxxx>