From: Rob Landley <rob@landley.net>
To: mpm@selenic.com, linux-kernel@vger.kernel.org
Subject: [PATCH] More bloat-o-meter tweaks.
Date: Mon, 29 May 2006 16:26:04 -0400 [thread overview]
Message-ID: <200605291626.04327.rob@landley.net> (raw)
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.
reply other threads:[~2006-05-30 5:49 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200605291626.04327.rob@landley.net \
--to=rob@landley.net \
--cc=linux-kernel@vger.kernel.org \
--cc=mpm@selenic.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®