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

Unified Diff: build/android/chrome_profiler/perf_controller.py

Issue 321163005: adb_profile_chrome: Show interactive perf command (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/chrome_profiler/perf_controller.py
diff --git a/build/android/chrome_profiler/perf_controller.py b/build/android/chrome_profiler/perf_controller.py
index 1c1522b4b4d720040714ce2db18e90fb99350067..ba4b572386949db2ffbfb8343c75cd58e8cc05fc 100644
--- a/build/android/chrome_profiler/perf_controller.py
+++ b/build/android/chrome_profiler/perf_controller.py
@@ -9,6 +9,7 @@ import sys
import tempfile
from chrome_profiler import controllers
+from chrome_profiler import ui
from pylib import android_commands
from pylib import constants
@@ -128,6 +129,22 @@ class PerfProfilerController(controllers.BaseController):
return
self._perf_instance.SignalAndWait()
+ @staticmethod
+ def _GetInteractivePerfCommand(perfhost_path, perf_profile, symfs_dir,
+ required_libs, kallsyms):
+ cmd = '%s report -n -i %s --symfs %s --kallsyms %s' % (
+ os.path.relpath(perfhost_path, '.'), perf_profile, symfs_dir, kallsyms)
+ for lib in required_libs:
+ lib = os.path.join(symfs_dir, lib[1:])
+ if not os.path.exists(lib):
+ continue
+ objdump_path = android_profiling_helper.GetToolchainBinaryPath(
Dominik Grewe 2014/06/10 16:48:17 I can't find this method anywhere? Did you mean to
+ lib, 'objdump')
+ if objdump_path:
+ cmd += ' --objdump %s' % os.path.relpath(objdump_path, '.')
+ break
+ return cmd
+
def PullTrace(self):
symfs_dir = os.path.join(tempfile.gettempdir(),
os.path.expandvars('$USER-perf-symfs'))
@@ -149,9 +166,14 @@ class PerfProfilerController(controllers.BaseController):
symfs_dir,
required_libs,
use_symlinks=False)
- # Convert the perf profile into JSON.
perfhost_path = os.path.abspath(support_binaries.FindPath(
'perfhost', 'linux'))
+
+ ui.PrintMessage('\nNote: to view the profile in perf, run:')
+ ui.PrintMessage(' ' + self._GetInteractivePerfCommand(perfhost_path,
+ perf_profile, symfs_dir, required_libs, kallsyms))
+
+ # Convert the perf profile into JSON.
perf_script_path = os.path.join(constants.DIR_SOURCE_ROOT,
'tools', 'telemetry', 'telemetry', 'core', 'platform', 'profiler',
'perf_vis', 'perf_to_tracing.py')
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698