diff mbox series

[009/163] scripts/bloat-o-meter: Support comparing library archives

Message ID 20200807061732.dXHNntoww%akpm@linux-foundation.org
State New
Headers show
Series [001/163] mm/memory.c: avoid access flag update TLB flush for retried page fault | expand

Commit Message

Andrew Morton Aug. 7, 2020, 6:17 a.m. UTC
From: Nikolay Borisov <nborisov@suse.com>
Subject: 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

<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.

Link: http://lkml.kernel.org/r/20200603103513.3712-1-nborisov@suse.com
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

 scripts/bloat-o-meter |    2 ++
 1 file changed, 2 insertions(+)
diff mbox series


--- a/scripts/bloat-o-meter~bloat-o-meter-support-comparing-library-archives
+++ a/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