Re: [PATCH 2/9] perf, tools, stat: Abstract stat metrics printing

2015-09-04 Thread Jiri Olsa
On Wed, Sep 02, 2015 at 04:35:47PM -0700, Andi Kleen wrote: SNIP > diff --git a/tools/perf/util/stat.h b/tools/perf/util/stat.h > index 62448c8..bb07e46 100644 > --- a/tools/perf/util/stat.h > +++ b/tools/perf/util/stat.h > @@ -67,11 +67,21 @@ void perf_stat_evsel_id_init(struct perf_evsel *evsel

Re: [PATCH 2/9] perf, tools, stat: Abstract stat metrics printing

2015-09-04 Thread Jiri Olsa
On Wed, Sep 02, 2015 at 04:35:47PM -0700, Andi Kleen wrote: SNIP > > @@ -752,15 +796,7 @@ static void print_counter(struct perf_evsel *counter, > char *prefix) > } > > uval = val * counter->scale; > - > - if (nsec_counter(counter)) > -

[PATCH 2/9] perf, tools, stat: Abstract stat metrics printing

2015-09-02 Thread Andi Kleen
From: Andi Kleen Abstract the printing of shadow metrics. Instead of every metric calling fprintf directly and taking care of indentation, use two call backs: one to print metrics and another to start a new line. This will allow adding metrics to CSV mode and also using them for other purposes.