aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/stat.h
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2015-06-26 11:29:10 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-06-26 11:19:19 -0300
commita8e02324dfe6bcafc15d02b790f33321ec4facb0 (patch)
tree74fc921aab20fe15559b3a0bb82095cee80aa9b9 /tools/perf/util/stat.h
parentperf stat: Introduce perf_counts function (diff)
downloadlinux-dev-a8e02324dfe6bcafc15d02b790f33321ec4facb0.tar.xz
linux-dev-a8e02324dfe6bcafc15d02b790f33321ec4facb0.zip
perf stat: Use xyarray for cpu evsel counts
Switching single dimensional array of 'struct perf_counts_values' with xyarray object, so we could store thread dimension counts. 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-6-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/stat.h')
-rw-r--r--tools/perf/util/stat.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/perf/util/stat.h b/tools/perf/util/stat.h
index 5e43348836a6..6d07612545e0 100644
--- a/tools/perf/util/stat.h
+++ b/tools/perf/util/stat.h
@@ -3,6 +3,7 @@
#include <linux/types.h>
#include <stdio.h>
+#include "xyarray.h"
struct stats
{
@@ -45,13 +46,13 @@ struct perf_counts_values {
struct perf_counts {
s8 scaled;
struct perf_counts_values aggr;
- struct perf_counts_values cpu[];
+ struct xyarray *cpu;
};
static inline struct perf_counts_values*
perf_counts(struct perf_counts *counts, int cpu)
{
- return &counts->cpu[cpu];
+ return xyarray__entry(counts->cpu, cpu, 0);
}
void update_stats(struct stats *stats, u64 val);
@@ -88,7 +89,7 @@ void perf_stat__print_shadow_stats(FILE *out, struct perf_evsel *evsel,
struct perf_counts *perf_counts__new(int ncpus);
void perf_counts__delete(struct perf_counts *counts);
-void perf_evsel__reset_counts(struct perf_evsel *evsel, int ncpus);
+void perf_evsel__reset_counts(struct perf_evsel *evsel);
int perf_evsel__alloc_counts(struct perf_evsel *evsel, int ncpus);
void perf_evsel__free_counts(struct perf_evsel *evsel);
#endif