diff options
Diffstat (limited to 'tools/perf/util/stat.h')
-rw-r--r-- | tools/perf/util/stat.h | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/tools/perf/util/stat.h b/tools/perf/util/stat.h index 086f4e128d63..0150e786ccc7 100644 --- a/tools/perf/util/stat.h +++ b/tools/perf/util/stat.h | |||
@@ -68,21 +68,23 @@ void perf_stat_evsel_id_init(struct perf_evsel *evsel); | |||
68 | 68 | ||
69 | extern struct stats walltime_nsecs_stats; | 69 | extern struct stats walltime_nsecs_stats; |
70 | 70 | ||
71 | typedef void (*print_metric_t)(void *ctx, const char *color, const char *unit, | ||
72 | const char *fmt, double val); | ||
73 | typedef void (*new_line_t )(void *ctx); | ||
74 | |||
75 | void perf_stat__init_shadow_stats(void); | ||
71 | void perf_stat__reset_shadow_stats(void); | 76 | void perf_stat__reset_shadow_stats(void); |
72 | void perf_stat__update_shadow_stats(struct perf_evsel *counter, u64 *count, | 77 | void perf_stat__update_shadow_stats(struct perf_evsel *counter, u64 *count, |
73 | int cpu); | 78 | int cpu); |
74 | void perf_stat__print_shadow_stats(FILE *out, struct perf_evsel *evsel, | 79 | struct perf_stat_output_ctx { |
75 | double avg, int cpu, enum aggr_mode aggr); | 80 | void *ctx; |
76 | 81 | print_metric_t print_metric; | |
77 | void perf_evsel__reset_stat_priv(struct perf_evsel *evsel); | 82 | new_line_t new_line; |
78 | int perf_evsel__alloc_stat_priv(struct perf_evsel *evsel); | 83 | }; |
79 | void perf_evsel__free_stat_priv(struct perf_evsel *evsel); | ||
80 | |||
81 | int perf_evsel__alloc_prev_raw_counts(struct perf_evsel *evsel, | ||
82 | int ncpus, int nthreads); | ||
83 | void perf_evsel__free_prev_raw_counts(struct perf_evsel *evsel); | ||
84 | 84 | ||
85 | int perf_evsel__alloc_stats(struct perf_evsel *evsel, bool alloc_raw); | 85 | void perf_stat__print_shadow_stats(struct perf_evsel *evsel, |
86 | double avg, int cpu, | ||
87 | struct perf_stat_output_ctx *out); | ||
86 | 88 | ||
87 | int perf_evlist__alloc_stats(struct perf_evlist *evlist, bool alloc_raw); | 89 | int perf_evlist__alloc_stats(struct perf_evlist *evlist, bool alloc_raw); |
88 | void perf_evlist__free_stats(struct perf_evlist *evlist); | 90 | void perf_evlist__free_stats(struct perf_evlist *evlist); |