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

Unified Diff: tools/run_perf.py

Issue 1659483003: [tools] Flexible perf runner path. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/run_perf.py
diff --git a/tools/run_perf.py b/tools/run_perf.py
index a8cc3fab7158207f73d5ae460b0f291360a76219..4a01988c2509c8206c196f774c97f93f55944a63 100755
--- a/tools/run_perf.py
+++ b/tools/run_perf.py
@@ -350,9 +350,9 @@ class Node(object):
class DefaultSentinel(Node):
"""Fake parent node with all default values."""
- def __init__(self):
+ def __init__(self, binary = "d8"):
super(DefaultSentinel, self).__init__()
- self.binary = "d8"
+ self.binary = binary
self.run_count = 10
self.timeout = 60
self.path = []
@@ -543,11 +543,10 @@ def MakeGraphConfig(suite, arch, parent):
raise Exception("Invalid suite configuration.")
-def BuildGraphConfigs(suite, arch, parent=None):
+def BuildGraphConfigs(suite, arch, parent):
"""Builds a tree structure of graph objects that corresponds to the suite
configuration.
"""
- parent = parent or DefaultSentinel()
# TODO(machenbach): Implement notion of cpu type?
if arch not in suite.get("archs", SUPPORTED_ARCHS):
@@ -813,6 +812,11 @@ def Main(args):
default="out")
parser.add_option("--outdir-no-patch",
help="Base directory with compile output without patch")
+ parser.add_option("--binary-override-path",
+ help="JavaScript engine binary. By default, d8 under "
+ "architecture-specific build dir. "
+ "Not supported in conjunction with outdir-no-patch.")
+
(options, args) = parser.parse_args(args)
if len(args) == 0: # pragma: no cover
@@ -843,7 +847,18 @@ def Main(args):
else:
build_config = "%s.release" % options.arch
- options.shell_dir = os.path.join(workspace, options.outdir, build_config)
+ if options.binary_override_path == None:
+ options.shell_dir = os.path.join(workspace, options.outdir, build_config)
+ default_binary_name = "d8"
+ else:
+ if not os.path.isfile(options.binary_override_path):
+ print "binary-override-path must be a file name"
+ return 1
+ if options.outdir_no_patch:
+ print "specify either binary-override-path or outdir-no-patch"
+ return 1
+ options.shell_dir = os.path.dirname(options.binary_override_path)
+ default_binary_name = os.path.basename(options.binary_override_path)
if options.outdir_no_patch:
options.shell_dir_no_patch = os.path.join(
@@ -872,7 +887,8 @@ def Main(args):
platform.PreExecution()
# Build the graph/trace tree structure.
- root = BuildGraphConfigs(suite, options.arch)
+ default_parent = DefaultSentinel(default_binary_name)
+ root = BuildGraphConfigs(suite, options.arch, default_parent)
# Callback to be called on each node on traversal.
def NodeCB(node):
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698