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

Unified Diff: tools/telemetry/telemetry/core/platform/tracing_agent/display_tracing_agent.py

Issue 853353005: [Telemetry] Add tracing_agent API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unittest breakage (bug in tracing_controller_backend) Created 5 years, 11 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: tools/telemetry/telemetry/core/platform/tracing_agent/display_tracing_agent.py
diff --git a/tools/telemetry/telemetry/core/platform/tracing_agent/display_tracing_agent.py b/tools/telemetry/telemetry/core/platform/tracing_agent/display_tracing_agent.py
new file mode 100644
index 0000000000000000000000000000000000000000..3ae0ebb6621c24fda7376138514e1181bae5f843
--- /dev/null
+++ b/tools/telemetry/telemetry/core/platform/tracing_agent/display_tracing_agent.py
@@ -0,0 +1,26 @@
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+from telemetry.core.platform import tracing_agent
+from telemetry.timeline import trace_data
+
+
+class DisplayTracingAgent(tracing_agent.TracingAgent):
+ def __init__(self, platform_backend):
+ super(DisplayTracingAgent, self).__init__(platform_backend)
+
+ @classmethod
+ def IsSupported(cls, platform_backend):
+ return platform_backend.IsDisplayTracingSupported()
+
+ def Start(self, trace_options, category_filter, _timeout):
+ if trace_options.enable_platform_display_trace:
+ self._platform_backend.StartDisplayTracing()
+ return True
+
+ def Stop(self, trace_data_builder):
+ assert self._is_tracing_running
+ surface_flinger_trace_data = self._platform_backend.StopDisplayTracing()
+ trace_data_builder.AddEventsTo(
+ trace_data.SURFACE_FLINGER_PART, surface_flinger_trace_data)

Powered by Google App Engine
This is Rietveld 408576698