diff options
Diffstat (limited to 'deps/v8/tools/run_perf.py')
-rwxr-xr-x | deps/v8/tools/run_perf.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/deps/v8/tools/run_perf.py b/deps/v8/tools/run_perf.py index 31331686fa..a8cc3fab71 100755 --- a/deps/v8/tools/run_perf.py +++ b/deps/v8/tools/run_perf.py @@ -102,6 +102,7 @@ import math import optparse import os import re +import subprocess import sys from testrunner.local import commands @@ -120,6 +121,7 @@ SUPPORTED_ARCHS = ["arm", GENERIC_RESULTS_RE = re.compile(r"^RESULT ([^:]+): ([^=]+)= ([^ ]+) ([^ ]*)$") RESULT_STDDEV_RE = re.compile(r"^\{([^\}]+)\}$") RESULT_LIST_RE = re.compile(r"^\[([^\]]+)\]$") +TOOLS_BASE = os.path.abspath(os.path.dirname(__file__)) def LoadAndroidBuildTools(path): # pragma: no cover @@ -457,7 +459,10 @@ class RunnableConfig(GraphConfig): def GetCommand(self, shell_dir, extra_flags=None): # TODO(machenbach): This requires +.exe if run on windows. + extra_flags = extra_flags or [] cmd = [os.path.join(shell_dir, self.binary)] + if self.binary != 'd8' and '--prof' in extra_flags: + print "Profiler supported only on a benchmark run with d8" return cmd + self.GetCommandFlags(extra_flags=extra_flags) def Run(self, runner, trybot): @@ -640,6 +645,13 @@ class DesktopPlatform(Platform): print output.stderr if output.timed_out: print ">>> Test timed out after %ss." % runnable.timeout + if '--prof' in self.extra_flags: + os_prefix = {"linux": "linux", "macos": "mac"}.get(utils.GuessOS()) + if os_prefix: + tick_tools = os.path.join(TOOLS_BASE, "%s-tick-processor" % os_prefix) + subprocess.check_call(tick_tools + " --only-summary", shell=True) + else: # pragma: no cover + print "Profiler option currently supported on Linux and Mac OS." return output.stdout |