[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130212172637.GC30387@tassilo.jf.intel.com>
Date: Tue, 12 Feb 2013 09:26:37 -0800
From: Andi Kleen <ak@...ux.intel.com>
To: Stephane Eranian <eranian@...gle.com>
Cc: linux-kernel@...r.kernel.org, peterz@...radead.org, mingo@...e.hu,
acme@...hat.com, jolsa@...hat.com, namhyung.kim@....com
Subject: Re: [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@...ux.intel.com>
-Andi
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists