diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-01-04 07:40:08 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-01-05 11:52:01 -0500 |
commit | 454a3bbe9b75eb8cbddffcf383fbb8e97ea78f52 (patch) | |
tree | d10cbe4a83a625908abf35581922b8ed3d6df2eb /tools | |
parent | 74d91e3c6a66359bb754fb5d8a5b54fb6ba2f9a6 (diff) |
perf test: Clarify some error reports in the open syscall test
Rebooted my devel machine, first thing I ran was perf test, that expects
debugfs to be mounted, test fails. Be more clear about it.
Also add missing newlines and add more informative message when
sys_perf_event_open fails.
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Tom Zanussi <tzanussi@gmail.com>
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/builtin-test.c | 18 |
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; |
307 | out_close_fd: | 311 | out_close_fd: |