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

Side by Side Diff: tools/binary_size/run_binary_size_analysis.py

Issue 296003007: Added PRESUBMIT.py for binary_size tools. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@andrew_binary_size
Patch Set: Addressed review comments. Created 6 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 | « tools/binary_size/explain_binary_size_delta_unittest.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2014 The Chromium Authors. All rights reserved. 2 # Copyright 2014 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Generate a spatial analysis against an arbitrary library. 6 """Generate a spatial analysis against an arbitrary library.
7 7
8 To use, build the 'binary_size_tool' target. Then run this tool, passing 8 To use, build the 'binary_size_tool' target. Then run this tool, passing
9 in the location of the library to be analyzed along with any other options 9 in the location of the library to be analyzed along with any other options
10 you desire. 10 you desire.
(...skipping 18 matching lines...) Expand all
29 # the chromium project has figured out a proper way to organize the 29 # the chromium project has figured out a proper way to organize the
30 # library of python tools. http://crbug.com/375725 30 # library of python tools. http://crbug.com/375725
31 elf_symbolizer_path = os.path.abspath(os.path.join( 31 elf_symbolizer_path = os.path.abspath(os.path.join(
32 os.path.dirname(__file__), 32 os.path.dirname(__file__),
33 '..', 33 '..',
34 '..', 34 '..',
35 'build', 35 'build',
36 'android', 36 'android',
37 'pylib')) 37 'pylib'))
38 sys.path.append(elf_symbolizer_path) 38 sys.path.append(elf_symbolizer_path)
39 import symbols.elf_symbolizer as elf_symbolizer 39 import symbols.elf_symbolizer as elf_symbolizer # pylint: disable=F0401
40 40
41 41
42 # TODO(andrewhayden): Only used for legacy reports. Delete. 42 # TODO(andrewhayden): Only used for legacy reports. Delete.
43 def FormatBytes(byte_count): 43 def FormatBytes(byte_count):
44 """Pretty-print a number of bytes.""" 44 """Pretty-print a number of bytes."""
45 if byte_count > 1e6: 45 if byte_count > 1e6:
46 byte_count = byte_count / 1.0e6 46 byte_count = byte_count / 1.0e6
47 return '%.1fm' % byte_count 47 return '%.1fm' % byte_count
48 if byte_count > 1e3: 48 if byte_count > 1e3:
49 byte_count = byte_count / 1.0e3 49 byte_count = byte_count / 1.0e3
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after
681 print('Copying index.html') 681 print('Copying index.html')
682 shutil.copy(os.path.join(template_src, 'index.html'), opts.destdir) 682 shutil.copy(os.path.join(template_src, 'index.html'), opts.destdir)
683 shutil.copy(os.path.join(template_src, 'D3SymbolTreeMap.js'), opts.destdir) 683 shutil.copy(os.path.join(template_src, 'D3SymbolTreeMap.js'), opts.destdir)
684 684
685 if opts.verbose: 685 if opts.verbose:
686 print 'Report saved to ' + opts.destdir + '/index.html' 686 print 'Report saved to ' + opts.destdir + '/index.html'
687 687
688 688
689 if __name__ == '__main__': 689 if __name__ == '__main__':
690 sys.exit(main()) 690 sys.exit(main())
OLDNEW
« no previous file with comments | « tools/binary_size/explain_binary_size_delta_unittest.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698