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

Unified Diff: build/scripts/slave/chromium/sizes.py

Issue 9323047: Update sizes.py to print a list of all static initializers (Closed) Base URL: http://src.chromium.org/svn/trunk/tools/
Patch Set: '' Created 8 years, 10 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: build/scripts/slave/chromium/sizes.py
===================================================================
--- build/scripts/slave/chromium/sizes.py (revision 120366)
+++ build/scripts/slave/chromium/sizes.py (working copy)
@@ -125,7 +125,7 @@
return 66
-def check_linux_binary(target_dir, binary_name):
+def check_linux_binary(target_dir, binary_name, options):
"""Collect appropriate size information about the built Linux binary given.
Returns a tuple (result, sizes). result is the first non-zero exit
@@ -189,6 +189,17 @@
count = (size / word_size) - 2
sizes.append((binary_name + '-si', 'initializers', '', count, 'files'))
+ # For Release builds only, use dump-static-initializers.py to print the list
+ # of static initializers.
+ if count and options.target == 'Release':
+ dump_static_initializers = os.path.join(options.build_dir,
+ 'tools', 'linux',
+ 'dump-static-initializers.py')
+ result, stdout = run_process(result, [dump_static_initializers,
+ '-d', binary_file])
+ print '\n# Static initializers in %s:' % binary_file
+ print stdout
+
# Determine if the binary has the DT_TEXTREL marker.
result, stdout = run_process(result, ['readelf', '-Wd', binary_file])
if re.search(r'\bTEXTREL\b', stdout) is None:
@@ -227,7 +238,7 @@
totals = {}
for binary in binaries:
- this_result, this_sizes = check_linux_binary(target_dir, binary)
+ this_result, this_sizes = check_linux_binary(target_dir, binary, options)
if result == 0:
result = this_result
for name, identifier, totals_id, value, units in this_sizes:
« 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