Commit b571b83b authored by gdeepti's avatar gdeepti Committed by Commit bot

[test] Add an option to the perf runner to support running with the internal profiler.

Enhance the perf runner to run with the profiler and print the summary for each d8 run. This automates running the profiler with multiple benchmarks.

BUG=None
LOG=N
TBR=machenbach@chromium.org

Review URL: https://codereview.chromium.org/1327033003

Cr-Commit-Position: refs/heads/master@{#30720}
parent a7a34b06
......@@ -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:
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"
subprocess.check_call(prof_cmd, shell=True)
return output.stdout
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment