diff options
authorNikolay Borisov <>2020-08-06 23:17:32 -0700
committerLinus Torvalds <>2020-08-07 11:33:21 -0700
commit1d35b6054a9b94b48511e23a7fab6cd1dbf3fde6 (patch)
parent4f491bb6ea2aef2f5b184f385904a73796d98554 (diff)
scripts/bloat-o-meter: Support comparing library archives
Library archives (.a) usually contain multiple object files so their output of nm --size-sort contains lines like: <omitted for brevity> 00000000000003a8 t run_test extent-map-tests.o: <omitted for brevity> bloat-o-meter currently doesn't handle them which results in errors when calling .split() on them. Fix this by simply ignoring them. This enables diffing subsystems which generate built-in.a files. Signed-off-by: Nikolay Borisov <> Signed-off-by: Andrew Morton <> Link: Signed-off-by: Linus Torvalds <>
1 files changed, 2 insertions, 0 deletions
diff --git a/scripts/bloat-o-meter b/scripts/bloat-o-meter
index 8c965f6a9881..d7ca46c612b3 100755
--- a/scripts/bloat-o-meter
+++ b/scripts/bloat-o-meter
@@ -26,6 +26,8 @@ def getsizes(file, format):
sym = {}
with os.popen("nm --size-sort " + file) as f:
for line in f:
+ if line.startswith("\n") or ":" in line:
+ continue
size, type, name = line.split()
if type in format:
# strip generated symbols