Skip to content

Commit

Permalink
scripts/bloat-o-meter: Support comparing library archives
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
lorddoskias authored and torvalds committed Aug 7, 2020
1 parent 4f491bb commit 1d35b60
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scripts/bloat-o-meter
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1d35b60

Please sign in to comment.