Re: [PATCH] perf, tools: Support spark lines in perf stat v2
From: Andi Kleen
Date: Wed Apr 16 2014 - 14:46:20 EST
> > +void print_stat_spark(FILE *f, struct stats *stat)
> > +{
> > + int n = stat->n, len;
> > +
> > + if (n <= 1)
> > + return;
> > + len = n;
>
> It seems the 'n' is not needed at all - just use 'len'.
This would break ".." for n == NUM_SPARK_VALS
>
>
> > + if (len > NUM_SPARK_VALS)
> > + len = NUM_SPARK_VALS;
> > + if (all_the_same(stat->svals, len))
> > + return;
>
> Why does it skip printing if all values are same? I think you wanted to
> skip the "all zero" (uncounted) case, right?
A spark line is meaningless if all values are the same.
-Andi
--
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/