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

Unified Diff: tools/telemetry/telemetry/core/platform/profiler/perf_profiler.py

Issue 474933005: Perfhost for ubuntu trusty (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: lucid -> precise (shame shame) Created 6 years, 3 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 | « tools/telemetry/telemetry/core/platform/profiler/android_profiling_helper.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/core/platform/profiler/perf_profiler.py
diff --git a/tools/telemetry/telemetry/core/platform/profiler/perf_profiler.py b/tools/telemetry/telemetry/core/platform/profiler/perf_profiler.py
index 9f0c473b619e057439ef23e5f8d899cd5bdf470a..3a0652b54a2aca8f2cb6bf5cfcd50c15d9df2f98 100644
--- a/tools/telemetry/telemetry/core/platform/profiler/perf_profiler.py
+++ b/tools/telemetry/telemetry/core/platform/profiler/perf_profiler.py
@@ -10,6 +10,8 @@ import subprocess
import sys
import tempfile
+from pylib.device import device_errors # pylint: disable=F0401
+
from telemetry.core import platform
from telemetry.core import util
from telemetry.core.platform import profiler
@@ -52,10 +54,11 @@ def _PrepareHostForPerf():
def _InstallPerfHost():
+ perfhost_name = android_profiling_helper.GetPerfhostName()
host = platform.GetHostPlatform()
- if not host.CanLaunchApplication('perfhost'):
- host.InstallApplication('perfhost')
- return support_binaries.FindPath('perfhost', host.GetOSName())
+ if not host.CanLaunchApplication(perfhost_name):
+ host.InstallApplication(perfhost_name)
+ return support_binaries.FindPath(perfhost_name, 'linux')
class _SingleProcessPerfProfiler(object):
@@ -100,7 +103,10 @@ class _SingleProcessPerfProfiler(object):
'"--extra-browser-args=--single-process"')
if self._is_android:
device = self._browser_backend.adb.device()
- device.KillAll('perf', signum=signal.SIGINT, blocking=True)
+ try:
+ device.KillAll('perf', signum=signal.SIGINT, blocking=True)
+ except device_errors.CommandFailedError:
+ logging.warning('The perf process could not be killed on the device.')
self._proc.send_signal(signal.SIGINT)
exit_code = self._proc.wait()
try:
@@ -221,8 +227,8 @@ class PerfProfiler(profiler.Profiler):
with open(os.devnull, 'w') as devnull:
_InstallPerfHost()
report = subprocess.Popen(
- ['perfhost', 'report', '--show-total-period', '-U', '-t', '^', '-i',
- file_name],
+ [android_profiling_helper.GetPerfhostName(),
+ 'report', '--show-total-period', '-U', '-t', '^', '-i', file_name],
stdout=subprocess.PIPE, stderr=devnull).communicate()[0]
period_by_function = {}
for line in report.split('\n'):
« no previous file with comments | « tools/telemetry/telemetry/core/platform/profiler/android_profiling_helper.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698