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

Side by Side Diff: build/android/resource_sizes.py

Issue 2764913002: Add optional --no-static-initializer-check to resource_sizes.py (Closed)
Patch Set: Created 3 years, 9 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 | 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/python 1 #!/usr/bin/python
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2011 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 """Prints the size of each given file and optionally computes the size of 6 """Prints the size of each given file and optionally computes the size of
7 libchrome.so without the dependencies added for building with android NDK. 7 libchrome.so without the dependencies added for building with android NDK.
8 Also breaks down the contents of the APK to determine the installed size 8 Also breaks down the contents of the APK to determine the installed size
9 and assign size contributions to different classes of file. 9 and assign size contributions to different classes of file.
10 """ 10 """
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after
729 help='Minimum byte size of displayed pak resources.') 729 help='Minimum byte size of displayed pak resources.')
730 argparser.add_argument('--chromium-output-directory', 730 argparser.add_argument('--chromium-output-directory',
731 help='Location of the build artifacts.') 731 help='Location of the build artifacts.')
732 argparser.add_argument('--chartjson', action='store_true', 732 argparser.add_argument('--chartjson', action='store_true',
733 help='Sets output mode to chartjson.') 733 help='Sets output mode to chartjson.')
734 argparser.add_argument('--output-dir', default='.', 734 argparser.add_argument('--output-dir', default='.',
735 help='Directory to save chartjson to.') 735 help='Directory to save chartjson to.')
736 argparser.add_argument('--no-output-dir', action='store_true', 736 argparser.add_argument('--no-output-dir', action='store_true',
737 help='Skip all measurements that rely on having ' 737 help='Skip all measurements that rely on having '
738 'output-dir') 738 'output-dir')
739 argparser.add_argument('--no-static-initializer-check', action='store_true',
740 help='Skip checking for static initializers')
739 argparser.add_argument('-d', '--device', 741 argparser.add_argument('-d', '--device',
740 help='Dummy option for perf runner.') 742 help='Dummy option for perf runner.')
741 argparser.add_argument('--estimate-patch-size', action='store_true', 743 argparser.add_argument('--estimate-patch-size', action='store_true',
742 help='Include patch size estimates. Useful for perf ' 744 help='Include patch size estimates. Useful for perf '
743 'builders where a reference APK is available but adds ' 745 'builders where a reference APK is available but adds '
744 '~3 mins to run time.') 746 '~3 mins to run time.')
745 argparser.add_argument('--reference-apk-builder', 747 argparser.add_argument('--reference-apk-builder',
746 default=apk_downloader.DEFAULT_BUILDER, 748 default=apk_downloader.DEFAULT_BUILDER,
747 help='Builder name to use for reference APK for patch ' 749 help='Builder name to use for reference APK for patch '
748 'size estimates.') 750 'size estimates.')
(...skipping 16 matching lines...) Expand all
765 else: 767 else:
766 tools_prefix = '' 768 tools_prefix = ''
767 769
768 PrintApkAnalysis(args.apk, tools_prefix, chartjson=chartjson) 770 PrintApkAnalysis(args.apk, tools_prefix, chartjson=chartjson)
769 _PrintDexAnalysis(args.apk, chartjson=chartjson) 771 _PrintDexAnalysis(args.apk, chartjson=chartjson)
770 if args.estimate_patch_size: 772 if args.estimate_patch_size:
771 _PrintPatchSizeEstimate( 773 _PrintPatchSizeEstimate(
772 args.apk, args.builder, args.bucket, chartjson=chartjson) 774 args.apk, args.builder, args.bucket, chartjson=chartjson)
773 if not args.no_output_dir: 775 if not args.no_output_dir:
774 PrintPakAnalysis(args.apk, args.min_pak_resource_size) 776 PrintPakAnalysis(args.apk, args.min_pak_resource_size)
775 _PrintStaticInitializersCountFromApk( 777 if not args.no_static_initializer_check:
jbudorick 2017/03/22 15:59:36 nit: this may be easier to read if the variable is
agrieve 2017/03/23 14:43:23 Done.
776 args.apk, tools_prefix, chartjson=chartjson) 778 _PrintStaticInitializersCountFromApk(
779 args.apk, tools_prefix, chartjson=chartjson)
777 if chartjson: 780 if chartjson:
778 results_path = os.path.join(args.output_dir, 'results-chart.json') 781 results_path = os.path.join(args.output_dir, 'results-chart.json')
779 logging.critical('Dumping json to %s', results_path) 782 logging.critical('Dumping json to %s', results_path)
780 with open(results_path, 'w') as json_file: 783 with open(results_path, 'w') as json_file:
781 json.dump(chartjson, json_file) 784 json.dump(chartjson, json_file)
782 785
783 786
784 if __name__ == '__main__': 787 if __name__ == '__main__':
785 sys.exit(main()) 788 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698