diff options
author | Jiri Olsa <jolsa@kernel.org> | 2015-06-26 11:29:11 +0200 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-06-26 11:20:02 -0300 |
commit | a6fa003855d38d53d90c1a8a5827102e62702334 (patch) | |
tree | da5d7f02f11c25c76060c8551bd8cf0dda6442ad /tools/perf/util/stat.c | |
parent | a8e02324dfe6bcafc15d02b790f33321ec4facb0 (diff) |
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 <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-7-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/stat.c')
-rw-r--r-- | tools/perf/util/stat.c | 8 |
1 files changed, 4 insertions, 4 deletions
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; } |