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 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 str(multiprocessing.cpu_count())) | 242 str(multiprocessing.cpu_count())) |
243 if not self.max_jobs: | 243 if not self.max_jobs: |
244 self.max_jobs = '10000' if self.use_goma else '500' | 244 self.max_jobs = '10000' if self.use_goma else '500' |
245 | 245 |
246 if os.path.exists(os.path.join(os.path.dirname(_SRC_ROOT), 'src-internal')): | 246 if os.path.exists(os.path.join(os.path.dirname(_SRC_ROOT), 'src-internal')): |
247 self.extra_gn_args_str = ' is_chrome_branded=true' | 247 self.extra_gn_args_str = ' is_chrome_branded=true' |
248 else: | 248 else: |
249 self.extra_gn_args_str = (' exclude_unwind_tables=true ' | 249 self.extra_gn_args_str = (' exclude_unwind_tables=true ' |
250 'ffmpeg_branding="Chrome" proprietary_codecs=true') | 250 'ffmpeg_branding="Chrome" proprietary_codecs=true') |
251 if self.IsLinux(): | 251 if self.IsLinux(): |
252 self.extra_gn_args_str += ' allow_posix_link_time_opt=false' | 252 self.extra_gn_args_str += ( |
| 253 ' allow_posix_link_time_opt=false generate_linker_map=true') |
253 self.target = self.target if self.IsAndroid() else 'chrome' | 254 self.target = self.target if self.IsAndroid() else 'chrome' |
254 | 255 |
255 def _GenGnCmd(self): | 256 def _GenGnCmd(self): |
256 gn_args = 'is_official_build=true symbol_level=1' | 257 gn_args = 'is_official_build=true symbol_level=1' |
257 gn_args += ' use_goma=%s' % str(self.use_goma).lower() | 258 gn_args += ' use_goma=%s' % str(self.use_goma).lower() |
258 gn_args += ' target_os="%s"' % self.target_os | 259 gn_args += ' target_os="%s"' % self.target_os |
259 if self.IsAndroid(): | 260 if self.IsAndroid(): |
260 gn_args += (' enable_chrome_android_internal=%s' % | 261 gn_args += (' enable_chrome_android_internal=%s' % |
261 str(self.enable_chrome_android_internal).lower()) | 262 str(self.enable_chrome_android_internal).lower()) |
262 gn_args += self.extra_gn_args_str | 263 gn_args += self.extra_gn_args_str |
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
811 | 812 |
812 if i != 0: | 813 if i != 0: |
813 diff_mngr.MaybeDiff(i - 1, i) | 814 diff_mngr.MaybeDiff(i - 1, i) |
814 | 815 |
815 diff_mngr.Summarize() | 816 diff_mngr.Summarize() |
816 | 817 |
817 | 818 |
818 if __name__ == '__main__': | 819 if __name__ == '__main__': |
819 sys.exit(main()) | 820 sys.exit(main()) |
820 | 821 |
OLD | NEW |