All of lore.kernel.org
 help / color / mirror / Atom feed
From: Josh Triplett <josh@joshtriplett.org>
To: Riku Voipio <riku.voipio@linaro.org>
Cc: linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Vineet Gupta <vgupta@synopsys.com>, Michal Marek <mmarek@suse.cz>
Subject: Re: [PATCH] scripts/bloat-o-meter: fix percent on <1% changes
Date: Wed, 15 Jun 2016 07:31:52 -0700	[thread overview]
Message-ID: <20160615143152.GA10418@x> (raw)
In-Reply-To: <1465980311-23814-1-git-send-email-riku.voipio@linaro.org>

On Wed, Jun 15, 2016 at 11:45:11AM +0300, Riku Voipio wrote:
> Python divisions are integer divisions unless at least one parameter
> is a float. The current bloat-o-meter fails to print sub-percentage
> changes:
> 
> Total: Before=10515408, After=10604060, chg 0.000000%
> 
> Force float division by using one float and pretty the print to
> two significant decimals:
> 
> Total: Before=10515408, After=10604060, chg +0.84%
> 
> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
> Cc: Vineet Gupta <vgupta@synopsys.com>
> Cc: Josh Triplett <josh@joshtriplett.org>
> Cc: Michal Marek <mmarek@suse.cz>

Good idea.
Reviewed-by: Josh Triplett <josh@joshtriplett.org>

> ---
>  scripts/bloat-o-meter | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/scripts/bloat-o-meter b/scripts/bloat-o-meter
> index 0254f3b..19f5adf 100755
> --- a/scripts/bloat-o-meter
> +++ b/scripts/bloat-o-meter
> @@ -67,5 +67,5 @@ print("%-40s %7s %7s %+7s" % ("function", "old", "new", "delta"))
>  for d, n in delta:
>      if d: print("%-40s %7s %7s %+7d" % (n, old.get(n,"-"), new.get(n,"-"), d))
>  
> -print("Total: Before=%d, After=%d, chg %f%%" % \
> -    (otot, ntot, (ntot - otot)*100/otot))
> +print("Total: Before=%d, After=%d, chg %+.2f%%" % \
> +    (otot, ntot, (ntot - otot)*100.0/otot))
> -- 
> 2.1.4
> 

      reply	other threads:[~2016-06-15 14:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-15  8:45 [PATCH] scripts/bloat-o-meter: fix percent on <1% changes Riku Voipio
2016-06-15 14:31 ` Josh Triplett [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160615143152.GA10418@x \
    --to=josh@joshtriplett.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mmarek@suse.cz \
    --cc=riku.voipio@linaro.org \
    --cc=vgupta@synopsys.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.