| OLD | NEW |
| 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 852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 863 nm_binary = _find_in_system_path('nm') | 863 nm_binary = _find_in_system_path('nm') |
| 864 assert nm_binary, 'Unable to find nm in the path. Use --nm-binary '\ | 864 assert nm_binary, 'Unable to find nm in the path. Use --nm-binary '\ |
| 865 'to specify location.' | 865 'to specify location.' |
| 866 | 866 |
| 867 if opts.pak: | 867 if opts.pak: |
| 868 assert os.path.isfile(opts.pak), 'Could not find ' % opts.pak | 868 assert os.path.isfile(opts.pak), 'Could not find ' % opts.pak |
| 869 | 869 |
| 870 print('addr2line: %s' % addr2line_binary) | 870 print('addr2line: %s' % addr2line_binary) |
| 871 print('nm: %s' % nm_binary) | 871 print('nm: %s' % nm_binary) |
| 872 | 872 |
| 873 CheckDebugFormatSupport(opts.library, addr2line_binary) | 873 if opts.library: |
| 874 CheckDebugFormatSupport(opts.library, addr2line_binary) |
| 874 | 875 |
| 875 symbols = GetNmSymbols(opts.nm_in, opts.nm_out, opts.library, | 876 symbols = GetNmSymbols(opts.nm_in, opts.nm_out, opts.library, |
| 876 opts.jobs, opts.verbose is True, | 877 opts.jobs, opts.verbose is True, |
| 877 addr2line_binary, nm_binary, | 878 addr2line_binary, nm_binary, |
| 878 opts.disable_disambiguation is None, | 879 opts.disable_disambiguation is None, |
| 879 opts.source_path) | 880 opts.source_path) |
| 880 | 881 |
| 881 if opts.pak: | 882 if opts.pak: |
| 882 AddPakData(symbols, opts.pak) | 883 AddPakData(symbols, opts.pak) |
| 883 | 884 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 922 shutil.copy(os.path.join(d3_src, 'LICENSE'), d3_out) | 923 shutil.copy(os.path.join(d3_src, 'LICENSE'), d3_out) |
| 923 shutil.copy(os.path.join(d3_src, 'd3.js'), d3_out) | 924 shutil.copy(os.path.join(d3_src, 'd3.js'), d3_out) |
| 924 shutil.copy(os.path.join(template_src, 'index.html'), opts.destdir) | 925 shutil.copy(os.path.join(template_src, 'index.html'), opts.destdir) |
| 925 shutil.copy(os.path.join(template_src, 'D3SymbolTreeMap.js'), opts.destdir) | 926 shutil.copy(os.path.join(template_src, 'D3SymbolTreeMap.js'), opts.destdir) |
| 926 | 927 |
| 927 print 'Report saved to ' + opts.destdir + '/index.html' | 928 print 'Report saved to ' + opts.destdir + '/index.html' |
| 928 | 929 |
| 929 | 930 |
| 930 if __name__ == '__main__': | 931 if __name__ == '__main__': |
| 931 sys.exit(main()) | 932 sys.exit(main()) |
| OLD | NEW |