From f87027b9689d591ec22720944563a2d43ec835c4 Mon Sep 17 00:00:00 2001 From: Jiri Olsa Date: Wed, 3 Jun 2015 16:25:59 +0200 Subject: perf stat: Move shadow stat counters into separate object Separating shadow counters code into separate object as a cleanup, but mainly for upcomming changes, so could use it from script command context. Signed-off-by: Jiri Olsa Cc: Andi Kleen Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lkml.kernel.org/r/1433341559-31848-10-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/stat.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tools/perf/util/stat.h') diff --git a/tools/perf/util/stat.h b/tools/perf/util/stat.h index 3df529bd0774..615c779eb42a 100644 --- a/tools/perf/util/stat.h +++ b/tools/perf/util/stat.h @@ -2,6 +2,7 @@ #define __PERF_STATS_H #include +#include struct stats { @@ -23,6 +24,13 @@ struct perf_stat { enum perf_stat_evsel_id id; }; +enum aggr_mode { + AGGR_NONE, + AGGR_GLOBAL, + AGGR_SOCKET, + AGGR_CORE, +}; + void update_stats(struct stats *stats, u64 val); double avg_stats(struct stats *stats); double stddev_stats(struct stats *stats); @@ -46,4 +54,12 @@ bool __perf_evsel_stat__is(struct perf_evsel *evsel, void perf_stat_evsel_id_init(struct perf_evsel *evsel); +extern struct stats walltime_nsecs_stats; + +void perf_stat__reset_shadow_stats(void); +void perf_stat__update_shadow_stats(struct perf_evsel *counter, u64 *count, + int cpu); +void perf_stat__print_shadow_stats(FILE *out, struct perf_evsel *evsel, + double avg, int cpu, enum aggr_mode aggr); + #endif -- cgit v1.2.3