Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1423087

Re: [PATCH] scripts/bloat-o-meter: fix percent on <1% changes

From Josh Triplett <josh@joshtriplett.org>
Newsgroups linux.kernel
Subject Re: [PATCH] scripts/bloat-o-meter: fix percent on <1% changes
Date 2016-06-15 16:40 +0200
Message-ID <rKk94-3Hl-9@gated-at.bofh.it> (permalink)
References <rKeGm-ez-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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
> 

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] scripts/bloat-o-meter: fix percent on <1% changes Riku Voipio <riku.voipio@linaro.org> - 2016-06-15 10:50 +0200
  Re: [PATCH] scripts/bloat-o-meter: fix percent on <1% changes Josh Triplett <josh@joshtriplett.org> - 2016-06-15 16:40 +0200

csiph-web