Commit Graph

20 Commits

Author SHA1 Message Date
Ron Yorston
0b25e810ed bloat-o-meter: avoid double counting
Disable 'echo' in the default config, run 'make baseline', then
re-enable 'echo' and run 'make bloatcheck':

function                                             old     new   delta
.rodata                                           182521  182622    +101
packed_usage                                       33714   33792     +78
applet_main                                         3168    3176      +8
applet_names                                        2730    2735      +5
applet_suid                                           99     100      +1
applet_install_loc                                   198     199      +1
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 6/0 up/down: 194/0)             Total: 194 bytes
   text	   data	    bss	    dec	    hex	filename
 955052	   4195	   1808	 961055	  eaa1f	busybox_old
 955153	   4195	   1808	 961156	  eaa84	busybox_unstripped

The Total bytes value doesn't equal the change in the size of the
binary.  The packed_usage and applet_* items are in .rodata and
are counted twice.  With this modified bloat-o-meter the size of
named items is deducted from .rodata:

function                                             old     new   delta
packed_usage                                       33714   33792     +78
applet_main                                         3168    3176      +8
.rodata                                           105105  105113      +8
applet_names                                        2730    2735      +5
applet_suid                                           99     100      +1
applet_install_loc                                   198     199      +1
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 6/0 up/down: 101/0)             Total: 101 bytes
   text	   data	    bss	    dec	    hex	filename
 955052	   4195	   1808	 961055	  eaa1f	busybox_old
 955153	   4195	   1808	 961156	  eaa84	busybox_unstripped

v2: Sections numbered less than 10 were always being omitted from
    consideration because splitting "[ 1] .interp" leaves "1]" in
    x[1] where the section name is expected.  This wasn't a problem
    for .rodata (numbered 15 in my testing) but let's fix it anyway.

Signed-off-by: Ron Yorston <rmy@pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-03-09 17:25:07 +01:00
Bartosz Golaszewski
28a209466f bloat-o-meter: add usage info
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-10-16 19:18:05 +02:00
Bernhard Reutner-Fischer
25dbb0743e bloat-o-meter: Remove unused code
The regex matching is way slower, so remove it since it was disabled
anyway.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-03-30 19:50:39 +02:00
Bernhard Reutner-Fischer
b1b70969e0 bloat-o-meter: handle huge (hex) sizes.
dynamic symbols with size >99999 are printed in hex.
see print_vma(psym->st_size, DEC_5)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-03-30 19:26:40 +02:00
Lauri Kasanen
98f213ed79 bloat-o-meter: don't require that pythin is in /usr/bin.
Signed-off-by: Lauri Kasanen <curaga@operamail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-07-08 10:56:58 +02:00
Marek Polacek
8410ac1a07 bloat-o-meter: make it python3 compliant
Python 3 doesn't support the iterkeys() method anymore.  Use
iter(foo.keys()) instead of foo.iterkeys().

Signed-off-by: Marek Polacek <mmpolacek@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-28 21:39:40 +02:00
Bernhard Reutner-Fischer
eb255752c1 bloat-o-meter: convert to print() calls
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2010-02-07 19:42:48 +01:00
Bernhard Reutner-Fischer
f16d7c4bdf bloat-o-meter: fix quadric behavior in alias resolution
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2010-02-07 19:26:18 +01:00
Bernhard Reutner-Fischer
659507f84e bloat-o-meter: teach it to handle aliases
Previously aliases were counted as full implementation taking up space:
setservent                                            64      55      -9
__GI_setservent                                       64      55      -9
getservent_r                                         420     319    -101
__GI_getservent_r                                    420     319    -101

Teach it to properly handle aliases.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2010-02-02 20:09:10 +01:00
Mike Frysinger
98f74034cd bloat-o-meter: touchup argv handling
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Reported-by: Matt Mackall <mpm@selenic.com>
2009-06-01 16:37:27 -04:00
Mike Frysinger
5177e28e9c bloat-o-meter: fix tab/space mixing
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-01 16:34:11 -04:00
Bernhard Reutner-Fischer
cf575ca856 - optionally pass additional flags down to nm 2008-05-23 12:53:18 +00:00
Bernhard Reutner-Fischer
7bd8d8fd26 - make Christian happy 2008-05-21 21:15:37 +00:00
Bernhard Reutner-Fischer
49bdf28c32 - skip empty lines and archive members 2008-05-21 10:32:39 +00:00
Bernhard Reutner-Fischer
45aebfd32d - bail out if either file does not exist
Avoids filling my scrollback-buffer with superfluous information ;)
2007-04-05 12:27:12 +00:00
Denis Vlasenko
2425bdce34 od: fix buglet in --traditional, microoptimization,
document coreutils bug
bloat-o-meter: account for objects in rodata too
2006-11-29 14:32:01 +00:00
Rob Landley
f14f7fc5ca Teach bloatometer about .rodata, and tweak the display into something that
has a better chance of getting merged.
2006-05-29 20:56:27 +00:00
Bernhard Reutner-Fischer
7fd9983c56 - patch from Tito to pretty print the overall delta 2006-05-26 10:29:40 +00:00
Rob Landley
712ba85b30 Tweak suggested by Matt Mackall when I submitted the bloat-o-meter changes
back to linux-kernel...
2006-05-08 18:30:33 +00:00
Rob Landley
f8a8084267 Add "make bloatcheck" to run Matt Mackall's bloat-o-meter. Copy an old
busybox_unstripped to busybox_old, build a new version, and "make bloatcheck"
to see a detailed breakdown of the size difference.
2006-05-07 19:26:53 +00:00