summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/parse-events.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2014-02-22 17:20:46 +0100
committerIngo Molnar <mingo@kernel.org>2014-02-22 17:20:46 +0100
commita9d3f94ec7708427b9f05a65246d3fd6e287fa51 (patch)
treeef555c5c85e55d90c343af382b1042b2957c0584 /tools/perf/util/parse-events.c
parent337397f3afc911d94d1d71371a36a53ce218b41f (diff)
parent844ae5b46c08dbc7ba695b543c023f9cf3bbf9ff (diff)
Merge tag 'perf-urgent-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
Pull perf/urgent fixes from Arnaldo Carvalho de Melo: * Handle PERF_RECORD_HEADER_EVENT_TYPE properly. (Jiri Olsa) * Fix checking for supported events on older kernels in 'perf list' (Vince Weaver) * Do not add offset twice to uprobe address in 'perf probe' (Masami Hiramatsu) * Fix perf trace's ioctl 'request' beautifier build problems on !(i386 || x86_64) arches (Arnaldo Carvalho de Melo) * Fix 'perf trace' build by adding a fallback definition for EFD_SEMAPHORE (Ben Hutchings) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/perf/util/parse-events.c')
-rw-r--r--tools/perf/util/parse-events.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index d248fca6d7e..1e15df10a88 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -1091,12 +1091,12 @@ int is_valid_tracepoint(const char *event_string)
static bool is_event_supported(u8 type, unsigned config)
{
bool ret = true;
+ int open_return;
struct perf_evsel *evsel;
struct perf_event_attr attr = {
.type = type,
.config = config,
.disabled = 1,
- .exclude_kernel = 1,
};
struct {
struct thread_map map;
@@ -1108,7 +1108,20 @@ static bool is_event_supported(u8 type, unsigned config)
evsel = perf_evsel__new(&attr);
if (evsel) {
- ret = perf_evsel__open(evsel, NULL, &tmap.map) >= 0;
+ open_return = perf_evsel__open(evsel, NULL, &tmap.map);
+ ret = open_return >= 0;
+
+ if (open_return == -EACCES) {
+ /*
+ * This happens if the paranoid value
+ * /proc/sys/kernel/perf_event_paranoid is set to 2
+ * Re-run with exclude_kernel set; we don't do that
+ * by default as some ARM machines do not support it.
+ *
+ */
+ evsel->attr.exclude_kernel = 1;
+ ret = perf_evsel__open(evsel, NULL, &tmap.map) >= 0;
+ }
perf_evsel__delete(evsel);
}