lkml.org 
[lkml]   [2015]   [Mar]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 18/24] perf stat: Output running time and run/enabled ratio in CSV mode

* Arnaldo Carvalho de Melo <acme@kernel.org> wrote:

> Em Fri, Mar 13, 2015 at 08:34:41AM +0100, Ingo Molnar escreveu:
> > * Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> > > From: Andi Kleen <ak@linux.intel.com>
> > > +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.

Pulled into tip:perf/core, thanks a lot Arnaldo!

Ingo


\
 
 \ /
  Last update: 2015-03-13 13:41    [W:0.056 / U:27.048 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site