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

Unified Diff: infra/scripts/legacy/scripts/slave/chromium/sizes.py

Issue 2163373008: [Mac/GN] Update sizes.py to use unstripped build output for reporting static initializers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: infra/scripts/legacy/scripts/slave/chromium/sizes.py
diff --git a/infra/scripts/legacy/scripts/slave/chromium/sizes.py b/infra/scripts/legacy/scripts/slave/chromium/sizes.py
index 8a61840a1ef18cff8e65b95a8d2bb3b04f549201..d5a1169d731eace0f9f1840fd9c3a1ca54c4aff5 100755
--- a/infra/scripts/legacy/scripts/slave/chromium/sizes.py
+++ b/infra/scripts/legacy/scripts/slave/chromium/sizes.py
@@ -101,6 +101,7 @@ def main_mac(options, args, results_collector):
framework_name = base_name + ' Framework'
framework_bundle = framework_name + '.framework'
framework_dsym_bundle = framework_bundle + '.dSYM'
+ framework_unstripped_name = framework_name + '.unstripped'
chromium_app_dir = os.path.join(target_dir, app_bundle)
chromium_executable = os.path.join(chromium_app_dir,
@@ -115,6 +116,8 @@ def main_mac(options, args, results_collector):
chromium_framework_dsym = os.path.join(chromium_framework_dsym_dir,
'Contents', 'Resources', 'DWARF',
framework_name)
+ chromium_framework_unstripped = os.path.join(target_dir,
+ framework_unstripped_name)
if os.path.exists(chromium_executable):
print_dict = {
# Remove spaces in the names so any downstream processing is less
@@ -167,14 +170,33 @@ def main_mac(options, args, results_collector):
# For Release builds only, use dump-static-initializers.py to print the
# list of static initializers.
if si_count > 0 and options.target == 'Release':
- dump_static_initializers = os.path.join(
- os.path.dirname(build_dir), 'tools', 'mac',
- 'dump-static-initializers.py')
- result, stdout = run_process(result, [dump_static_initializers,
- chromium_framework_dsym])
print '\n# Static initializers in %s:' % chromium_framework_executable
- print_si_fail_hint('tools/mac/dump-static-initializers.py')
- print stdout
+
+ # First look for a dSYM to get information about the initializers. If
+ # one is not present, check if there is an unstripped copy of the build
+ # output.
+ mac_tools_path = os.path.join(os.path.dirname(build_dir),
+ 'tools', 'mac')
+ if os.path.exists(chromium_framework_dsym):
+ dump_static_initializers = os.path.join(
+ mac_tools_path, 'dump-static-initializers.py')
+ result, stdout = run_process(result, [dump_static_initializers,
+ chromium_framework_dsym])
+ print_si_fail_hint('tools/mac/dump-static-initializers.py')
+ print stdout
+ else:
+ show_mod_init_func = os.path.join(
+ mac_tools_path, 'show_mod_init_func.py')
+ args = [show_mod_init_func]
+ if os.path.exists(chromium_framework_unstripped):
+ args.append(chromium_framework_unstripped)
+ else:
+ print '# Warning: Falling back to potentially stripped output.'
+ args.append(chromium_framework_executable)
+ result, stdout = run_process(result, args)
+ print_si_fail_hint('tools/mac/show_mod_init_func.py')
+ print stdout
+
results_collector.add_result(
print_dict['app_name'], print_dict['app_name'],
« 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