summaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-stat.c
diff options
context:
space:
mode:
authorJiri Olsa2015-06-26 11:29:09 +0200
committerArnaldo Carvalho de Melo2015-06-26 16:11:26 +0200
commit1ac77e1ce8654ec94ada0c508d58ba80a4647fba (patch)
treeaf641ba0dc1fadca7bd3a729b17535aafe49e3de /tools/perf/builtin-stat.c
parentperf tests: Add thread_map object tests (diff)
downloadkernel-qcow2-linux-1ac77e1ce8654ec94ada0c508d58ba80a4647fba.tar.gz
kernel-qcow2-linux-1ac77e1ce8654ec94ada0c508d58ba80a4647fba.tar.xz
kernel-qcow2-linux-1ac77e1ce8654ec94ada0c508d58ba80a4647fba.zip
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/builtin-stat.c')
-rw-r--r--tools/perf/builtin-stat.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 3e1636cae76b..49b90374232c 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -316,7 +316,7 @@ static int read_cb(struct perf_evsel *evsel, int cpu, int thread __maybe_unused,
if (!evsel->snapshot)
perf_evsel__compute_deltas(evsel, cpu, count);
perf_counts_values__scale(count, scale, NULL);
- evsel->counts->cpu[cpu] = *count;
+ *perf_counts(evsel->counts, cpu) = *count;
if (aggr_mode == AGGR_NONE)
perf_stat__update_shadow_stats(evsel, count->values, cpu);
break;
@@ -805,9 +805,9 @@ static void print_aggr(char *prefix)
s2 = aggr_get_id(evsel_list->cpus, cpu2);
if (s2 != id)
continue;
- val += counter->counts->cpu[cpu].val;
- ena += counter->counts->cpu[cpu].ena;
- run += counter->counts->cpu[cpu].run;
+ val += perf_counts(counter->counts, cpu)->val;
+ ena += perf_counts(counter->counts, cpu)->ena;
+ run += perf_counts(counter->counts, cpu)->run;
nr++;
}
if (prefix)
@@ -915,9 +915,9 @@ static void print_counter(struct perf_evsel *counter, char *prefix)
int cpu;
for (cpu = 0; cpu < perf_evsel__nr_cpus(counter); cpu++) {
- val = counter->counts->cpu[cpu].val;
- ena = counter->counts->cpu[cpu].ena;
- run = counter->counts->cpu[cpu].run;
+ val = perf_counts(counter->counts, cpu)->val;
+ ena = perf_counts(counter->counts, cpu)->ena;
+ run = perf_counts(counter->counts, cpu)->run;
if (prefix)
fprintf(output, "%s", prefix);