• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2014 The Chromium Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5RECORD_AS_MUCH_AS_POSSIBLE = 'record-as-much-as-possible'
6RECORD_UNTIL_FULL = 'record-until-full'
7RECORD_MODES = (RECORD_AS_MUCH_AS_POSSIBLE, RECORD_UNTIL_FULL)
8
9
10class TracingOptions(object):
11  """Tracing options control which core tracing systems should be enabled.
12
13  This simply turns on those systems. If those systems have additional options,
14  e.g. what to trace, then they are typically configured by adding
15  categories to the TracingCategoryFilter.
16
17  Options:
18         enable_chrome_trace: a boolean that specifies whether to enable
19                            chrome tracing.
20         record_mode: can be any mode in RECORD_MODES. This corresponds to
21                    record modes in chrome (see
22                    TraceRecordMode in base/debug/trace_event_impl.h for more
23                    information)
24  """
25  def __init__(self):
26    self.enable_chrome_trace = False
27    self._record_mode = RECORD_AS_MUCH_AS_POSSIBLE
28
29  @property
30  def record_mode(self):  # pylint: disable=E0202
31    return self._record_mode
32
33  @record_mode.setter
34  def record_mode(self, value):  # pylint: disable=E0202
35    assert value in RECORD_MODES
36    self._record_mode = value
37