mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] More bloat-o-meter tweaks.
@ 2006-05-29 20:26 Rob Landley
  0 siblings, 0 replies; only message in thread
From: Rob Landley @ 2006-05-29 20:26 UTC (permalink / raw)
  To: mpm, linux-kernel

Some of the busybox users got confused by what looked like a table but didn't
have the total displayed at the bottom (where it won't scroll off it lots of
stuff changed).  Also, changes to string lengths weren't registering because
nm doesn't look at the rodata segment.  So I improvised.

This may not be the world's cleanest approach to addressing either issue. 
Feel free to improve upon it.  (And yes, it's svn output so it's -p0 instead
of -p1.  Sorry 'bout that.  Need to beat subversion with a large stick one of
these days.)

But what do you think of the approach?

Signed-off-by: Rob Landley <rob@landley.net>

Index: scripts/bloat-o-meter
===================================================================
--- scripts/bloat-o-meter	(revision 15036)
+++ scripts/bloat-o-meter	(working copy)
@@ -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,8 +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)
+    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)))

-- 
Never bet against the cheap plastic solution.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-05-30  5:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-29 20:26 [PATCH] More bloat-o-meter tweaks Rob Landley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®