From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754678AbbCMKxs (ORCPT ); Fri, 13 Mar 2015 06:53:48 -0400 Received: from mail.kernel.org ([198.145.29.136]:44613 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751762AbbCMKxr (ORCPT ); Fri, 13 Mar 2015 06:53:47 -0400 Date: Fri, 13 Mar 2015 07:53:43 -0300 From: Arnaldo Carvalho de Melo To: Ingo Molnar Cc: linux-kernel@vger.kernel.org, Andi Kleen , Jiri Olsa Subject: Re: [PATCH 18/24] perf stat: Output running time and run/enabled ratio in CSV mode Message-ID: <20150313105343.GA19614@kernel.org> References: <1426195684-20046-1-git-send-email-acme@kernel.org> <1426195684-20046-19-git-send-email-acme@kernel.org> <20150313073441.GA20081@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150313073441.GA20081@gmail.com> X-Url: http://acmel.wordpress.com 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 Em Fri, Mar 13, 2015 at 08:34:41AM +0100, Ingo Molnar escreveu: > * Arnaldo Carvalho de Melo wrote: > > From: Andi Kleen > > +static void print_running(u64 run, u64 ena) > > +{ > > + if (csv_output) { > > + fprintf(output, "%s%" PRIu64 "%s%.2f", > > + csv_sep, > > + run, > > + csv_sep, > > + ena ? 100.0 * run / ena : 100.0); > > + } else if (run != ena) > > + fprintf(output, " (%.2f%%)", 100.0 * run / ena); > That's not the standard pattern for 'else if' branches, but: > > } else { > if () > ... > } > > to make it stand apart more from a simple 'else' branch. I think it is preferred to make it match the if branch if it uses curly braces, i.e. make it look: } else if () { } i.e switch like series of else if, to avoid too much indentation for such constructs. Fixed it and the other file, redid the perf-core-for-mingo tag, pushed. - Arnaldo