[PATCH] bloat-o-meter - add some info on usage

Bartosz Golaszewski bartekgola at gmail.com
Sun Sep 22 19:02:15 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.

Signed-off-by: Bartosz Golaszewski <bartekgola at gmail.com>
---
 docs/keep_data_small.txt |    6 ++++++
 scripts/bloat-o-meter    |   11 ++++++++---
 2 files changed, 14 insertions(+), 3 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..94c9498 100755
--- a/scripts/bloat-o-meter
+++ b/scripts/bloat-o-meter
@@ -7,11 +7,14 @@
 # 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.exit(-1)
+    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)
 flag_timing, dashes = (False, False)
@@ -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