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


Groups > linux.kernel > #1427420 > unrolled thread

[PATCH] scripts/bloat-o-meter: fix percent change output

Started byHeiko Carstens <heiko.carstens@de.ibm.com>
First post2016-06-21 09:50 +0200
Last post2016-06-21 14:50 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] scripts/bloat-o-meter: fix percent change output Heiko Carstens <heiko.carstens@de.ibm.com> - 2016-06-21 09:50 +0200
    Re: [PATCH] scripts/bloat-o-meter: fix percent change output Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2016-06-21 10:10 +0200
      Re: [PATCH] scripts/bloat-o-meter: fix percent change output Heiko Carstens <heiko.carstens@de.ibm.com> - 2016-06-21 14:50 +0200

#1427420 — [PATCH] scripts/bloat-o-meter: fix percent change output

FromHeiko Carstens <heiko.carstens@de.ibm.com>
Date2016-06-21 09:50 +0200
Subject[PATCH] scripts/bloat-o-meter: fix percent change output
Message-ID<rMoBz-2OV-11@gated-at.bofh.it>
commit b21e91c305bc "scripts/bloat-o-meter: print percent change"
introduced an additional line to the output of the bloat-a-meter
script which shows the percent change. However it uses integer instead
of floating point arithmetics.

Let's enforce floating point arithmetics to improve the output (note
"chg"):

Before:

add/remove: 0/0 grow/shrink: 2/0 up/down: 24/0 (24)
function                                     old     new   delta
condev_setup                                  96     114     +18
vermagic                                      58      64      +6
Total: Before=24794284, After=24794308, chg 0.000000%

After:

add/remove: 0/0 grow/shrink: 2/0 up/down: 24/0 (24)
function                                     old     new   delta
condev_setup                                  96     114     +18
vermagic                                      58      64      +6
Total: Before=24794284, After=24794308, chg 0.000097%

Cc: Vineet Gupta <Vineet.Gupta1@synopsys.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
---
 scripts/bloat-o-meter | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/bloat-o-meter b/scripts/bloat-o-meter
index 0254f3ba0dba..5a5d383004f5 100755
--- a/scripts/bloat-o-meter
+++ b/scripts/bloat-o-meter
@@ -68,4 +68,4 @@ 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))
+    (otot, ntot, (ntot - otot)*100.0/otot))
-- 
2.6.6

[toc] | [next] | [standalone]


#1427434

FromVineet Gupta <Vineet.Gupta1@synopsys.com>
Date2016-06-21 10:10 +0200
Message-ID<rMoUW-3cQ-29@gated-at.bofh.it>
In reply to#1427420
Hi Heiko,

On Tuesday 21 June 2016 01:10 PM, Heiko Carstens wrote:
> commit b21e91c305bc "scripts/bloat-o-meter: print percent change"
> introduced an additional line to the output of the bloat-a-meter
> script which shows the percent change. However it uses integer instead
> of floating point arithmetics.
>
> Let's enforce floating point arithmetics to improve the output (note
> "chg"):

There's already a (slightly better) patch in flight to same effect:
http://marc.info/?l=linux-kernel&m=146598033302242

-Vineet

> Before:
>
> add/remove: 0/0 grow/shrink: 2/0 up/down: 24/0 (24)
> function                                     old     new   delta
> condev_setup                                  96     114     +18
> vermagic                                      58      64      +6
> Total: Before=24794284, After=24794308, chg 0.000000%
>
> After:
>
> add/remove: 0/0 grow/shrink: 2/0 up/down: 24/0 (24)
> function                                     old     new   delta
> condev_setup                                  96     114     +18
> vermagic                                      58      64      +6
> Total: Before=24794284, After=24794308, chg 0.000097%
>
> Cc: Vineet Gupta <Vineet.Gupta1@synopsys.com>
> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
> ---
>  scripts/bloat-o-meter | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/bloat-o-meter b/scripts/bloat-o-meter
> index 0254f3ba0dba..5a5d383004f5 100755
> --- a/scripts/bloat-o-meter
> +++ b/scripts/bloat-o-meter
> @@ -68,4 +68,4 @@ 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))
> +    (otot, ntot, (ntot - otot)*100.0/otot))

[toc] | [prev] | [next] | [standalone]


#1427721

FromHeiko Carstens <heiko.carstens@de.ibm.com>
Date2016-06-21 14:50 +0200
Message-ID<rMthU-5Vb-37@gated-at.bofh.it>
In reply to#1427434
On Tue, Jun 21, 2016 at 08:00:05AM +0000, Vineet Gupta wrote:
> Hi Heiko,
> 
> On Tuesday 21 June 2016 01:10 PM, Heiko Carstens wrote:
> > commit b21e91c305bc "scripts/bloat-o-meter: print percent change"
> > introduced an additional line to the output of the bloat-a-meter
> > script which shows the percent change. However it uses integer instead
> > of floating point arithmetics.
> >
> > Let's enforce floating point arithmetics to improve the output (note
> > "chg"):
> 
> There's already a (slightly better) patch in flight to same effect:
> http://marc.info/?l=linux-kernel&m=146598033302242

Ok thanks, then please ignore my patch.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web