diff options
author | Ben Hutchings <ben@decadent.org.uk> | 2016-01-19 16:35:15 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-01-26 09:52:45 -0500 |
commit | 3379e0c3effa87d7734fc06277a7023292aadb0c (patch) | |
tree | bc9e36c1019d6150f6215a7ae580eb44f61766da | |
parent | 1f7c254132f098d19ff3fd452ba9f826cd85c4c0 (diff) |
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>
-rw-r--r-- | Documentation/sysctl/kernel.txt | 13 | ||||
-rw-r--r-- | tools/perf/util/evsel.c | 15 |
2 files changed, 22 insertions, 6 deletions
diff --git a/Documentation/sysctl/kernel.txt b/Documentation/sysctl/kernel.txt index 73c6b1ef0e84..c803e7300f0b 100644 --- a/Documentation/sysctl/kernel.txt +++ b/Documentation/sysctl/kernel.txt | |||
@@ -58,6 +58,8 @@ show up in /proc/sys/kernel: | |||
58 | - panic_on_stackoverflow | 58 | - panic_on_stackoverflow |
59 | - panic_on_unrecovered_nmi | 59 | - panic_on_unrecovered_nmi |
60 | - panic_on_warn | 60 | - panic_on_warn |
61 | - perf_cpu_time_max_percent | ||
62 | - perf_event_paranoid | ||
61 | - pid_max | 63 | - pid_max |
62 | - powersave-nap [ PPC only ] | 64 | - powersave-nap [ PPC only ] |
63 | - printk | 65 | - printk |
@@ -639,6 +641,17 @@ allowed to execute. | |||
639 | 641 | ||
640 | ============================================================== | 642 | ============================================================== |
641 | 643 | ||
644 | perf_event_paranoid: | ||
645 | |||
646 | Controls use of the performance events system by unprivileged | ||
647 | users (without CAP_SYS_ADMIN). The default value is 1. | ||
648 | |||
649 | -1: Allow use of (almost) all events by all users | ||
650 | >=0: Disallow raw tracepoint access by users without CAP_IOC_LOCK | ||
651 | >=1: Disallow CPU event access by users without CAP_SYS_ADMIN | ||
652 | >=2: Disallow kernel profiling by users without CAP_SYS_ADMIN | ||
653 | |||
654 | ============================================================== | ||
642 | 655 | ||
643 | pid_max: | 656 | pid_max: |
644 | 657 | ||
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index cdbaf9b51e42..467808680ee4 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c | |||
@@ -2362,12 +2362,15 @@ int perf_evsel__open_strerror(struct perf_evsel *evsel, struct target *target, | |||
2362 | case EPERM: | 2362 | case EPERM: |
2363 | case EACCES: | 2363 | case EACCES: |
2364 | return scnprintf(msg, size, | 2364 | return scnprintf(msg, size, |
2365 | "You may not have permission to collect %sstats.\n" | 2365 | "You may not have permission to collect %sstats.\n\n" |
2366 | "Consider tweaking /proc/sys/kernel/perf_event_paranoid:\n" | 2366 | "Consider tweaking /proc/sys/kernel/perf_event_paranoid,\n" |
2367 | " -1 - Not paranoid at all\n" | 2367 | "which controls use of the performance events system by\n" |
2368 | " 0 - Disallow raw tracepoint access for unpriv\n" | 2368 | "unprivileged users (without CAP_SYS_ADMIN).\n\n" |
2369 | " 1 - Disallow cpu events for unpriv\n" | 2369 | "The default value is 1:\n\n" |
2370 | " 2 - Disallow kernel profiling for unpriv", | 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 | target->system_wide ? "system-wide " : ""); | 2374 | target->system_wide ? "system-wide " : ""); |
2372 | case ENOENT: | 2375 | case ENOENT: |
2373 | return scnprintf(msg, size, "The %s event is not supported.", | 2376 | return scnprintf(msg, size, "The %s event is not supported.", |