linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RESEND PATCH] bloat-o-meter: Support comparing library archives
@ 2020-06-03 10:35 Nikolay Borisov
  0 siblings, 0 replies; only message in thread
From: Nikolay Borisov @ 2020-06-03 10:35 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel, linux, Nikolay Borisov

Library archives (.a) usually contain multiple object files so their
output of nm --size-sort contains lines like:

<ommitted for brevity>
00000000000003a8 t run_test

extent-map-tests.o:
<ommitted 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 <nborisov@suse.com>
---

Resending and CCing Andrew this time.

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

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 @@ re_NUMBER = re.compile(r'\.[0-9]+')
     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
--
2.17.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-06-03 10:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-03 10:35 [RESEND PATCH] bloat-o-meter: Support comparing library archives Nikolay Borisov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).