diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-01-14 13:24:49 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-01-22 16:56:30 -0500 |
commit | d2af9687c96f3864178de1860e6d83873aeef224 (patch) | |
tree | 0185f96dc6c6b71b6bc6d649913ca468a650b8d5 /tools/perf/builtin-test.c | |
parent | 915fce20ecf8f7ff4189d0fff42b62aebf6a57cc (diff) |
perf test: Check counts on all cpus in test__open_syscall_event_on_all_cpus
We were bailing out after the first count mismatch, do it in all to see
if only some CPUs are not getting the expected number of events.
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/perf/builtin-test.c')
-rw-r--r-- | tools/perf/builtin-test.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/perf/builtin-test.c b/tools/perf/builtin-test.c index 7287158c483..7cc6b208694 100644 --- a/tools/perf/builtin-test.c +++ b/tools/perf/builtin-test.c | |||
@@ -408,6 +408,8 @@ static int test__open_syscall_event_on_all_cpus(void) | |||
408 | goto out_close_fd; | 408 | goto out_close_fd; |
409 | } | 409 | } |
410 | 410 | ||
411 | err = 0; | ||
412 | |||
411 | for (cpu = 0; cpu < cpus->nr; ++cpu) { | 413 | for (cpu = 0; cpu < cpus->nr; ++cpu) { |
412 | unsigned int expected; | 414 | unsigned int expected; |
413 | 415 | ||
@@ -416,18 +418,18 @@ static int test__open_syscall_event_on_all_cpus(void) | |||
416 | 418 | ||
417 | if (perf_evsel__read_on_cpu(evsel, cpu, 0) < 0) { | 419 | if (perf_evsel__read_on_cpu(evsel, cpu, 0) < 0) { |
418 | pr_debug("perf_evsel__open_read_on_cpu\n"); | 420 | pr_debug("perf_evsel__open_read_on_cpu\n"); |
419 | goto out_close_fd; | 421 | err = -1; |
422 | break; | ||
420 | } | 423 | } |
421 | 424 | ||
422 | expected = nr_open_calls + cpu; | 425 | expected = nr_open_calls + cpu; |
423 | if (evsel->counts->cpu[cpu].val != expected) { | 426 | if (evsel->counts->cpu[cpu].val != expected) { |
424 | pr_debug("perf_evsel__read_on_cpu: expected to intercept %d calls on cpu %d, got %" PRIu64 "\n", | 427 | pr_debug("perf_evsel__read_on_cpu: expected to intercept %d calls on cpu %d, got %" PRIu64 "\n", |
425 | expected, cpus->map[cpu], evsel->counts->cpu[cpu].val); | 428 | expected, cpus->map[cpu], evsel->counts->cpu[cpu].val); |
426 | goto out_close_fd; | 429 | err = -1; |
427 | } | 430 | } |
428 | } | 431 | } |
429 | 432 | ||
430 | err = 0; | ||
431 | out_close_fd: | 433 | out_close_fd: |
432 | perf_evsel__close_fd(evsel, 1, threads->nr); | 434 | perf_evsel__close_fd(evsel, 1, threads->nr); |
433 | out_evsel_delete: | 435 | out_evsel_delete: |