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

From: Ravi Bangoria
Date: Wed May 26 2021 - 05:51:11 EST




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

In any case,

Acked-by: Ravi Bangoria <ravi.bangoria@xxxxxxxxxxxxx>

Ravi