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

Unified Diff: systrace/profile_chrome/atrace_tracing_agent.py

Issue 2297403003: Use Systrace tracing controller in profile_chrome (Closed) Base URL: https://chromium.googlesource.com/external/github.com/catapult-project/catapult.git@master
Patch Set: Added property method for tracing controller's child agents Created 4 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
Index: systrace/profile_chrome/atrace_tracing_agent.py
diff --git a/systrace/profile_chrome/atrace_tracing_agent.py b/systrace/profile_chrome/atrace_tracing_agent.py
index d8032543cb41fc221c5a83dee09564eeac952a81..c98906f0e45de6fad61744a35d6c2383c6b83235 100644
--- a/systrace/profile_chrome/atrace_tracing_agent.py
+++ b/systrace/profile_chrome/atrace_tracing_agent.py
@@ -52,10 +52,12 @@ class AtraceAgent(tracing_agents.TracingAgent):
self._categories = _ComputeAtraceCategories(config)
self._thread = threading.Thread(target=self._CollectData)
self._thread.start()
+ return True
@py_utils.Timeout(tracing_agents.START_STOP_TIMEOUT)
def StopAgentTracing(self, timeout=None):
self._done.set()
+ return True
@py_utils.Timeout(tracing_agents.GET_RESULTS_TIMEOUT)
def GetResults(self, timeout=None):
@@ -67,6 +69,7 @@ class AtraceAgent(tracing_agents.TracingAgent):
return False
def RecordClockSyncMarker(self, sync_id, did_record_sync_marker_callback):
+ # pylint: disable=unused-argument
assert self.SupportsExplicitClockSync(), ('Clock sync marker cannot be '
'recorded since explicit clock sync is not supported.')
@@ -126,11 +129,18 @@ class AtraceAgent(tracing_agents.TracingAgent):
class AtraceConfig(tracing_agents.TracingConfig):
- def __init__(self, atrace_categories):
+ def __init__(self, atrace_categories, device, ring_buffer):
tracing_agents.TracingConfig.__init__(self)
self.atrace_categories = atrace_categories
+ self.device = device
+ self.ring_buffer = ring_buffer
+def try_create_agent(config):
+ if config.atrace_categories:
+ return AtraceAgent(config.device, config.ring_buffer)
+ return None
+
def add_options(parser):
atrace_opts = optparse.OptionGroup(parser, 'Atrace tracing options')
atrace_opts.add_option('-s', '--systrace', help='Capture a systrace with '
@@ -145,7 +155,8 @@ def add_options(parser):
return atrace_opts
def get_config(options):
- return AtraceConfig(options.atrace_categories)
+ return AtraceConfig(options.atrace_categories, options.device,
+ options.ring_buffer)
def _ComputeAtraceCategories(config):
if not config.atrace_categories:

Powered by Google App Engine
This is Rietveld 408576698