Re: [PATCH 2/4] perf, tools, stat: Abstract stat metrics printing
From: Jiri Olsa
Date: Thu Jul 30 2015 - 09:42:42 EST
On Wed, Jul 29, 2015 at 05:21:38PM -0700, Andi Kleen wrote:
SNIP
> +static void nsec_printout(int id, int nr, struct perf_evsel *evsel, double avg,
> + void *ctx, print_metric_t print_metric)
> {
> double msecs = avg / 1e6;
> const char *fmt_v, *fmt_n;
> @@ -647,13 +689,16 @@ static void nsec_printout(int id, int nr, struct perf_evsel *evsel, double avg)
> return;
>
> if (perf_evsel__match(evsel, SOFTWARE, SW_TASK_CLOCK))
> - fprintf(output, " # %8.3f CPUs utilized ",
> - avg / avg_stats(&walltime_nsecs_stats));
> + print_metric(ctx, NULL, "%8.3f", "CPUs utilized",
> + avg / avg_stats(&walltime_nsecs_stats));
> else
> - fprintf(output, " ");
> + print_metric(ctx, NULL, NULL, NULL, 0);
> }
hum, this should go to perf_stat__print_shadow_stats,
could you please move it there before this patch?
thanks,
jirka
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/