Have BuildStats use Flutter's stripped lib

That's what their treemap says and we should try to match it.

Bug: skia:
Change-Id: Iefa95c0440eb6b45a94a72c1beffb8a1199152a4
Reviewed-on: https://skia-review.googlesource.com/c/161825
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
This commit is contained in:
Kevin Lubick 2018-10-12 16:58:52 -04:00 committed by Skia Commit-Bot
parent 5d87892d2c
commit 3655e4059e
9 changed files with 94 additions and 18 deletions

View File

@ -13,11 +13,16 @@ import sys
def main():
input_file = sys.argv[1]
# This should be the stripped file from
# out/android_release/lib.stripped/libflutter.so
stripped_file = sys.argv[1]
out_dir = sys.argv[2]
keystr = sys.argv[3]
propstr = sys.argv[4]
bloaty_path = sys.argv[5]
# This is the unstripped out/android_release/libflutter.so
# The symbols in it are needed to get the compileunits data.
symbols_file = sys.argv[6]
results = {
'key': { },
@ -37,29 +42,33 @@ def main():
# Human "readable" reports as an FYI.
print magic_seperator
print 'Report by file, then by symbol with ellided/combined templates'
lines = subprocess.check_output([bloaty_path, input_file,
lines = subprocess.check_output([bloaty_path, stripped_file,
'-d', 'compileunits,symbols', '-s', 'file',
'-n', '0', '--tsv', '--demangle=short'])
'-n', '0', '--tsv', '--demangle=short',
'--debug-file=%s' % symbols_file])
grand_total = print_skia_lines_file_symbol(lines)
print magic_seperator
print 'Report by file, then by symbol with full templates'
lines = subprocess.check_output([bloaty_path, input_file,
lines = subprocess.check_output([bloaty_path, stripped_file,
'-d', 'compileunits,symbols', '-s', 'file',
'-n', '0', '--tsv', '--demangle=full'])
'-n', '0', '--tsv', '--demangle=full',
'--debug-file=%s' % symbols_file])
print_skia_lines_file_symbol(lines)
print magic_seperator
print 'Report by symbol, then by file with ellided/combined templates'
lines = subprocess.check_output([bloaty_path, input_file,
lines = subprocess.check_output([bloaty_path, stripped_file,
'-d', 'symbols,compileunits', '-s', 'file',
'-n', '0', '--tsv', '--demangle=short'])
'-n', '0', '--tsv', '--demangle=short',
'--debug-file=%s' % symbols_file])
print_skia_lines_symbol_file(lines)
print magic_seperator
print 'Report by symbol, then by file with full templates'
lines = subprocess.check_output([bloaty_path, input_file,
lines = subprocess.check_output([bloaty_path, stripped_file,
'-d', 'symbols,compileunits', '-s', 'file',
'-n', '0', '--tsv', '--demangle=full'])
'-n', '0', '--tsv', '--demangle=full',
'--debug-file=%s' % symbols_file])
print_skia_lines_symbol_file(lines)
print magic_seperator
@ -70,7 +79,7 @@ def main():
},
}
name = os.path.basename(input_file)
name = 'libflutter.so'
results['results'][name] = r
# Make debugging easier

View File

@ -613,6 +613,10 @@ func defaultSwarmDimensions(parts map[string]string) []string {
// machines (after Aug 2018).
return linuxGceDimensions(MACHINE_TYPE_MEDIUM)
}
if parts["role"] == "BuildStats" {
// Doesn't require a lot of resources
return linuxGceDimensions(MACHINE_TYPE_MEDIUM)
}
// Use many-core machines for Build tasks.
return linuxGceDimensions(MACHINE_TYPE_LARGE)
} else if d["os"] == DEFAULT_OS_WIN {

View File

@ -78,6 +78,28 @@
"@@@STEP_LOG_END@python.inline@@@"
]
},
{
"cmd": [
"python",
"-u",
"\nimport shutil\nimport sys\n\nsrc = sys.argv[1]\ndst = sys.argv[2]\n\nshutil.copyfile(src, dst)\n",
"[START_DIR]/cache/work/skia/out/Build-Debian9-Clang-arm-Release-Flutter_Android/Release/lib.stripped/libflutter.so",
"[START_DIR]/[SWARM_OUT_DIR]/out/Release/libflutter_stripped.so"
],
"infra_step": true,
"name": "copy stripped library",
"~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@import shutil@@@",
"@@@STEP_LOG_LINE@python.inline@import sys@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@src = sys.argv[1]@@@",
"@@@STEP_LOG_LINE@python.inline@dst = sys.argv[2]@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@shutil.copyfile(src, dst)@@@",
"@@@STEP_LOG_END@python.inline@@@"
]
},
{
"name": "$result",
"recipe_result": null,

View File

@ -33,4 +33,18 @@ def compile_fn(api, checkout_root, out_dir):
def copy_extra_build_products(api, src, dst):
pass
stripped_src = src.join('lib.stripped', 'libflutter.so')
stripped_dst = dst.join('libflutter_stripped.so')
api.python.inline(
name='copy stripped library',
program='''
import shutil
import sys
src = sys.argv[1]
dst = sys.argv[2]
shutil.copyfile(src, dst)
''',
args=[stripped_src, stripped_dst],
infra_step=True)

View File

@ -222,6 +222,28 @@
"@@@STEP_LOG_END@python.inline@@@"
]
},
{
"cmd": [
"python",
"-u",
"\nimport shutil\nimport sys\n\nsrc = sys.argv[1]\ndst = sys.argv[2]\n\nshutil.copyfile(src, dst)\n",
"[START_DIR]/cache/work/flutter/src/out/android_release/lib.stripped/libflutter.so",
"[START_DIR]/[SWARM_OUT_DIR]/libflutter_stripped.so"
],
"infra_step": true,
"name": "copy stripped library",
"~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@import shutil@@@",
"@@@STEP_LOG_LINE@python.inline@import sys@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@src = sys.argv[1]@@@",
"@@@STEP_LOG_LINE@python.inline@dst = sys.argv[2]@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@shutil.copyfile(src, dst)@@@",
"@@@STEP_LOG_END@python.inline@@@"
]
},
{
"name": "$result",
"recipe_result": null,

View File

@ -274,11 +274,12 @@
"python",
"-u",
"[START_DIR]/cache/work/skia/infra/bots/buildstats/buildstats_flutter.py",
"[START_DIR]/build/libflutter.so",
"[START_DIR]/build/libflutter_stripped.so",
"[START_DIR]/[SWARM_OUT_DIR]",
"compiler EMCC configuration Release extra_config PathKit os Debian9 target_arch wasm",
"gitHash abc123 swarming_bot_id skia-bot-123 swarming_task_id 123456abc",
"[START_DIR]/bloaty/bloaty"
"[START_DIR]/bloaty/bloaty",
"[START_DIR]/build/libflutter.so"
],
"cwd": "[START_DIR]/cache/work/skia",
"env": {

View File

@ -318,11 +318,12 @@
"python",
"-u",
"[START_DIR]/cache/work/skia/infra/bots/buildstats/buildstats_flutter.py",
"[START_DIR]/build/libflutter.so",
"[START_DIR]/build/libflutter_stripped.so",
"[START_DIR]/[SWARM_OUT_DIR]",
"compiler EMCC configuration Release extra_config PathKit os Debian9 target_arch wasm",
"gitHash abc123 swarming_bot_id skia-bot-123 swarming_task_id 123456abc issue 456789 patchset 12 patch_storage gerrit",
"[START_DIR]/bloaty/bloaty"
"[START_DIR]/bloaty/bloaty",
"[START_DIR]/build/libflutter.so"
],
"cwd": "[START_DIR]/cache/work/skia",
"env": {

View File

@ -136,12 +136,15 @@ def analyze_flutter_lib(api, checkout_root, out_dir, files):
bloaty_exe = api.path['start_dir'].join('bloaty', 'bloaty')
for f in files:
skia_dir = checkout_root.join('skia')
with api.context(cwd=skia_dir):
stripped = api.vars.build_dir.join('libflutter_stripped.so')
script = skia_dir.join('infra', 'bots', 'buildstats',
'buildstats_flutter.py')
step_data = api.run(api.python, 'Analyze flutter', script=script,
args=[f, out_dir, keystr, propstr, bloaty_exe],
args=[stripped, out_dir, keystr, propstr, bloaty_exe,
f],
stdout=api.raw_io.output())
if step_data and step_data.stdout:
magic_seperator = '#$%^&*'

View File

@ -17282,7 +17282,7 @@
"dimensions": [
"cpu:x86-64-Haswell_GCE",
"gpu:none",
"machine_type:n1-highcpu-64",
"machine_type:n1-standard-16",
"os:Debian-9.4",
"pool:Skia"
],
@ -17383,7 +17383,7 @@
"dimensions": [
"cpu:x86-64-Haswell_GCE",
"gpu:none",
"machine_type:n1-highcpu-64",
"machine_type:n1-standard-16",
"os:Debian-9.4",
"pool:Skia"
],