Chromium Code Reviews| Index: tools/run_perf.py |
| diff --git a/tools/run_perf.py b/tools/run_perf.py |
| index a8cc3fab7158207f73d5ae460b0f291360a76219..7a6935575f4a74dd43e99eccd6b5be3336be6210 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 shell-dir-no-patch" |
|
Michael Achenbach
2016/02/01 20:02:24
nit: The option is called outdir-no-patch.
Mircea Trofin
2016/02/01 20:25:53
Done.
|
| + 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): |