[PATCH] bloat-o-meter - add some info on usage
Bartosz Golaszewski
bartekgola at gmail.com
Tue Sep 10 21:45:47 UTC 2013
Help message from bloat-o-meter is now more verbose, adds some info
to the documentation. Also bloat-o-meter will now bail out on more
than two filenames passed as arguments.
---
docs/keep_data_small.txt | 6 ++++++
scripts/bloat-o-meter | 9 +++++++--
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/docs/keep_data_small.txt b/docs/keep_data_small.txt
index 21d7326..7884040 100644
--- a/docs/keep_data_small.txt
+++ b/docs/keep_data_small.txt
@@ -224,6 +224,12 @@ Result (non-static busybox built against glibc):
Keeping code small
+Use scripts/bloat-o-meter to check whether introduced changes
+didn't generate unnecessary bloat. This script needs unstripped binaries
+to generate a detailed report. To automate this, just use
+"make bloatcheck" - busybox_old binary is expected to be there, so use
+"make baseline" to generate it from unmodified branch.
+
Set CONFIG_EXTRA_CFLAGS="-fno-inline-functions-called-once",
produce "make bloatcheck", see the biggest auto-inlined functions.
Now, set CONFIG_EXTRA_CFLAGS back to "", but add NOINLINE
diff --git a/scripts/bloat-o-meter b/scripts/bloat-o-meter
index 6db2a5e..3e88ca7 100755
--- a/scripts/bloat-o-meter
+++ b/scripts/bloat-o-meter
@@ -7,10 +7,13 @@
# This software may be used and distributed according to the terms
# of the GNU General Public License, incorporated herein by reference.
-import sys, os#, re
+import sys, os
def usage():
- sys.stderr.write("usage: %s [-t] file1 file2\n" % sys.argv[0])
+ sys.stderr.write("usage: %s [-t] file1 file2 [-- <readelf options>]\n"
+ % sys.argv[0])
+ sys.stderr.write(" -t\t\t- show time spent on parsing/processing\n")
+ sys.stderr.write(" --:\t\t- pass additional parameters to readelf\n")
sys.exit(-1)
f1, f2 = (None, None)
@@ -31,6 +34,8 @@ for f in sys.argv[1:]:
f1 = f
elif f2 is None:
f2 = f
+ else:
+ usage()
if flag_timing:
import time
if f1 is None or f2 is None:
--
1.7.10.4
More information about the busybox
mailing list