Index: tools/run_perf.py |
diff --git a/tools/run_perf.py b/tools/run_perf.py |
index 31331686fa0f0598b1de48ddc4f4b221e21f158e..a747b925b3daf0a4e046731d6a2bcd8dce93e19c 100755 |
--- a/tools/run_perf.py |
+++ b/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 |
@@ -457,7 +458,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 self.extra_flags: |
Michael Achenbach
2015/09/15 07:03:40
Ah crap - didn't catch this. s/self.extra_flags/ex
|
+ 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 +644,19 @@ class DesktopPlatform(Platform): |
print output.stderr |
if output.timed_out: |
print ">>> Test timed out after %ss." % runnable.timeout |
+ if '--prof' in self.extra_flags: |
+ if utils.GuessOS() == "linux": |
+ tick_tools = os.path.abspath(os.path.join(shell_dir, "..", "..", |
+ "tools", |
+ "linux-tick-processor")) |
+ elif utils.GuessOS() == "macos": |
+ tick_tools = os.path.abspath(os.path.join(shell_dir, "..", "..", |
+ "tools", |
+ "mac-tick-processor")) |
+ else: |
+ print "Profiler option currently supported on Linux and Mac OS." |
+ prof_cmd = tick_tools + " --only-summary" |
Michael Achenbach
2015/09/15 07:03:40
In the else case, tick_tools is read before assign
|
+ subprocess.check_call(prof_cmd, shell=True) |
return output.stdout |