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

Unified Diff: systrace/profile_chrome/ddms_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: Rebase 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/ddms_tracing_agent.py
diff --git a/systrace/profile_chrome/ddms_tracing_agent.py b/systrace/profile_chrome/ddms_tracing_agent.py
index 3c6a232030059fa26d31775861206679c5014510..158e45b27fc74ea05486e073d4d83ac027d4b3a6 100644
--- a/systrace/profile_chrome/ddms_tracing_agent.py
+++ b/systrace/profile_chrome/ddms_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
@@ -32,7 +33,7 @@ class DdmsAgent(tracing_agents.TracingAgent):
return False
@py_utils.Timeout(tracing_agents.START_STOP_TIMEOUT)
- def StartAgentTracing(self, options, categories, timeout=None):
+ def StartAgentTracing(self, config, timeout=None):
self._output_file = (
'/data/local/tmp/ddms-profile-%s' % util.GetTraceTimestamp())
cmd = 'am profile start '
@@ -66,3 +67,19 @@ class DdmsAgent(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 DdmsConfig(tracing_agents.TracingConfig):
+ def __init__(self):
+ tracing_agents.TracingConfig.__init__(self)
+
+
+def add_options(parser):
+ options = optparse.OptionGroup(parser, 'Java tracing')
+ options.add_option('--ddms', help='Trace Java execution using DDMS '
+ 'sampling.', action='store_true')
+ return options
+
+def get_config(options):
+ # pylint: disable=unused-argument
+ return DdmsConfig()
« no previous file with comments | « systrace/profile_chrome/chrome_tracing_agent_unittest.py ('k') | systrace/profile_chrome/ddms_tracing_agent_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698