From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932389AbcEKNAi (ORCPT ); Wed, 11 May 2016 09:00:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45989 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932168AbcEKNAe (ORCPT ); Wed, 11 May 2016 09:00:34 -0400 Date: Wed, 11 May 2016 15:00:31 +0200 From: Jiri Olsa To: Andi Kleen Cc: acme@kernel.org, peterz@infradead.org, jolsa@kernel.org, linux-kernel@vger.kernel.org, Andi Kleen Subject: Re: [PATCH 06/10] perf, tools, stat: Avoid fractional digits for integer scales Message-ID: <20160511130031.GA1032@krava> References: <1462489447-31832-1-git-send-email-andi@firstfloor.org> <1462489447-31832-7-git-send-email-andi@firstfloor.org> <20160507191038.GH19977@krava> <20160507192425.GA13997@two.firstfloor.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160507192425.GA13997@two.firstfloor.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 11 May 2016 13:00:33 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, May 07, 2016 at 12:24:25PM -0700, Andi Kleen wrote: > > > if (csv_output) { > > > - fmt = sc != 1.0 ? "%.2f%s" : "%.0f%s"; > > > + fmt = floor(sc) != sc ? "%.2f%s" : "%.0f%s"; > > > } else { > > > if (big_num) > > > - fmt = sc != 1.0 ? "%'18.2f%s" : "%'18.0f%s"; > > > + fmt = floor(sc) != sc ? "%'18.2f%s" : "%'18.0f%s"; > > > else > > > - fmt = sc != 1.0 ? "%18.2f%s" : "%18.0f%s"; > > > + fmt = floor(sc) != sc ? "%18.2f%s" : "%18.0f%s"; > > > > how about the rest of the code? we display % also in print_running > > and print_noise_pct functions and maybe some place else > > For those it doesn't matter. In fact it's probably better there > to always show the fractions. > > It is just confusing for metrics. ok, let's try and see, we can always follow up with the rest if there's a need Acked-by: Jiri Olsa thanks, jirka