All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scripts/bloat-o-meter: fix percent change output
@ 2016-06-21  7:40 Heiko Carstens
  2016-06-21  8:00 ` Vineet Gupta
  0 siblings, 1 reply; 3+ messages in thread
From: Heiko Carstens @ 2016-06-21  7:40 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, Heiko Carstens, Vineet Gupta

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-06-21 12:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-21  7:40 [PATCH] scripts/bloat-o-meter: fix percent change output Heiko Carstens
2016-06-21  8:00 ` Vineet Gupta
2016-06-21  8:59   ` Heiko Carstens

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.