diff options
author | Riku Voipio <riku.voipio@linaro.org> | 2016-07-26 18:21:20 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-07-26 19:19:19 -0400 |
commit | 8cde0daf6c4cca8babec4861a1ce7f8875edf879 (patch) | |
tree | ef8a261473766fa1a295113bd666fb9fc2091977 /scripts/bloat-o-meter | |
parent | c965b105bf1509beefbb78d33f721d92240a770c (diff) |
scripts/bloat-o-meter: fix percent on <1% changes
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%
Link: http://lkml.kernel.org/r/1465980311-23814-1-git-send-email-riku.voipio@linaro.org
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: Michal Marek <mmarek@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts/bloat-o-meter')
-rwxr-xr-x | scripts/bloat-o-meter | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/bloat-o-meter b/scripts/bloat-o-meter index 0254f3ba0dba..19f5adfd877d 100755 --- a/scripts/bloat-o-meter +++ b/scripts/bloat-o-meter | |||
@@ -67,5 +67,5 @@ print("%-40s %7s %7s %+7s" % ("function", "old", "new", "delta")) | |||
67 | for d, n in delta: | 67 | for d, n in delta: |
68 | if d: print("%-40s %7s %7s %+7d" % (n, old.get(n,"-"), new.get(n,"-"), d)) | 68 | if d: print("%-40s %7s %7s %+7d" % (n, old.get(n,"-"), new.get(n,"-"), d)) |
69 | 69 | ||
70 | print("Total: Before=%d, After=%d, chg %f%%" % \ | 70 | print("Total: Before=%d, After=%d, chg %+.2f%%" % \ |
71 | (otot, ntot, (ntot - otot)*100/otot)) | 71 | (otot, ntot, (ntot - otot)*100.0/otot)) |