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

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

Issue 2885073002: supersize: Move [clone] from name -> flags & rewrite Cluster() (Closed)
Patch Set: review comment 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
« no previous file with comments | « tools/binary_size/libsupersize/cluster_symbols.py ('k') | tools/binary_size/libsupersize/describe.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/binary_size/libsupersize/console.py
diff --git a/tools/binary_size/libsupersize/console.py b/tools/binary_size/libsupersize/console.py
index 0f48891fe2407ce8c69d9d7acd71f5cc12c00b6a..2a66311ae013aaa658b7d6f6dd8ee7d986c26d77 100644
--- a/tools/binary_size/libsupersize/console.py
+++ b/tools/binary_size/libsupersize/console.py
@@ -88,21 +88,17 @@ class _Session(object):
for i, size_info in enumerate(size_infos):
self._variables['size_info%d' % (i + 1)] = size_info
- def _DiffFunc(self, before=None, after=None, cluster=True, sort=True):
+ def _DiffFunc(self, before=None, after=None, sort=True):
"""Diffs two SizeInfo objects. Returns a SizeInfoDiff.
Args:
before: Defaults to first size_infos[0].
after: Defaults to second size_infos[1].
- cluster: When True (default), calls SymbolGroup.Clustered() after diffing.
- Generally reduces noise.
sort: When True (default), calls SymbolGroup.Sorted() after diffing.
"""
before = before if before is not None else self._size_infos[0]
after = after if after is not None else self._size_infos[1]
ret = diff.Diff(before, after)
- if cluster:
- ret.symbols = ret.symbols.Clustered()
if sort:
ret.symbols = ret.symbols.Sorted()
return ret
@@ -131,12 +127,12 @@ class _Session(object):
size_info = None
size_path = None
for size_info, size_path in zip(self._size_infos, self._size_paths):
- if symbol in size_info.symbols:
+ if symbol in size_info.raw_symbols:
break
else:
# If symbols is from a diff(), use its address+name to find it.
for size_info, size_path in zip(self._size_infos, self._size_paths):
- matched = size_info.symbols.WhereAddressInRange(symbol.address)
+ matched = size_info.raw_symbols.WhereAddressInRange(symbol.address)
# Use last matched symbol to skip over padding-only symbols.
if len(matched) > 0 and matched[-1].full_name == symbol.full_name:
symbol = matched[-1]
@@ -271,7 +267,7 @@ class _Session(object):
'# View per-component breakdowns, then drill into the last entry.',
'c = canned_queries.CategorizeByChromeComponent()',
'Print(c)',
- 'Print(c[-1].GroupedByPath(depth=2).Clustered().Sorted())',
+ 'Print(c[-1].GroupedByPath(depth=2).Sorted())',
'',
'# For even more inspiration, look at canned_queries.py',
'# (and feel free to add your own!).',
« no previous file with comments | « tools/binary_size/libsupersize/cluster_symbols.py ('k') | tools/binary_size/libsupersize/describe.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698