summaryrefslogtreecommitdiff
path: root/tools/perf/util/stat.h
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2018-08-30 08:32:28 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2018-08-30 15:52:23 -0300
commit6ca9a082b1908ff7f8adedf08166043b83b266f6 (patch)
tree0ce5a8f63ea34ec377ee7d4d9bb0496e9b41778b /tools/perf/util/stat.h
parentf3ca50e61ff4aebfbefc666be2e064d277ad524c (diff)
perf stat: Pass a 'struct perf_stat_config' argument to global print functions
Add 'struct perf_stat_config' argument to the global print functions, so that these functions can be used out of the 'perf stat' command code. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: David Ahern <dsahern@gmail.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/20180830063252.23729-20-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.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/perf/util/stat.h b/tools/perf/util/stat.h
index da6a706daecc..dffcf2110706 100644
--- a/tools/perf/util/stat.h
+++ b/tools/perf/util/stat.h
@@ -135,9 +135,10 @@ bool __perf_evsel_stat__is(struct perf_evsel *evsel,
extern struct runtime_stat rt_stat;
extern struct stats walltime_nsecs_stats;
-typedef void (*print_metric_t)(void *ctx, const char *color, const char *unit,
+typedef void (*print_metric_t)(struct perf_stat_config *config,
+ void *ctx, const char *color, const char *unit,
const char *fmt, double val);
-typedef void (*new_line_t )(void *ctx);
+typedef void (*new_line_t)(struct perf_stat_config *config, void *ctx);
void runtime_stat__init(struct runtime_stat *st);
void runtime_stat__exit(struct runtime_stat *st);
@@ -153,7 +154,8 @@ struct perf_stat_output_ctx {
bool force_header;
};
-void perf_stat__print_shadow_stats(struct perf_evsel *evsel,
+void perf_stat__print_shadow_stats(struct perf_stat_config *config,
+ struct perf_evsel *evsel,
double avg, int cpu,
struct perf_stat_output_ctx *out,
struct rblist *metric_events,