Index: tools/telemetry/telemetry/core/platform/tracing_controller.py |
diff --git a/tools/telemetry/telemetry/core/platform/tracing_controller.py b/tools/telemetry/telemetry/core/platform/tracing_controller.py |
new file mode 100644 |
index 0000000000000000000000000000000000000000..3e72cad9aa759acab4dde7d80d531e3acfa6fb03 |
--- /dev/null |
+++ b/tools/telemetry/telemetry/core/platform/tracing_controller.py |
@@ -0,0 +1,34 @@ |
+# 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. |
+ |
+class TracingController(object): |
+ def __init__(self, tracing_controller_backend): |
+ """Provides control of the tracing systems supported by telemetry.""" |
+ self._tracing_controller_backend = tracing_controller_backend |
+ |
+ def Start(self, category_filter, trace_options, timeout=10): |
+ """Starts tracing. |
+ |
+ trace_options specifies which tracing systems to activate. Category filter |
+ allows fine-tuning of the data that are collected by the selected tracing |
+ systems. |
+ """ |
nednguyen
2014/08/04 22:12:06
Should we add assert self.AreOptionsSupported(trac
|
+ self._tracing_controller_backend.Start( |
+ category_filter, trace_options, timeout) |
+ |
+ def Stop(self): |
+ """Stops tracing and returns a TraceValue.""" |
+ return self._tracing_controller_backend.Stop() |
+ |
+ @property |
+ def is_tracing_running(self): |
+ return self._tracing_controller_backend.is_tracing_running |
+ |
+ def AreOptionsSupported(self, trace_options): |
+ """Returns whether the tracers requested by trace_options are supported. |
+ |
+ If the browser is not running at the time that this query is issued, then |
+ no answer can be provided. |
+ """ |
+ return self._tracing_controller_backend.AreOptionsSupported(trace_options) |