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

Unified Diff: systrace/profile_chrome/chrome_startup_tracing_agent.py

Issue 2276263003: Pass in custom options to Systrace agents (Closed) Base URL: https://chromium.googlesource.com/external/github.com/catapult-project/catapult.git@master
Patch Set: Set categories based on target devices and revised comments Created 4 years, 4 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/chrome_startup_tracing_agent.py
diff --git a/systrace/profile_chrome/chrome_startup_tracing_agent.py b/systrace/profile_chrome/chrome_startup_tracing_agent.py
index a7693007c023611e37276f384901b9896104aff5..c1a283539a8f060165e415ccdd3297a138bb4fe4 100644
--- a/systrace/profile_chrome/chrome_startup_tracing_agent.py
+++ b/systrace/profile_chrome/chrome_startup_tracing_agent.py
@@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import optparse
import os
import py_utils
import re
@@ -56,7 +57,7 @@ class ChromeStartupTracingAgent(tracing_agents.TracingAgent):
self._flag_changer.Restore()
@py_utils.Timeout(tracing_agents.START_STOP_TIMEOUT)
- def StartAgentTracing(self, options, categories, timeout=None):
+ def StartAgentTracing(self, config, timeout=None):
self._SetupTracing()
self._logcat_monitor.Start()
@@ -86,3 +87,20 @@ class ChromeStartupTracingAgent(tracing_agents.TracingAgent):
def RecordClockSyncMarker(self, sync_id, did_record_sync_marker_callback):
assert self.SupportsExplicitClockSync(), ('Clock sync marker cannot be '
'recorded since explicit clock sync is not supported.')
+
+
+class ChromeStartupConfig(tracing_agents.TracingConfig):
+ def __init__(self):
+ tracing_agents.TracingConfig.__init__(self)
+
+
+def add_options(parser):
+ # The Chrome startup agent does not currently support working with other
+ # agents. The Chrome startup agent's options are defined in
+ # bin/adb_profile_chrome_startup.
Zhen Wang 2016/08/29 16:30:20 I noticed that adb_profile_chrome_startup actually
washingtonp 2016/08/29 20:00:41 Done.
+ options = optparse.OptionGroup(parser, '')
+ return options
+
+def get_config(options):
+ # pylint: disable=unused-argument
+ return ChromeStartupConfig()

Powered by Google App Engine
This is Rietveld 408576698