diff options
| author | Nelson Elhage <nelhage@nelhage.com> | 2011-12-19 08:39:31 -0500 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-12-23 13:44:34 -0500 |
| commit | 18e6093904abfd51671ff5846c2fdaba9ebbf21b (patch) | |
| tree | 5ff067b1fefef24fb8ba91496d7dcbf2a9f06f7d /tools | |
| parent | f41612f43be9575e1160460b08c3a760e6e27e1b (diff) | |
perf: builtin-record: Provide advice if mmap'ing fails with EPERM.
This failure is most likely due to running up against the
kernel.perf_event_mlock_kb sysctl, so we can tell the user what to do to
fix the issue.
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1324301972-22740-3-git-send-email-nelhage@nelhage.com
Signed-off-by: Nelson Elhage <nelhage@nelhage.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/perf/builtin-record.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index f8fd14fb62ec..56bb4476e3ba 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c | |||
| @@ -272,8 +272,15 @@ try_again: | |||
| 272 | exit(-1); | 272 | exit(-1); |
| 273 | } | 273 | } |
| 274 | 274 | ||
| 275 | if (perf_evlist__mmap(evlist, opts->mmap_pages, false) < 0) | 275 | if (perf_evlist__mmap(evlist, opts->mmap_pages, false) < 0) { |
| 276 | if (errno == EPERM) | ||
| 277 | die("Permission error mapping pages.\n" | ||
| 278 | "Consider increasing " | ||
| 279 | "/proc/sys/kernel/perf_event_mlock_kb,\n" | ||
| 280 | "or try again with a smaller value of -m/--mmap_pages.\n" | ||
| 281 | "(current value: %d)\n", opts->mmap_pages); | ||
| 276 | die("failed to mmap with %d (%s)\n", errno, strerror(errno)); | 282 | die("failed to mmap with %d (%s)\n", errno, strerror(errno)); |
| 283 | } | ||
| 277 | 284 | ||
| 278 | if (rec->file_new) | 285 | if (rec->file_new) |
| 279 | session->evlist = evlist; | 286 | session->evlist = evlist; |
