summaryrefslogtreecommitdiff
path: root/tools/perf/tests
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2015-06-26 11:29:09 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-06-26 11:11:26 -0300
commit1ac77e1ce8654ec94ada0c508d58ba80a4647fba (patch)
treeaf641ba0dc1fadca7bd3a729b17535aafe49e3de /tools/perf/tests
parent134aa44f6bff6b967efb85255ee9e8982cb8e486 (diff)
perf stat: Introduce perf_counts function
Introducing perf_counts function, that returns 'struct perf_counts_values' pointer for given cpu. Also moving perf_counts* structures into stat.h. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1435310967-14570-5-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/tests')
-rw-r--r--tools/perf/tests/openat-syscall-all-cpus.c4
-rw-r--r--tools/perf/tests/openat-syscall.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/tools/perf/tests/openat-syscall-all-cpus.c b/tools/perf/tests/openat-syscall-all-cpus.c
index b8d552b13950..e8d944fe1bd0 100644
--- a/tools/perf/tests/openat-syscall-all-cpus.c
+++ b/tools/perf/tests/openat-syscall-all-cpus.c
@@ -98,9 +98,9 @@ int test__openat_syscall_event_on_all_cpus(void)
}
expected = nr_openat_calls + cpu;
- if (evsel->counts->cpu[cpu].val != expected) {
+ if (perf_counts(evsel->counts, 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);
+ expected, cpus->map[cpu], perf_counts(evsel->counts, cpu)->val);
err = -1;
}
}
diff --git a/tools/perf/tests/openat-syscall.c b/tools/perf/tests/openat-syscall.c
index bdfa1f446681..e86fc477a74f 100644
--- a/tools/perf/tests/openat-syscall.c
+++ b/tools/perf/tests/openat-syscall.c
@@ -44,7 +44,7 @@ int test__openat_syscall_event(void)
goto out_close_fd;
}
- if (evsel->counts->cpu[0].val != nr_openat_calls) {
+ if (perf_counts(evsel->counts, 0)->val != nr_openat_calls) {
pr_debug("perf_evsel__read_on_cpu: expected to intercept %d calls, got %" PRIu64 "\n",
nr_openat_calls, evsel->counts->cpu[0].val);
goto out_close_fd;