OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/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 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 os.path.join(opts.destdir, 'largest-symbols.js'), 100) | 469 os.path.join(opts.destdir, 'largest-symbols.js'), 100) |
470 DumpLargestSources(symbols, | 470 DumpLargestSources(symbols, |
471 os.path.join(opts.destdir, 'largest-sources.js'), 100) | 471 os.path.join(opts.destdir, 'largest-sources.js'), 100) |
472 DumpLargestVTables(symbols, | 472 DumpLargestVTables(symbols, |
473 os.path.join(opts.destdir, 'largest-vtables.js'), 100) | 473 os.path.join(opts.destdir, 'largest-vtables.js'), 100) |
474 | 474 |
475 # TODO(andrewhayden): Switch to D3 for greater flexibility | 475 # TODO(andrewhayden): Switch to D3 for greater flexibility |
476 treemap_out = os.path.join(opts.destdir, 'webtreemap') | 476 treemap_out = os.path.join(opts.destdir, 'webtreemap') |
477 if not os.path.exists(treemap_out): | 477 if not os.path.exists(treemap_out): |
478 os.makedirs(treemap_out, 0755) | 478 os.makedirs(treemap_out, 0755) |
479 treemap_src = os.path.join('third_party', 'webtreemap', 'src', | 479 treemap_src = os.path.join('third_party', 'webtreemap', 'src') |
480 'webtreemap-gh-pages') | |
481 shutil.copy(os.path.join(treemap_src, 'COPYING'), treemap_out) | 480 shutil.copy(os.path.join(treemap_src, 'COPYING'), treemap_out) |
482 shutil.copy(os.path.join(treemap_src, 'webtreemap.js'), treemap_out) | 481 shutil.copy(os.path.join(treemap_src, 'webtreemap.js'), treemap_out) |
483 shutil.copy(os.path.join(treemap_src, 'webtreemap.css'), treemap_out) | 482 shutil.copy(os.path.join(treemap_src, 'webtreemap.css'), treemap_out) |
484 shutil.copy(os.path.join('tools', 'binary_size', 'template', 'index.html'), | 483 shutil.copy(os.path.join('tools', 'binary_size', 'template', 'index.html'), |
485 opts.destdir) | 484 opts.destdir) |
486 if opts.verbose: | 485 if opts.verbose: |
487 print 'Report saved to ' + opts.destdir + '/index.html' | 486 print 'Report saved to ' + opts.destdir + '/index.html' |
488 | 487 |
489 | 488 |
490 if __name__ == '__main__': | 489 if __name__ == '__main__': |
491 sys.exit(main()) | 490 sys.exit(main()) |
OLD | NEW |