lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1465980311-23814-1-git-send-email-riku.voipio@linaro.org>
Date:	Wed, 15 Jun 2016 11:45:11 +0300
From:	Riku Voipio <riku.voipio@...aro.org>
To:	linux-kernel@...r.kernel.org,
	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Riku Voipio <riku.voipio@...aro.org>,
	Vineet Gupta <vgupta@...opsys.com>,
	Josh Triplett <josh@...htriplett.org>,
	Michal Marek <mmarek@...e.cz>
Subject: [PATCH] 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%

Signed-off-by: Riku Voipio <riku.voipio@...aro.org>
Cc: Vineet Gupta <vgupta@...opsys.com>
Cc: Josh Triplett <josh@...htriplett.org>
Cc: Michal Marek <mmarek@...e.cz>
---
 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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ