From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751473AbbG3Nmi (ORCPT ); Thu, 30 Jul 2015 09:42:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59499 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750734AbbG3Nmh (ORCPT ); Thu, 30 Jul 2015 09:42:37 -0400 Date: Thu, 30 Jul 2015 15:42:34 +0200 From: Jiri Olsa To: Andi Kleen Cc: acme@kernel.org, jolsa@kernel.org, eranian@google.com, linux-kernel@vger.kernel.org, Andi Kleen Subject: Re: [PATCH 2/4] perf, tools, stat: Abstract stat metrics printing Message-ID: <20150730134234.GO9606@krava.brq.redhat.com> References: <1438215700-5530-1-git-send-email-andi@firstfloor.org> <1438215700-5530-3-git-send-email-andi@firstfloor.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1438215700-5530-3-git-send-email-andi@firstfloor.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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