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

Unified Diff: mojo/devtools/common/mojo_benchmark

Issue 1391013005: Benchmark: `--save-all-traces` argument (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: benchmark Created 5 years, 2 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
« apps/benchmark/benchmark_app.cc ('K') | « apps/benchmark/run_args.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/devtools/common/mojo_benchmark
diff --git a/mojo/devtools/common/mojo_benchmark b/mojo/devtools/common/mojo_benchmark
index fc0258e09967aebbec025930fd2081c3b1ec865a..999b7b365ac2cfb807c36d2e426f208ca8528461 100755
--- a/mojo/devtools/common/mojo_benchmark
+++ b/mojo/devtools/common/mojo_benchmark
@@ -75,9 +75,8 @@ def _generate_benchmark_variants(benchmark_spec):
'shell-args': benchmark_spec.get('shell-args', [])})
return variants
-
ppi 2015/10/29 13:33:43 Keep this blank line, Python style guide wants two
nelly 2015/10/29 14:20:17 Done.
def _run_benchmark(shell, shell_args, app, duration_seconds, measurements,
- verbose, android, output_file):
+ verbose, android, output_file, trace_all):
"""Runs the given benchmark by running `benchmark.mojo` in mojo shell with
appropriate arguments and returns the produced output.
@@ -97,6 +96,9 @@ def _run_benchmark(shell, shell_args, app, duration_seconds, measurements,
else:
benchmark_args.append('--trace-output=' + output_file)
+ if trace_all:
+ benchmark_args.append('--trace-all')
+
for measurement in measurements:
benchmark_args.append(measurement['spec'])
@@ -150,6 +152,9 @@ def main():
help='a file listing benchmarks to run')
parser.add_argument('--save-traces', action='store_true',
help='save the traces produced by benchmarks to disk')
+ parser.add_argument('--trace-all', action='store_true',
+ help='trace all categories; ignored if not used with ' +
ppi 2015/10/29 13:33:43 Why ignore this if not used with --save-traces?
nelly 2015/10/29 14:20:17 With the current implementation we always print in
+ 'the `--save-traces` argument')
perf_dashboard.add_argparse_server_arguments(parser)
# Common shell configuration arguments.
@@ -179,11 +184,16 @@ def main():
measurements = variant_spec['measurements']
output_file = None
+ trace_all = False
if script_args.save_traces:
output_file = 'benchmark-%s-%s-%s.trace' % (
benchmark_name.replace(' ', '_'),
variant_name.replace(' ', '_'),
time.strftime('%Y%m%d%H%M%S'))
+ if script_args.trace_all:
+ trace_all = True
+ elif script_args.trace_all:
+ print 'warning: --trace-all argument ignored (see usage).'
chart_data_recorder = None
if script_args.upload:
@@ -192,7 +202,7 @@ def main():
benchmark_succeeded, benchmark_error, output = _run_benchmark(
shell, shell_args, app, duration, measurements, script_args.verbose,
- script_args.android, output_file)
+ script_args.android, output_file, trace_all)
print '[ %s ] %s ' % (benchmark_name, variant_name)
« apps/benchmark/benchmark_app.cc ('K') | « apps/benchmark/run_args.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698