svn commit: trunk/busybox/scripts

landley at busybox.net landley at busybox.net
Mon May 29 20:56:28 UTC 2006


Author: landley
Date: 2006-05-29 13:56:27 -0700 (Mon, 29 May 2006)
New Revision: 15225

Log:
Teach bloatometer about .rodata, and tweak the display into something that
has a better chance of getting merged.


Modified:
   trunk/busybox/scripts/bloat-o-meter


Changeset:
Modified: trunk/busybox/scripts/bloat-o-meter
===================================================================
--- trunk/busybox/scripts/bloat-o-meter	2006-05-29 20:01:52 UTC (rev 15224)
+++ trunk/busybox/scripts/bloat-o-meter	2006-05-29 20:56:27 UTC (rev 15225)
@@ -20,6 +20,10 @@
         if type in "tTdDbB":
             if "." in name: name = "static." + name.split(".")[0]
             sym[name] = sym.get(name, 0) + int(size, 16)
+    for l in os.popen("readelf -S " + file).readlines():
+        x = l.split()
+        if len(x)<6 or x[1] != ".rodata": continue
+        sym[".rodata"] = int(x[5], 16)
     return sym
 
 old = getsizes(sys.argv[1])
@@ -52,12 +56,10 @@
 delta.sort()
 delta.reverse()
 
-print "add/remove: %s/%s grow/shrink: %s/%s up/down: %s/%s (%s)" % \
-      (add, remove, grow, shrink, up, -down, up-down)
-print "%-40s %7s %7s %+7s" % ("function", "old", "new", "delta")
+print "%-48s %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 "----------------------------------------------------------------"
-s=")"
-if (up-down)>=0: s="("
-print "Result                                                :-%s%+7d" % (s, up-down)
+    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)%%sTotal: %s bytes"\
+    % (add, remove, grow, shrink, up, -down, up-down)
+print total % (" "*(80-len(total)))




More information about the busybox-cvs mailing list