Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2017 The Chromium Authors. All rights reserved. | 2 # Copyright 2017 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 """Tool for finding the cause of binary size bloat. | 6 """Tool for finding the cause of binary size bloat. |
| 7 | 7 |
| 8 See //tools/binary_size/README.md for example usage. | 8 See //tools/binary_size/README.md for example usage. |
| 9 | 9 |
| 10 Note: this tool will perform gclient sync/git checkout on your local repo if | 10 Note: this tool will perform gclient sync/git checkout on your local repo if |
| (...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 748 help='GN APK target to build. Ignored for Linux. ' | 748 help='GN APK target to build. Ignored for Linux. ' |
| 749 'Default %s.' % _DEFAULT_ANDROID_TARGET) | 749 'Default %s.' % _DEFAULT_ANDROID_TARGET) |
| 750 if len(sys.argv) == 1: | 750 if len(sys.argv) == 1: |
| 751 parser.print_help() | 751 parser.print_help() |
| 752 sys.exit() | 752 sys.exit() |
| 753 args = parser.parse_args() | 753 args = parser.parse_args() |
| 754 log_level = logging.DEBUG if args.verbose else logging.INFO | 754 log_level = logging.DEBUG if args.verbose else logging.INFO |
| 755 logging.basicConfig(level=log_level, | 755 logging.basicConfig(level=log_level, |
| 756 format='%(levelname).1s %(relativeCreated)6d %(message)s') | 756 format='%(levelname).1s %(relativeCreated)6d %(message)s') |
| 757 build = _BuildHelper(args) | 757 build = _BuildHelper(args) |
| 758 if build.IsCloud() and args.subrepo: | 758 if build.IsCloud(): |
| 759 if args.subrepo: | |
| 759 parser.error('--subrepo doesn\'t work with --cloud') | 760 parser.error('--subrepo doesn\'t work with --cloud') |
| 761 if build.IsLinux(): | |
| 762 parser.error('--target-os linux doesn\'t work with --cloud') | |
|
agrieve
2017/05/16 00:26:00
nit: Maybe just add a comment saying that it doesn
estevenson
2017/05/16 20:08:46
Done.
| |
| 763 | |
| 760 | 764 |
| 761 subrepo = args.subrepo or _SRC_ROOT | 765 subrepo = args.subrepo or _SRC_ROOT |
| 762 _EnsureDirectoryClean(subrepo) | 766 _EnsureDirectoryClean(subrepo) |
| 763 _SetRestoreFunc(subrepo) | 767 _SetRestoreFunc(subrepo) |
| 764 if build.IsLinux(): | 768 if build.IsLinux(): |
| 765 _VerifyUserAccepts('Linux diffs have known deficiencies (crbug/717550).') | 769 _VerifyUserAccepts('Linux diffs have known deficiencies (crbug/717550).') |
| 766 | 770 |
| 767 rev, reference_rev = _ValidateRevs( | 771 rev, reference_rev = _ValidateRevs( |
| 768 args.rev, args.reference_rev or args.rev + '^', subrepo) | 772 args.rev, args.reference_rev or args.rev + '^', subrepo) |
| 769 revs = _GenerateRevList(rev, reference_rev, args.all, subrepo) | 773 revs = _GenerateRevList(rev, reference_rev, args.all, subrepo) |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 802 | 806 |
| 803 if i != 0: | 807 if i != 0: |
| 804 diff_mngr.MaybeDiff(i - 1, i) | 808 diff_mngr.MaybeDiff(i - 1, i) |
| 805 | 809 |
| 806 diff_mngr.Summarize() | 810 diff_mngr.Summarize() |
| 807 | 811 |
| 808 | 812 |
| 809 if __name__ == '__main__': | 813 if __name__ == '__main__': |
| 810 sys.exit(main()) | 814 sys.exit(main()) |
| 811 | 815 |
| OLD | NEW |