| Index: tools/android/adb_profile_chrome/chrome_controller.py
|
| diff --git a/tools/android/adb_profile_chrome/chrome_controller.py b/tools/android/adb_profile_chrome/chrome_controller.py
|
| index 5457e93dace8315abfc977f59d6fec43fa9988a2..3dc88556eabf69eb855b928738b90ad0d43eb943 100644
|
| --- a/tools/android/adb_profile_chrome/chrome_controller.py
|
| +++ b/tools/android/adb_profile_chrome/chrome_controller.py
|
| @@ -10,6 +10,7 @@ import time
|
| from adb_profile_chrome import controllers
|
|
|
| from pylib import pexpect
|
| +from pylib.device import intent
|
|
|
| _HEAP_PROFILE_MMAP_PROPERTY = 'heapprof.mmap'
|
|
|
| @@ -35,8 +36,8 @@ class ChromeTracingController(controllers.BaseController):
|
|
|
| @staticmethod
|
| def GetCategories(device, package_info):
|
| - device.old_interface.BroadcastIntent(
|
| - package_info.package, 'GPU_PROFILER_LIST_CATEGORIES')
|
| + device.BroadcastIntent(intent.Intent(
|
| + action='%s.GPU_PROFILER_LIST_CATEGORIES' % self._package_info.package))
|
| try:
|
| json_category_list = device.old_interface.WaitForLogMatch(
|
| re.compile(r'{"traceCategoriesList(.*)'), None, timeout=5).group(0)
|
| @@ -58,10 +59,12 @@ class ChromeTracingController(controllers.BaseController):
|
| def StartTracing(self, interval):
|
| self._trace_interval = interval
|
| self._device.old_interface.SyncLogCat()
|
| - self._device.old_interface.BroadcastIntent(
|
| - self._package_info.package, 'GPU_PROFILER_START',
|
| - '-e categories "%s"' % ','.join(self._categories),
|
| - '-e continuous' if self._ring_buffer else '')
|
| + start_extras = {'categories': ','.join(self._categories)}
|
| + if self._ring_buffer:
|
| + start_extras['continuous'] = None
|
| + self._device.BroadcastIntent(intent.Intent(
|
| + action='%s.GPU_PROFILER_START' % self._package_info.package,
|
| + extras=start_extras))
|
|
|
| if self._trace_memory:
|
| self._device.old_interface.EnableAdbRoot()
|
| @@ -83,9 +86,8 @@ class ChromeTracingController(controllers.BaseController):
|
| 'of the browser running?')
|
|
|
| def StopTracing(self):
|
| - self._device.old_interface.BroadcastIntent(
|
| - self._package_info.package,
|
| - 'GPU_PROFILER_STOP')
|
| + self._device.BroadcastIntent(intent.Intent(
|
| + action='%s.GPU_PROFILER_STOP' % self._package_info.package))
|
| self._trace_file = self._device.old_interface.WaitForLogMatch(
|
| self._trace_finish_re, None, timeout=120).group(1)
|
| if self._trace_memory:
|
|
|