From a6fa003855d38d53d90c1a8a5827102e62702334 Mon Sep 17 00:00:00 2001 From: Jiri Olsa Date: Fri, 26 Jun 2015 11:29:11 +0200 Subject: perf stat: Make stats work over the thread dimension Now that we have space for thread dimension counts, let's store it. Signed-off-by: Jiri Olsa Cc: Adrian Hunter Cc: Andi Kleen Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lkml.kernel.org/r/1435310967-14570-7-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/stat.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tools/perf/util/stat.c') diff --git a/tools/perf/util/stat.c b/tools/perf/util/stat.c index 453480aa7650..7bcc19b62dd1 100644 --- a/tools/perf/util/stat.c +++ b/tools/perf/util/stat.c @@ -95,14 +95,14 @@ void perf_stat_evsel_id_init(struct perf_evsel *evsel) } } -struct perf_counts *perf_counts__new(int ncpus) +struct perf_counts *perf_counts__new(int ncpus, int nthreads) { struct perf_counts *counts = zalloc(sizeof(*counts)); if (counts) { struct xyarray *cpu; - cpu = xyarray__new(ncpus, 1, sizeof(struct perf_counts_values)); + cpu = xyarray__new(ncpus, nthreads, sizeof(struct perf_counts_values)); if (!cpu) { free(counts); return NULL; @@ -132,9 +132,9 @@ void perf_evsel__reset_counts(struct perf_evsel *evsel) perf_counts__reset(evsel->counts); } -int perf_evsel__alloc_counts(struct perf_evsel *evsel, int ncpus) +int perf_evsel__alloc_counts(struct perf_evsel *evsel, int ncpus, int nthreads) { - evsel->counts = perf_counts__new(ncpus); + evsel->counts = perf_counts__new(ncpus, nthreads); return evsel->counts != NULL ? 0 : -ENOMEM; } -- cgit v1.2.3