aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlandley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-05-29 20:56:27 +0000
committerlandley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-05-29 20:56:27 +0000
commit6686c197734ee2478a085a8b85c421fb4aac6520 (patch)
treed62998e7b5e3f51e33b90b3ab156a3aa298b16a0
parentbed3ab499665fa602868ce2e29af2fc25056af8f (diff)
downloadbusybox-w32-6686c197734ee2478a085a8b85c421fb4aac6520.tar.gz
busybox-w32-6686c197734ee2478a085a8b85c421fb4aac6520.tar.bz2
busybox-w32-6686c197734ee2478a085a8b85c421fb4aac6520.zip
Teach bloatometer about .rodata, and tweak the display into something that
has a better chance of getting merged. git-svn-id: svn://busybox.net/trunk/busybox@15225 69ca8d6d-28ef-0310-b511-8ec308f3f277
-rwxr-xr-xscripts/bloat-o-meter18
1 files changed, 10 insertions, 8 deletions
diff --git a/scripts/bloat-o-meter b/scripts/bloat-o-meter
index e7e16b521..31364fe11 100755
--- a/scripts/bloat-o-meter
+++ b/scripts/bloat-o-meter
@@ -20,6 +20,10 @@ def getsizes(file):
20 if type in "tTdDbB": 20 if type in "tTdDbB":
21 if "." in name: name = "static." + name.split(".")[0] 21 if "." in name: name = "static." + name.split(".")[0]
22 sym[name] = sym.get(name, 0) + int(size, 16) 22 sym[name] = sym.get(name, 0) + int(size, 16)
23 for l in os.popen("readelf -S " + file).readlines():
24 x = l.split()
25 if len(x)<6 or x[1] != ".rodata": continue
26 sym[".rodata"] = int(x[5], 16)
23 return sym 27 return sym
24 28
25old = getsizes(sys.argv[1]) 29old = getsizes(sys.argv[1])
@@ -52,12 +56,10 @@ for name in common:
52delta.sort() 56delta.sort()
53delta.reverse() 57delta.reverse()
54 58
55print "add/remove: %s/%s grow/shrink: %s/%s up/down: %s/%s (%s)" % \ 59print "%-48s %7s %7s %+7s" % ("function", "old", "new", "delta")
56 (add, remove, grow, shrink, up, -down, up-down)
57print "%-40s %7s %7s %+7s" % ("function", "old", "new", "delta")
58for d, n in delta: 60for d, n in delta:
59 if d: print "%-40s %7s %7s %+7d" % (n, old.get(n,"-"), new.get(n,"-"), d) 61 if d: print "%-48s %7s %7s %+7d" % (n, old.get(n,"-"), new.get(n,"-"), d)
60print "----------------------------------------------------------------" 62print "-"*78
61s=")" 63total="(add/remove: %s/%s grow/shrink: %s/%s up/down: %s/%s)%%sTotal: %s bytes"\
62if (up-down)>=0: s="(" 64 % (add, remove, grow, shrink, up, -down, up-down)
63print "Result :-%s%+7d" % (s, up-down) 65print total % (" "*(80-len(total)))