| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 from systrace.tracing_agents import atrace_agent | 5 from systrace.tracing_agents import atrace_agent |
| 6 from telemetry.internal.platform import tracing_agent | 6 from telemetry.internal.platform import tracing_agent |
| 7 from telemetry.timeline import trace_data | 7 from telemetry.timeline import trace_data |
| 8 | 8 |
| 9 from devil.android.sdk import version_codes | 9 from devil.android.sdk import version_codes |
| 10 | 10 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 return False | 48 return False |
| 49 self._categories = config.atrace_config.categories | 49 self._categories = config.atrace_config.categories |
| 50 self._options = AtraceOpts(str(self._device), config.atrace_config.app_name) | 50 self._options = AtraceOpts(str(self._device), config.atrace_config.app_name) |
| 51 return self._atrace_agent.StartAgentTracing( | 51 return self._atrace_agent.StartAgentTracing( |
| 52 self._options, self._categories, timeout) | 52 self._options, self._categories, timeout) |
| 53 | 53 |
| 54 def StopAgentTracing(self): | 54 def StopAgentTracing(self): |
| 55 self._atrace_agent.StopAgentTracing() | 55 self._atrace_agent.StopAgentTracing() |
| 56 | 56 |
| 57 def SupportsExplicitClockSync(self): | 57 def SupportsExplicitClockSync(self): |
| 58 # TODO(alexandermont): After bug | 58 return self._atrace_agent.SupportsExplicitClockSync() |
| 59 # https://github.com/catapult-project/catapult/issues/2356 is fixed, change | |
| 60 # this to return self._atrace_agent.SupportsExplicitClockSync. | |
| 61 return False | |
| 62 | 59 |
| 63 def RecordClockSyncMarker(self, sync_id, | 60 def RecordClockSyncMarker(self, sync_id, |
| 64 record_controller_clock_sync_marker_callback): | 61 record_controller_clock_sync_marker_callback): |
| 65 return self._atrace_agent.RecordClockSyncMarker(sync_id, | 62 return self._atrace_agent.RecordClockSyncMarker(sync_id, |
| 66 lambda t, sid: record_controller_clock_sync_marker_callback(sid, t)) | 63 lambda t, sid: record_controller_clock_sync_marker_callback(sid, t)) |
| 67 | 64 |
| 68 def CollectAgentTraceData(self, trace_data_builder, timeout=None): | 65 def CollectAgentTraceData(self, trace_data_builder, timeout=None): |
| 69 raw_data = self._atrace_agent.GetResults(timeout).raw_data | 66 raw_data = self._atrace_agent.GetResults(timeout).raw_data |
| 70 trace_data_builder.SetTraceFor(trace_data.ATRACE_PART, raw_data) | 67 trace_data_builder.SetTraceFor(trace_data.ATRACE_PART, raw_data) |
| OLD | NEW |