From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752113AbbCMHgz (ORCPT ); Fri, 13 Mar 2015 03:36:55 -0400 Received: from mail-wi0-f179.google.com ([209.85.212.179]:33857 "EHLO mail-wi0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750830AbbCMHgx (ORCPT ); Fri, 13 Mar 2015 03:36:53 -0400 Date: Fri, 13 Mar 2015 08:36:47 +0100 From: Ingo Molnar To: Arnaldo Carvalho de Melo Cc: linux-kernel@vger.kernel.org, Andi Kleen , Arnaldo Carvalho de Melo Subject: Re: [PATCH 20/24] perf stat: Always correctly indent ratio column Message-ID: <20150313073647.GB20081@gmail.com> References: <1426195684-20046-1-git-send-email-acme@kernel.org> <1426195684-20046-21-git-send-email-acme@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1426195684-20046-21-git-send-email-acme@kernel.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 * Arnaldo Carvalho de Melo wrote: > From: Andi Kleen > > When cycles or instructions do not print anything, as in being, > --per-socket or --per-core modi, the ratio column was not correctly > indented for them. This lead to some ratios not lining up with the > others. Always indent correctly when nothing is printed. > > Signed-off-by: Andi Kleen > Link: http://lkml.kernel.org/r/1426087682-22765-3-git-send-email-andi@firstfloor.org > Signed-off-by: Arnaldo Carvalho de Melo > --- > tools/perf/builtin-stat.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c > index e78c68df2152..41b296fff307 100644 > --- a/tools/perf/builtin-stat.c > +++ b/tools/perf/builtin-stat.c > @@ -1093,7 +1093,8 @@ static void abs_printout(int id, int nr, struct perf_evsel *evsel, double avg) > if (total) { > ratio = avg / total; > fprintf(output, " # %5.2f insns per cycle ", ratio); > - } > + } else > + fprintf(output, " "); The standard pattern is symmetric curly braces. > @@ -1162,7 +1163,8 @@ static void abs_printout(int id, int nr, struct perf_evsel *evsel, double avg) > if (total) { > ratio = avg / total; > fprintf(output, " # %8.3f GHz ", ratio); > - } > + } else > + fprintf(output, " "); Ditto... Thanks, Ingo