minify_tool: Fix benchmark output and rename parameter
Remove "-Total" from the output, which was inadvertently kept when
copying code from test_framework.py.
Change `--print-runtimeraw` argument to `--benchmark-name` for
minify_tool.py and simply `--name` for run_bootstrap_benchmark.py
to make it more clear that the argument expected is the name of the
benchmark.
Change-Id: Ibd13a16160dbfc84ce201d008bb77d03d3d4dd9a
diff --git a/tools/minify_tool.py b/tools/minify_tool.py
index 08b2ada..787c1e1 100755
--- a/tools/minify_tool.py
+++ b/tools/minify_tool.py
@@ -9,6 +9,9 @@
Given an input JAR (default: r8.jar) and a main-class, generates a new input JAR
with the given main-class in the manifest along with a -keep rule for keeping
just the main entrypoint, and runs R8 in release+classfile mode on the JAR.
+
+If --benchmark-name NAME is given, prints "<NAME>(RunTimeRaw): <elapsed> ms"
+to standard output at the end of the run.
'''
import argparse
@@ -44,8 +47,8 @@
'-O', '--no-debug', dest='debug', action='store_false',
help='Disable assertions when running R8')
parser.add_argument(
- '--print-runtimeraw', metavar='BENCHMARKNAME',
- help='Print "<BENCHMARKNAME>(RunTimeRaw): <elapsed> ms" at the end')
+ '--benchmark-name',
+ help='Print benchmarks with the given name')
def generate_output_name(input_jar, mainclass):
if not mainclass:
@@ -83,7 +86,7 @@
return mo.group(1)
def minify_tool(mainclass=None, input_jar=utils.R8_JAR, output_jar=None, lib=RT,
- debug=True, build=True, print_runtimeraw=None):
+ debug=True, build=True, benchmark_name=None):
if output_jar is None:
output_jar = generate_output_name(input_jar, mainclass)
with utils.TempDir() as path:
@@ -104,9 +107,9 @@
tmp_input_path)
start_time = time.time()
return_code = toolhelper.run('r8', args, debug=debug, build=build)
- if print_runtimeraw:
+ if benchmark_name:
elapsed_ms = 1000 * (time.time() - start_time)
- print('%s-Total(RunTimeRaw): %s ms' % (print_runtimeraw, elapsed_ms))
+ print('%s(RunTimeRaw): %s ms' % (benchmark_name, elapsed_ms))
return return_code
if __name__ == '__main__':