[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-18e6093904abfd51671ff5846c2fdaba9ebbf21b@git.kernel.org>
Date: Thu, 29 Dec 2011 12:50:01 -0800
From: tip-bot for Nelson Elhage <nelhage@...hage.com>
To: linux-tip-commits@...r.kernel.org
Cc: acme@...hat.com, linux-kernel@...r.kernel.org, paulus@...ba.org,
hpa@...or.com, mingo@...hat.com, a.p.zijlstra@...llo.nl,
nelhage@...hage.com, tglx@...utronix.de, mingo@...e.hu
Subject: [tip:perf/core] perf: builtin-record: Provide advice if mmap'
ing fails with EPERM.
Commit-ID: 18e6093904abfd51671ff5846c2fdaba9ebbf21b
Gitweb: http://git.kernel.org/tip/18e6093904abfd51671ff5846c2fdaba9ebbf21b
Author: Nelson Elhage <nelhage@...hage.com>
AuthorDate: Mon, 19 Dec 2011 08:39:31 -0500
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Fri, 23 Dec 2011 16:44:34 -0200
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@...e.hu>
Cc: Paul Mackerras <paulus@...ba.org>
Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Link: http://lkml.kernel.org/r/1324301972-22740-3-git-send-email-nelhage@nelhage.com
Signed-off-by: Nelson Elhage <nelhage@...hage.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
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 f8fd14f..56bb447 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -272,8 +272,15 @@ try_again:
exit(-1);
}
- if (perf_evlist__mmap(evlist, opts->mmap_pages, false) < 0)
+ if (perf_evlist__mmap(evlist, opts->mmap_pages, false) < 0) {
+ if (errno == EPERM)
+ die("Permission error mapping pages.\n"
+ "Consider increasing "
+ "/proc/sys/kernel/perf_event_mlock_kb,\n"
+ "or try again with a smaller value of -m/--mmap_pages.\n"
+ "(current value: %d)\n", opts->mmap_pages);
die("failed to mmap with %d (%s)\n", errno, strerror(errno));
+ }
if (rec->file_new)
session->evlist = evlist;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists