Commit 705238a4 authored by Peter Wen's avatar Peter Wen Committed by Commit Bot

Android: Use newlines for gn args in benchmark.py

Fix for `autoninja.py` since otherwise its regex assumes use_goma is not
on.

Bug: 1092528
Change-Id: I12b53e52485ae5750a9588f57b4518a6bf495ac3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2252615
Commit-Queue: Peter Wen <wnwen@chromium.org>
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Auto-Submit: Peter Wen <wnwen@chromium.org>
Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#779938}
parent 00224a1a
......@@ -190,7 +190,9 @@ def run_benchmarks(benchmarks, gn_args, output_directory, repeat):
args_gn_path = os.path.join(out_dir, 'args.gn')
with _backup_file(args_gn_path):
with open(args_gn_path, 'w') as f:
f.write(gn_args)
# Use newlines instead of spaces since autoninja.py uses regex to
# determine whether use_goma is turned on or off.
f.write('\n'.join(gn_args))
yield f'gn gen', [_run_gn_gen(out_dir)]
for name, info in _parse_benchmarks(benchmarks):
logging.info(f'Starting {name}...')
......@@ -251,12 +253,12 @@ def main():
logging.basicConfig(
level=level, format='%(levelname).1s %(relativeCreated)6d %(message)s')
gn_args = ' '.join(_GN_ARG_PRESETS[args.args])
gn_args = _GN_ARG_PRESETS[args.args]
results = run_benchmarks(args.benchmark, gn_args, args.out_dir,
args.repeat)
print('Summary')
print(f'gn args: {gn_args}')
print(f'gn args: {" ".join(gn_args)}')
for name, result in results:
print(f'{name}: {_format_result(result)}')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment