Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Unified Diff: tools/binary_size/binary_size_utils.py

Issue 1645843004: [BinarySize] Filter duplicate lines in nm output. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Also add an OWNERS file Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/binary_size/OWNERS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/binary_size/binary_size_utils.py
diff --git a/tools/binary_size/binary_size_utils.py b/tools/binary_size/binary_size_utils.py
index 5521ba7d7e912e88db14d50c339223c4e6629850..67335c2b6d37885833bdc3781f0e681bb358d59d 100644
--- a/tools/binary_size/binary_size_utils.py
+++ b/tools/binary_size/binary_size_utils.py
@@ -35,8 +35,14 @@ def ParseNm(nm_lines):
# Match lines with no symbol name, only addr and type
addr_only_re = re.compile(r'^[0-9a-f]{8,} (.)$')
+ seen_lines = set()
for line in nm_lines:
line = line.rstrip()
+ if line in seen_lines:
+ # nm outputs identical lines at times. We don't want to treat
+ # those as distinct symbols because that would make no sense.
+ continue
+ seen_lines.add(line)
match = sym_re.match(line)
if match:
address, size, sym_type, sym = match.groups()[0:4]
« no previous file with comments | « tools/binary_size/OWNERS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698