[tools] Improve run_perf.py
- Mark run_perf.py executable - Add more user-friendly option --d8-path aliase - Add --repeat alias that matches the go/crossbench flag - Handle symlinks for d8-directory using pathlib - Only print timeout message if the result has timed_out == True - Add .DS_Store to gitignore Change-Id: Ia0fb0b926632af4b520d3aaf447e5bd35723816e Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4205910 Commit-Queue: Camillo Bruni <cbruni@chromium.org> Reviewed-by: Alexander Schulze <alexschulze@chromium.org> Cr-Commit-Position: refs/heads/main@{#85555}
This commit is contained in:
parent
fcce324c4e
commit
1cf624ba03
1
.gitignore
vendored
1
.gitignore
vendored
@ -28,6 +28,7 @@
|
|||||||
.clangd
|
.clangd
|
||||||
.cpplint-cache
|
.cpplint-cache
|
||||||
.cproject
|
.cproject
|
||||||
|
.DS_Store
|
||||||
.gclient_entries
|
.gclient_entries
|
||||||
.gdb_history
|
.gdb_history
|
||||||
.idea
|
.idea
|
||||||
|
32
tools/run_perf.py
Normal file → Executable file
32
tools/run_perf.py
Normal file → Executable file
@ -127,6 +127,7 @@ import json
|
|||||||
import logging
|
import logging
|
||||||
import math
|
import math
|
||||||
import argparse
|
import argparse
|
||||||
|
import pathlib
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
@ -787,6 +788,7 @@ class Platform(object):
|
|||||||
if output.stderr: # pragma: no cover
|
if output.stderr: # pragma: no cover
|
||||||
# Print stderr for debugging.
|
# Print stderr for debugging.
|
||||||
logging.info(title % 'Stderr' + '\n%s', output.stderr)
|
logging.info(title % 'Stderr' + '\n%s', output.stderr)
|
||||||
|
if output.HasTimedOut():
|
||||||
logging.warning('>>> Test timed out after %ss.', runnable.timeout)
|
logging.warning('>>> Test timed out after %ss.', runnable.timeout)
|
||||||
if output.exit_code != 0:
|
if output.exit_code != 0:
|
||||||
logging.warning('>>> Test crashed with exit code %d.', output.exit_code)
|
logging.warning('>>> Test crashed with exit code %d.', output.exit_code)
|
||||||
@ -1076,10 +1078,12 @@ def Main(argv):
|
|||||||
parser.add_argument('--outdir-secondary',
|
parser.add_argument('--outdir-secondary',
|
||||||
help='Base directory with compile output without patch '
|
help='Base directory with compile output without patch '
|
||||||
'or for reference build')
|
'or for reference build')
|
||||||
parser.add_argument('--binary-override-path',
|
parser.add_argument(
|
||||||
help='JavaScript engine binary. By default, d8 under '
|
'--binary-override-path',
|
||||||
'architecture-specific build dir. '
|
'--d8-path',
|
||||||
'Not supported in conjunction with outdir-secondary.')
|
help='JavaScript engine binary. By default, d8 under '
|
||||||
|
'architecture-specific build dir. '
|
||||||
|
'Not supported in conjunction with outdir-secondary.')
|
||||||
parser.add_argument('--prioritize',
|
parser.add_argument('--prioritize',
|
||||||
help='Raise the priority to nice -20 for the '
|
help='Raise the priority to nice -20 for the '
|
||||||
'benchmarking process.Requires Linux, schedtool, and '
|
'benchmarking process.Requires Linux, schedtool, and '
|
||||||
@ -1123,9 +1127,13 @@ def Main(argv):
|
|||||||
parser.add_argument('--dump-logcats-to',
|
parser.add_argument('--dump-logcats-to',
|
||||||
help='Writes logcat output from each test into specified '
|
help='Writes logcat output from each test into specified '
|
||||||
'directory. Only supported for android targets.')
|
'directory. Only supported for android targets.')
|
||||||
parser.add_argument('--run-count', type=int, default=0,
|
parser.add_argument(
|
||||||
help='Override the run count specified by the test '
|
'--run-count',
|
||||||
'suite. The default 0 uses the suite\'s config.')
|
"--repeat",
|
||||||
|
type=int,
|
||||||
|
default=0,
|
||||||
|
help='Override the run count specified by the test '
|
||||||
|
'suite. The default 0 uses the suite\'s config.')
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--dry-run',
|
'--dry-run',
|
||||||
default=False,
|
default=False,
|
||||||
@ -1164,15 +1172,15 @@ def Main(argv):
|
|||||||
os.path.join(workspace, args.outdir), args.arch)
|
os.path.join(workspace, args.outdir), args.arch)
|
||||||
default_binary_name = 'd8'
|
default_binary_name = 'd8'
|
||||||
else:
|
else:
|
||||||
if not os.path.isfile(args.binary_override_path):
|
path = pathlib.Path(args.binary_override_path).expanduser().resolve()
|
||||||
logging.error('binary-override-path must be a file name')
|
if not path.is_file():
|
||||||
|
logging.error(f'binary-override-path "{path}" must be a file name')
|
||||||
return INFRA_FAILURE_RETCODE
|
return INFRA_FAILURE_RETCODE
|
||||||
if args.outdir_secondary:
|
if args.outdir_secondary:
|
||||||
logging.error('specify either binary-override-path or outdir-secondary')
|
logging.error('specify either binary-override-path or outdir-secondary')
|
||||||
return INFRA_FAILURE_RETCODE
|
return INFRA_FAILURE_RETCODE
|
||||||
args.shell_dir = os.path.abspath(
|
args.shell_dir = str(path.parent)
|
||||||
os.path.dirname(args.binary_override_path))
|
default_binary_name = path.name
|
||||||
default_binary_name = os.path.basename(args.binary_override_path)
|
|
||||||
|
|
||||||
if args.outdir_secondary:
|
if args.outdir_secondary:
|
||||||
args.shell_dir_secondary = find_build_directory(
|
args.shell_dir_secondary = find_build_directory(
|
||||||
|
Loading…
Reference in New Issue
Block a user