diff options
author | Rob Landley <rob@landley.net> | 2006-05-29 20:56:27 +0000 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2006-05-29 20:56:27 +0000 |
commit | f14f7fc5cad5cac1a0913b85c8304f6fb77697ad (patch) | |
tree | d62998e7b5e3f51e33b90b3ab156a3aa298b16a0 | |
parent | 077368194c7ea6ef4b2fbbc2271d251e8400ef79 (diff) | |
download | busybox-w32-f14f7fc5cad5cac1a0913b85c8304f6fb77697ad.tar.gz busybox-w32-f14f7fc5cad5cac1a0913b85c8304f6fb77697ad.tar.bz2 busybox-w32-f14f7fc5cad5cac1a0913b85c8304f6fb77697ad.zip |
Teach bloatometer about .rodata, and tweak the display into something that
has a better chance of getting merged.
-rwxr-xr-x | scripts/bloat-o-meter | 18 |
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 | ||
25 | old = getsizes(sys.argv[1]) | 29 | old = getsizes(sys.argv[1]) |
@@ -52,12 +56,10 @@ for name in common: | |||
52 | delta.sort() | 56 | delta.sort() |
53 | delta.reverse() | 57 | delta.reverse() |
54 | 58 | ||
55 | print "add/remove: %s/%s grow/shrink: %s/%s up/down: %s/%s (%s)" % \ | 59 | print "%-48s %7s %7s %+7s" % ("function", "old", "new", "delta") |
56 | (add, remove, grow, shrink, up, -down, up-down) | ||
57 | print "%-40s %7s %7s %+7s" % ("function", "old", "new", "delta") | ||
58 | for d, n in delta: | 60 | for 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) |
60 | print "----------------------------------------------------------------" | 62 | print "-"*78 |
61 | s=")" | 63 | total="(add/remove: %s/%s grow/shrink: %s/%s up/down: %s/%s)%%sTotal: %s bytes"\ |
62 | if (up-down)>=0: s="(" | 64 | % (add, remove, grow, shrink, up, -down, up-down) |
63 | print "Result :-%s%+7d" % (s, up-down) | 65 | print total % (" "*(80-len(total))) |