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

Side by Side Diff: tools/binary_size/libsupersize/describe.py

Issue 2856203004: supersize: Fix name normalization of top-level lambdas (Closed)
Patch Set: rebase 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 unified diff | Download patch
« no previous file with comments | « no previous file | tools/binary_size/libsupersize/function_signature.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2017 The Chromium Authors. All rights reserved. 1 # Copyright 2017 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 """Methods for converting model objects to human-readable formats.""" 4 """Methods for converting model objects to human-readable formats."""
5 5
6 import datetime 6 import datetime
7 import itertools 7 import itertools
8 import time 8 import time
9 9
10 import models 10 import models
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 for l in self._DescribeSymbolGroupChildren(s, indent=indent + 1): 119 for l in self._DescribeSymbolGroupChildren(s, indent=indent + 1):
120 yield l 120 yield l
121 121
122 def _DescribeSymbolGroup(self, group): 122 def _DescribeSymbolGroup(self, group):
123 total_size = group.pss 123 total_size = group.pss
124 code_syms = group.WhereInSection('t') 124 code_syms = group.WhereInSection('t')
125 code_size = code_syms.pss 125 code_size = code_syms.pss
126 ro_size = code_syms.Inverted().WhereInSection('r').pss 126 ro_size = code_syms.Inverted().WhereInSection('r').pss
127 unique_paths = set(s.object_path for s in group) 127 unique_paths = set(s.object_path for s in group)
128 header_desc = [ 128 header_desc = [
129 'Showing {:,} symbols with total pss: {} bytes'.format( 129 'Showing {:,} symbols ({:,} unique) with total pss: {} bytes'.format(
130 len(group), int(total_size)), 130 len(group), group.CountUniqueSymbols(), int(total_size)),
131 '.text={:<10} .rodata={:<10} other={:<10} total={}'.format( 131 '.text={:<10} .rodata={:<10} other={:<10} total={}'.format(
132 _PrettySize(int(code_size)), _PrettySize(int(ro_size)), 132 _PrettySize(int(code_size)), _PrettySize(int(ro_size)),
133 _PrettySize(int(total_size - code_size - ro_size)), 133 _PrettySize(int(total_size - code_size - ro_size)),
134 _PrettySize(int(total_size))), 134 _PrettySize(int(total_size))),
135 'Number of object files: {}'.format(len(unique_paths)), 135 'Number of object files: {}'.format(len(unique_paths)),
136 '', 136 '',
137 'First columns are: running total, address, pss', 137 'First columns are: running total, address, pss',
138 ] 138 ]
139 children_desc = self._DescribeSymbolGroupChildren(group) 139 children_desc = self._DescribeSymbolGroupChildren(group)
140 return itertools.chain(header_desc, children_desc) 140 return itertools.chain(header_desc, children_desc)
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 291
292 def GenerateLines(obj, verbose=False, recursive=False): 292 def GenerateLines(obj, verbose=False, recursive=False):
293 """Returns an iterable of lines (without \n) that describes |obj|.""" 293 """Returns an iterable of lines (without \n) that describes |obj|."""
294 return Describer(verbose=verbose, recursive=recursive).GenerateLines(obj) 294 return Describer(verbose=verbose, recursive=recursive).GenerateLines(obj)
295 295
296 296
297 def WriteLines(lines, func): 297 def WriteLines(lines, func):
298 for l in lines: 298 for l in lines:
299 func(l) 299 func(l)
300 func('\n') 300 func('\n')
OLDNEW
« no previous file with comments | « no previous file | tools/binary_size/libsupersize/function_signature.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698