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

Side by Side Diff: systrace/systrace/tracing_agents/__init__.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: 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 unified diff | Download patch
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 2
3 # Copyright 2016 The Chromium Authors. All rights reserved. 3 # Copyright 2016 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 '''Tracing agent interface for systrace. 7 '''Tracing agent interface for systrace.
8 8
9 This class represents an agent that captures traces from a particular 9 This class represents an agent that captures traces from a particular
10 tool (e.g. atrace, ftrace.) 10 tool (e.g. atrace, ftrace.)
11 ''' 11 '''
12 12
13 # Timeout interval constants. 13 # Timeout interval constants.
14 14
15 START_STOP_TIMEOUT = 10.0 15 START_STOP_TIMEOUT = 10.0
16 GET_RESULTS_TIMEOUT = 30.0 16 GET_RESULTS_TIMEOUT = 30.0
17 17
18 18
19 class TracingConfig(object):
20 '''Store the tracing configuration options for all Systrace agents. If there
21 are ever any options that are to be shared between all of the agents, those
22 options should go here.
23 '''
24 def __init__(self):
25 pass
26
19 class TracingAgent(object): 27 class TracingAgent(object):
20 def __init__(self): 28 def __init__(self):
21 pass 29 pass
22 30
23 def StartAgentTracing(self, options, categories, timeout=None): 31 def StartAgentTracing(self, config, timeout=None):
24 '''Starts running the trace for this agent. Stops with timeout if 32 '''Starts running the trace for this agent. Stops with timeout if
25 not completed within timeout interval. 33 not completed within timeout interval.
26 34
27 Args: 35 Args:
28 options: Tracing options. 36 config: TracingOptions subclass containing agent-specific options
Sami 2016/08/26 15:53:43 s/TracingOptions/TracingConfig/?
washingtonp 2016/08/26 18:50:54 Done.
29 categories: Categories of trace events to record. 37 and categories.
30 timeout: Timeout interval in seconds. 38 timeout: Timeout interval in seconds.
31 39
32 Returns: 40 Returns:
33 Boolean value indicating whether or not the trace started successfully. 41 Boolean value indicating whether or not the trace started successfully.
34 ''' 42 '''
35 pass 43 pass
36 44
37 def StopAgentTracing(self, timeout=None): 45 def StopAgentTracing(self, timeout=None):
38 '''Stops running the trace for this agent and returns immediately. 46 '''Stops running the trace for this agent and returns immediately.
39 Stops with timeout if not completed within timeout interval. 47 Stops with timeout if not completed within timeout interval.
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 StopAgentTracing is done. This function blocks until the result 81 StopAgentTracing is done. This function blocks until the result
74 is collected (note; this may take several seconds). Stops with timeout 82 is collected (note; this may take several seconds). Stops with timeout
75 if not completed within self._options.collection_timeout seconds. 83 if not completed within self._options.collection_timeout seconds.
76 84
77 Args: 85 Args:
78 timeout: Timeout interval in seconds. 86 timeout: Timeout interval in seconds.
79 Returns: 87 Returns:
80 Completed trace for this agent. 88 Completed trace for this agent.
81 ''' 89 '''
82 pass 90 pass
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698