1# Copyright 2015 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 5from telemetry.timeline import atrace_config 6from telemetry.timeline import chrome_trace_config 7 8 9class TracingConfig(object): 10 """Tracing config is the configuration for tracing in Telemetry. 11 12 TracingConfig configures tracing in Telemetry. It contains tracing options 13 that control which core tracing system should be enabled. If a tracing 14 system requires additional configuration, e.g., what to trace, then it is 15 typically configured in its own config class. TracingConfig provides 16 interfaces to access the configuration for those tracing systems. 17 18 Options: 19 enable_atrace_trace: a boolean that specifies whether to enable 20 atrace tracing. 21 enable_cpu_trace: a boolean that specifies whether to enable cpu tracing. 22 enable_chrome_trace: a boolean that specifies whether to enable 23 chrome tracing. 24 enable_platform_display_trace: a boolean that specifies whether to 25 platform display tracing. 26 enable_android_graphics_memtrack: a boolean that specifies whether 27 to enable the memtrack_helper daemon to track graphics memory on 28 Android (see goo.gl/4Y30p9). Doesn't have any effects on other OSs. 29 enable_battor_trace: a boolean that specifies whether to enable BattOr 30 tracing. 31 32 Detailed configurations: 33 atrace_config: Stores configuration options specific to Atrace. 34 chrome_trace_config: Stores configuration options specific to 35 Chrome trace. 36 """ 37 38 def __init__(self): 39 self._enable_atrace_trace = False 40 self._enable_platform_display_trace = False 41 self._enable_android_graphics_memtrack = False 42 self._enable_battor_trace = False 43 self._enable_cpu_trace = False 44 self._enable_chrome_trace = False 45 46 self._atrace_config = atrace_config.AtraceConfig() 47 self._chrome_trace_config = chrome_trace_config.ChromeTraceConfig() 48 49 @property 50 def enable_atrace_trace(self): 51 return self._enable_atrace_trace 52 53 @enable_atrace_trace.setter 54 def enable_atrace_trace(self, value): 55 self._enable_atrace_trace = value 56 57 @property 58 def enable_cpu_trace(self): 59 return self._enable_cpu_trace 60 61 @enable_cpu_trace.setter 62 def enable_cpu_trace(self, value): 63 self._enable_cpu_trace = value 64 65 @property 66 def enable_platform_display_trace(self): 67 return self._enable_platform_display_trace 68 69 @enable_platform_display_trace.setter 70 def enable_platform_display_trace(self, value): 71 self._enable_platform_display_trace = value 72 73 @property 74 def enable_android_graphics_memtrack(self): 75 return self._enable_android_graphics_memtrack 76 77 @enable_android_graphics_memtrack.setter 78 def enable_android_graphics_memtrack(self, value): 79 self._enable_android_graphics_memtrack = value 80 81 @property 82 def enable_battor_trace(self): 83 return self._enable_battor_trace 84 85 @enable_battor_trace.setter 86 def enable_battor_trace(self, value): 87 self._enable_battor_trace = value 88 89 @property 90 def enable_chrome_trace(self): 91 return self._enable_chrome_trace 92 93 @enable_chrome_trace.setter 94 def enable_chrome_trace(self, value): 95 self._enable_chrome_trace = value 96 97 @property 98 def atrace_config(self): 99 return self._atrace_config 100 101 @property 102 def chrome_trace_config(self): 103 return self._chrome_trace_config 104