summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2014-01-07 10:35:59 +0100
committerThomas Martitz <kugel@rockbox.org>2014-01-07 10:35:59 +0100
commit98d2121eaa857fcd9e665f6a5f321703b9659af1 (patch)
tree608bbf27c6afe1610022dbf3dfe6996d5d280492
parent204668db894f7c26db6c56e94aba33ecd022cdb4 (diff)
downloadrockbox-98d2121.tar.gz
rockbox-98d2121.tar.bz2
rockbox-98d2121.zip
bloat-o-meter.py: Now compatible to python 3.
Change-Id: Id617aa6304a5a9263ef6ceed7d9c3010b47e73a8
-rwxr-xr-xutils/analysis/bloat-o-meter.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/utils/analysis/bloat-o-meter.py b/utils/analysis/bloat-o-meter.py
index 311b90cdc3..98ca6c2ae5 100755
--- a/utils/analysis/bloat-o-meter.py
+++ b/utils/analysis/bloat-o-meter.py
@@ -25,10 +25,11 @@ nm_args = " ".join([x for x in sys.argv[3:]])
def getsizes(file):
sym = {}
for l in os.popen("nm --size-sort %s %s" % (nm_args, file)).readlines():
- l = l.strip()
- # Skip empty lines
- if not len(l): continue
- # Skip archive members
+ l = l.strip()
+ # Skip empty lines
+ if not len(l):
+ continue
+ # Skip archive members
if len(l.split()) == 1 and l.endswith(':'):
continue
size, type, name = l.split()
@@ -71,10 +72,10 @@ for name in common:
delta.sort()
delta.reverse()
-print "%-48s %7s %7s %+7s" % ("function", "old", "new", "delta")
+print("%-48s %7s %7s %+7s" % ("function", "old", "new", "delta"))
for d, n in delta:
- if d: print "%-48s %7s %7s %+7d" % (n, old.get(n,"-"), new.get(n,"-"), d)
-print "-"*78
+ if d: print("%-48s %7s %7s %+7d" % (n, old.get(n,"-"), new.get(n,"-"), d))
+print("-" * 78)
total="(add/remove: %s/%s grow/shrink: %s/%s up/down: %s/%s)%%s\nTotal: %s bytes"\
% (add, remove, grow, shrink, up, -down, up-down)
-print total % (" "*(80-len(total)))
+print(total % (" "*(80-len(total))))