Chromium Code Reviews| Index: systrace/profile_chrome/chrome_tracing_agent.py |
| diff --git a/systrace/profile_chrome/chrome_tracing_agent.py b/systrace/profile_chrome/chrome_tracing_agent.py |
| index 4886228324f6ea8931e22a96edc05d48b8ad4cbe..fecd7af42e6935e28ca4442243104e49b5ea5166 100644 |
| --- a/systrace/profile_chrome/chrome_tracing_agent.py |
| +++ b/systrace/profile_chrome/chrome_tracing_agent.py |
| @@ -7,10 +7,10 @@ import optparse |
| import os |
| import py_utils |
| import re |
| +from profile_chrome import util |
| from devil.android import device_errors |
| from devil.android.sdk import intent |
| - |
| from systrace import trace_result |
| from systrace import tracing_agents |
| @@ -40,6 +40,9 @@ class ChromeTracingAgent(tracing_agents.TracingAgent): |
| @staticmethod |
| def GetCategories(device, package_info): |
| + curr_browser = util.GetChromeProcessID(device, package_info) |
|
Sami
2016/09/09 10:28:25
I don't think the agents should be trying to start
washingtonp
2016/09/09 18:07:29
Done.
|
| + if curr_browser == None: |
| + util.StartBrowser(device, package_info) |
| with device.GetLogcatMonitor() as logmon: |
| device.BroadcastIntent(intent.Intent( |
| action='%s.GPU_PROFILER_LIST_CATEGORIES' % package_info.package)) |
| @@ -64,6 +67,9 @@ class ChromeTracingAgent(tracing_agents.TracingAgent): |
| @py_utils.Timeout(tracing_agents.START_STOP_TIMEOUT) |
| def StartAgentTracing(self, config, timeout=None): |
| + curr_browser = util.GetChromeProcessID(self._device, self._package_info) |
| + if curr_browser == None: |
| + util.StartBrowser(self._device, self._package_info) |
| self._categories = _ComputeChromeCategories(config) |
| self._logcat_monitor.Start() |
| start_extras = {'categories': ','.join(self._categories)} |