aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/perf/builtin-test.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/tools/perf/builtin-test.c b/tools/perf/builtin-test.c
index 6c991529f62b..1c984342a579 100644
--- a/tools/perf/builtin-test.c
+++ b/tools/perf/builtin-test.c
@@ -268,24 +268,26 @@ static int test__open_syscall_event(void)
268 int id = trace_event__id("sys_enter_open"); 268 int id = trace_event__id("sys_enter_open");
269 269
270 if (id < 0) { 270 if (id < 0) {
271 pr_debug("trace_event__id(\"sys_enter_open\") "); 271 pr_debug("is debugfs mounted on /sys/kernel/debug?\n");
272 return -1; 272 return -1;
273 } 273 }
274 274
275 threads = thread_map__new(-1, getpid()); 275 threads = thread_map__new(-1, getpid());
276 if (threads == NULL) { 276 if (threads == NULL) {
277 pr_debug("thread_map__new "); 277 pr_debug("thread_map__new\n");
278 return -1; 278 return -1;
279 } 279 }
280 280
281 evsel = perf_evsel__new(PERF_TYPE_TRACEPOINT, id, 0); 281 evsel = perf_evsel__new(PERF_TYPE_TRACEPOINT, id, 0);
282 if (evsel == NULL) { 282 if (evsel == NULL) {
283 pr_debug("perf_evsel__new "); 283 pr_debug("perf_evsel__new\n");
284 goto out_thread_map_delete; 284 goto out_thread_map_delete;
285 } 285 }
286 286
287 if (perf_evsel__open_per_thread(evsel, threads) < 0) { 287 if (perf_evsel__open_per_thread(evsel, threads) < 0) {
288 pr_debug("perf_evsel__open_per_thread "); 288 pr_debug("failed to open counter: %s, "
289 "tweak /proc/sys/kernel/perf_event_paranoid?\n",
290 strerror(errno));
289 goto out_evsel_delete; 291 goto out_evsel_delete;
290 } 292 }
291 293
@@ -295,13 +297,15 @@ static int test__open_syscall_event(void)
295 } 297 }
296 298
297 if (perf_evsel__read_on_cpu(evsel, 0, 0) < 0) { 299 if (perf_evsel__read_on_cpu(evsel, 0, 0) < 0) {
298 pr_debug("perf_evsel__open_read_on_cpu "); 300 pr_debug("perf_evsel__open_read_on_cpu\n");
299 goto out_close_fd; 301 goto out_close_fd;
300 } 302 }
301 303
302 if (evsel->counts->cpu[0].val != nr_open_calls) 304 if (evsel->counts->cpu[0].val != nr_open_calls) {
303 pr_debug("perf_evsel__read_on_cpu: expected to intercept %d calls, got %Ld ", 305 pr_debug("perf_evsel__read_on_cpu: expected to intercept %d calls, got %Ld\n",
304 nr_open_calls, evsel->counts->cpu[0].val); 306 nr_open_calls, evsel->counts->cpu[0].val);
307 goto out_close_fd;
308 }
305 309
306 err = 0; 310 err = 0;
307out_close_fd: 311out_close_fd: