Skip to content

Commit

Permalink
perf test: Check counts on all cpus in test__open_syscall_event_on_al…
Browse files Browse the repository at this point in the history
…l_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>
  • Loading branch information
Arnaldo Carvalho de Melo committed Jan 22, 2011
1 parent 915fce2 commit d2af968
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tools/perf/builtin-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,8 @@ static int test__open_syscall_event_on_all_cpus(void)
goto out_close_fd;
}

err = 0;

for (cpu = 0; cpu < cpus->nr; ++cpu) {
unsigned int expected;

Expand All @@ -416,18 +418,18 @@ static int test__open_syscall_event_on_all_cpus(void)

if (perf_evsel__read_on_cpu(evsel, cpu, 0) < 0) {
pr_debug("perf_evsel__open_read_on_cpu\n");
goto out_close_fd;
err = -1;
break;
}

expected = nr_open_calls + cpu;
if (evsel->counts->cpu[cpu].val != expected) {
pr_debug("perf_evsel__read_on_cpu: expected to intercept %d calls on cpu %d, got %" PRIu64 "\n",
expected, cpus->map[cpu], evsel->counts->cpu[cpu].val);
goto out_close_fd;
err = -1;
}
}

err = 0;
out_close_fd:
perf_evsel__close_fd(evsel, 1, threads->nr);
out_evsel_delete:
Expand Down

0 comments on commit d2af968

Please sign in to comment.