Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf tools: Document the perf sysctls

perf_event_paranoid was only documented in source code and a perf error
message. Copy the documentation from the error message to
Documentation/sysctl/kernel.txt.

perf_cpu_time_max_percent was already documented but missing from the
list at the top, so add it there.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: linux-doc@vger.kernel.org
Link: http://lkml.kernel.org/r/20160119213515.GG2637@decadent.org.uk
[ Remove reference to external Documentation file, provide info inline, as before ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Ben Hutchings and committed by
Arnaldo Carvalho de Melo
3379e0c3 1f7c2541

+22 -6
+13
Documentation/sysctl/kernel.txt
··· 58 58 - panic_on_stackoverflow 59 59 - panic_on_unrecovered_nmi 60 60 - panic_on_warn 61 + - perf_cpu_time_max_percent 62 + - perf_event_paranoid 61 63 - pid_max 62 64 - powersave-nap [ PPC only ] 63 65 - printk ··· 641 639 642 640 ============================================================== 643 641 642 + perf_event_paranoid: 643 + 644 + Controls use of the performance events system by unprivileged 645 + users (without CAP_SYS_ADMIN). The default value is 1. 646 + 647 + -1: Allow use of (almost) all events by all users 648 + >=0: Disallow raw tracepoint access by users without CAP_IOC_LOCK 649 + >=1: Disallow CPU event access by users without CAP_SYS_ADMIN 650 + >=2: Disallow kernel profiling by users without CAP_SYS_ADMIN 651 + 652 + ============================================================== 644 653 645 654 pid_max: 646 655
+9 -6
tools/perf/util/evsel.c
··· 2362 2362 case EPERM: 2363 2363 case EACCES: 2364 2364 return scnprintf(msg, size, 2365 - "You may not have permission to collect %sstats.\n" 2366 - "Consider tweaking /proc/sys/kernel/perf_event_paranoid:\n" 2367 - " -1 - Not paranoid at all\n" 2368 - " 0 - Disallow raw tracepoint access for unpriv\n" 2369 - " 1 - Disallow cpu events for unpriv\n" 2370 - " 2 - Disallow kernel profiling for unpriv", 2365 + "You may not have permission to collect %sstats.\n\n" 2366 + "Consider tweaking /proc/sys/kernel/perf_event_paranoid,\n" 2367 + "which controls use of the performance events system by\n" 2368 + "unprivileged users (without CAP_SYS_ADMIN).\n\n" 2369 + "The default value is 1:\n\n" 2370 + " -1: Allow use of (almost) all events by all users\n" 2371 + ">= 0: Disallow raw tracepoint access by users without CAP_IOC_LOCK\n" 2372 + ">= 1: Disallow CPU event access by users without CAP_SYS_ADMIN\n" 2373 + ">= 2: Disallow kernel profiling by users without CAP_SYS_ADMIN", 2371 2374 target->system_wide ? "system-wide " : ""); 2372 2375 case ENOENT: 2373 2376 return scnprintf(msg, size, "The %s event is not supported.",