lkml.org 
[lkml]   [2013]   [Feb]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] perf stat: refactor aggregation code
On Tue, Feb 12, 2013 at 03:09:27PM +0100, Stephane Eranian wrote:
> - fmt = "%s%.0f%s%s";
> + fmt = "%.0f%s%s";
> else if (big_num)
> - fmt = "%s%'18.0f%s%-25s";
> + fmt = "%'18.0f%s%-25s";
> else
> - fmt = "%s%18.0f%s%-25s";
> + fmt = "%18.0f%s%-25s";

I realize the code was like this before, but it's better to not
use variable sprintf formats, as you lose all the compile
time checking of the compiler and mistakes in printf are common.
Better to duplicate the sprintf.

The rest looks good to me.

Reviewed-by: Andi Kleen <ak@linux.intel.com>

-Andi


\
 
 \ /
  Last update: 2013-02-12 19:01    [W:0.126 / U:0.500 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site