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

Unified Diff: tools/binary_size/libsupersize/file_format.py

Issue 2870743003: supersize: Add symbol.template_name, and strip <>s from symbol.name (Closed)
Patch Set: canned query Created 3 years, 7 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
Index: tools/binary_size/libsupersize/file_format.py
diff --git a/tools/binary_size/libsupersize/file_format.py b/tools/binary_size/libsupersize/file_format.py
index 63c44b604b223a6d19a4f79a859dfa29d8f01bce..c13f4d3b65b0bea8ad1297372a2f62c88282e919 100644
--- a/tools/binary_size/libsupersize/file_format.py
+++ b/tools/binary_size/libsupersize/file_format.py
@@ -53,8 +53,8 @@ def _SaveSizeInfoToFile(size_info, file_obj):
_LogSize(file_obj, 'paths') # For libchrome, adds 200kb.
# Symbol counts by section.
- by_section = size_info.symbols.GroupBySectionName().Sorted(
- key=lambda s:(s[0].IsBss(), s[0].address, s.name))
+ by_section = size_info.symbols.GroupedBySectionName().Sorted(
+ key=lambda s:(s[0].IsBss(), s[0].address, s.full_name))
file_obj.write('%s\n' % '\t'.join(g.name for g in by_section))
file_obj.write('%s\n' % '\t'.join(str(len(g)) for g in by_section))
@@ -83,8 +83,7 @@ def _SaveSizeInfoToFile(size_info, file_obj):
prev_aliases = None
for group in by_section:
for symbol in group:
- # Do not write name when full_name exists. It will be derived on load.
- file_obj.write(symbol.full_name or symbol.name)
+ file_obj.write(symbol.full_name)
if symbol.aliases and symbol.aliases is not prev_aliases:
file_obj.write('\t0%x' % symbol.num_aliases)
prev_aliases = symbol.aliases
@@ -151,7 +150,7 @@ def _LoadSizeInfoFromFile(file_obj):
else:
flags_part = parts[1]
- name = parts[0]
+ full_name = parts[0]
flags = int(flags_part, 16) if flags_part else 0
num_aliases = int(aliases_part, 16) if aliases_part else 0
@@ -159,13 +158,14 @@ def _LoadSizeInfoFromFile(file_obj):
new_sym.section_name = cur_section_name
new_sym.address = addresses[section_index][i]
new_sym.size = sizes[section_index][i]
- new_sym.name = name
+ new_sym.full_name = full_name
paths = path_tuples[path_indices[section_index][i]]
new_sym.object_path = paths[0]
new_sym.source_path = paths[1]
new_sym.flags = flags
new_sym.padding = 0 # Derived
- new_sym.full_name = None # Derived
+ new_sym.template_name = '' # Derived
+ new_sym.name = '' # Derived
if num_aliases:
assert alias_counter == 0
@@ -181,8 +181,7 @@ def _LoadSizeInfoFromFile(file_obj):
raw_symbols[symbol_idx] = new_sym
symbol_idx += 1
- return models.SizeInfo(section_sizes, models.SymbolGroup(raw_symbols),
- metadata=metadata)
+ return models.SizeInfo(section_sizes, raw_symbols, metadata=metadata)
def SaveSizeInfo(size_info, path):

Powered by Google App Engine
This is Rietveld 408576698