diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-03-02 23:09:08 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-03-02 23:09:08 -0500 |
commit | 13df7977431e3b906a23bb75f29e0f40a8d73f87 (patch) | |
tree | bc2c78c3b816a65f90c31cccebdc15b38352c045 /tools/perf/util/parse-events.c | |
parent | 6d8b3e1ad3d3815d9c87b8553493301e243af76a (diff) | |
parent | 0414855fdc4a40da05221fc6062cccbc0c30f169 (diff) |
Merge 3.14-rc5 into driver-core-next
We want the fixes in here.
Diffstat (limited to 'tools/perf/util/parse-events.c')
-rw-r--r-- | tools/perf/util/parse-events.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index d248fca6d7ed..1e15df10a88c 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) | |||
1091 | static bool is_event_supported(u8 type, unsigned config) | 1091 | static bool is_event_supported(u8 type, unsigned config) |
1092 | { | 1092 | { |
1093 | bool ret = true; | 1093 | bool ret = true; |
1094 | int open_return; | ||
1094 | struct perf_evsel *evsel; | 1095 | struct perf_evsel *evsel; |
1095 | struct perf_event_attr attr = { | 1096 | struct perf_event_attr attr = { |
1096 | .type = type, | 1097 | .type = type, |
1097 | .config = config, | 1098 | .config = config, |
1098 | .disabled = 1, | 1099 | .disabled = 1, |
1099 | .exclude_kernel = 1, | ||
1100 | }; | 1100 | }; |
1101 | struct { | 1101 | struct { |
1102 | struct thread_map map; | 1102 | struct thread_map map; |
@@ -1108,7 +1108,20 @@ static bool is_event_supported(u8 type, unsigned config) | |||
1108 | 1108 | ||
1109 | evsel = perf_evsel__new(&attr); | 1109 | evsel = perf_evsel__new(&attr); |
1110 | if (evsel) { | 1110 | if (evsel) { |
1111 | ret = perf_evsel__open(evsel, NULL, &tmap.map) >= 0; | 1111 | open_return = perf_evsel__open(evsel, NULL, &tmap.map); |
1112 | ret = open_return >= 0; | ||
1113 | |||
1114 | if (open_return == -EACCES) { | ||
1115 | /* | ||
1116 | * This happens if the paranoid value | ||
1117 | * /proc/sys/kernel/perf_event_paranoid is set to 2 | ||
1118 | * Re-run with exclude_kernel set; we don't do that | ||
1119 | * by default as some ARM machines do not support it. | ||
1120 | * | ||
1121 | */ | ||
1122 | evsel->attr.exclude_kernel = 1; | ||
1123 | ret = perf_evsel__open(evsel, NULL, &tmap.map) >= 0; | ||
1124 | } | ||
1112 | perf_evsel__delete(evsel); | 1125 | perf_evsel__delete(evsel); |
1113 | } | 1126 | } |
1114 | 1127 | ||