| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 import json | 5 import json |
| 6 | 6 |
| 7 from telemetry.timeline import tracing_category_filter | 7 from telemetry.timeline import tracing_category_filter |
| 8 | 8 |
| 9 ECHO_TO_CONSOLE = 'trace-to-console' | 9 ECHO_TO_CONSOLE = 'trace-to-console' |
| 10 ENABLE_SYSTRACE = 'enable-systrace' | 10 ENABLE_SYSTRACE = 'enable-systrace' |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 about the JSON string format, see base/trace_event/trace_config.h. | 53 about the JSON string format, see base/trace_event/trace_config.h. |
| 54 | 54 |
| 55 Contains tracing options: | 55 Contains tracing options: |
| 56 Tracing options control which core tracing systems should be enabled. | 56 Tracing options control which core tracing systems should be enabled. |
| 57 | 57 |
| 58 This simply turns on those systems. If those systems have additional options, | 58 This simply turns on those systems. If those systems have additional options, |
| 59 e.g. what to trace, then they are typically configured by adding | 59 e.g. what to trace, then they are typically configured by adding |
| 60 categories to the TracingCategoryFilter. | 60 categories to the TracingCategoryFilter. |
| 61 | 61 |
| 62 Options: | 62 Options: |
| 63 enable_chrome_trace: a boolean that specifies whether to enable | 63 enable_chrome_trace: a boolean that specifies whether to enable chrome |
| 64 chrome tracing. | 64 tracing. |
| 65 enable_platform_display_trace: a boolean that specifies whether to | 65 enable_platform_display_trace: a boolean that specifies whether to |
| 66 platform display tracing. | 66 platform display tracing. |
| 67 enable_android_graphics_memtrack: a boolean that specifies whether | 67 enable_android_graphics_memtrack: a boolean that specifies whether |
| 68 to enable the memtrack_helper daemon to track graphics memory on | 68 to enable the memtrack_helper daemon to track graphics memory on |
| 69 Android (see goo.gl/4Y30p9). Doesn't have any effects on other OSs. | 69 Android (see goo.gl/4Y30p9). Doesn't have any effects on other OSs. |
| 70 enable_battor_trace: a boolean that specifies whether to enable BattOr |
| 71 tracing. |
| 70 | 72 |
| 71 The following ones are specific to chrome tracing. See | 73 The following ones are specific to chrome tracing. See |
| 72 base/trace_event/trace_config.h for more information. | 74 base/trace_event/trace_config.h for more information. |
| 73 record_mode: can be any mode in RECORD_MODE_MAP. This corresponds to | 75 record_mode: can be any mode in RECORD_MODE_MAP. This corresponds to |
| 74 record modes in chrome. | 76 record modes in chrome. |
| 75 enable_systrace: a boolean that specifies whether to enable systrace. | 77 enable_systrace: a boolean that specifies whether to enable systrace. |
| 76 | 78 |
| 77 """ | 79 """ |
| 78 | 80 |
| 79 def __init__(self): | 81 def __init__(self): |
| 80 # Trace options. | 82 # Trace options. |
| 81 self.enable_chrome_trace = False | 83 self.enable_chrome_trace = False |
| 82 self.enable_platform_display_trace = False | 84 self.enable_platform_display_trace = False |
| 83 self.enable_android_graphics_memtrack = False | 85 self.enable_android_graphics_memtrack = False |
| 86 self.enable_battor_trace = False |
| 84 self._record_mode = RECORD_AS_MUCH_AS_POSSIBLE | 87 self._record_mode = RECORD_AS_MUCH_AS_POSSIBLE |
| 85 self._enable_systrace = False | 88 self._enable_systrace = False |
| 86 # Tracing category filter. | 89 # Tracing category filter. |
| 87 self._tracing_category_filter = ( | 90 self._tracing_category_filter = ( |
| 88 tracing_category_filter.TracingCategoryFilter()) | 91 tracing_category_filter.TracingCategoryFilter()) |
| 89 self._memory_dump_config = None | 92 self._memory_dump_config = None |
| 90 | 93 |
| 91 @property | 94 @property |
| 92 def tracing_category_filter(self): | 95 def tracing_category_filter(self): |
| 93 return self._tracing_category_filter | 96 return self._tracing_category_filter |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 def GetDictForChromeTracing(self): | 175 def GetDictForChromeTracing(self): |
| 173 RECORD_MODE_PARAM = 'record_mode' | 176 RECORD_MODE_PARAM = 'record_mode' |
| 174 ENABLE_SYSTRACE_PARAM = 'enable_systrace' | 177 ENABLE_SYSTRACE_PARAM = 'enable_systrace' |
| 175 | 178 |
| 176 result = {} | 179 result = {} |
| 177 result[RECORD_MODE_PARAM] = ( | 180 result[RECORD_MODE_PARAM] = ( |
| 178 RECORD_MODE_MAP[self._record_mode]) | 181 RECORD_MODE_MAP[self._record_mode]) |
| 179 if self._enable_systrace: | 182 if self._enable_systrace: |
| 180 result[ENABLE_SYSTRACE_PARAM] = True | 183 result[ENABLE_SYSTRACE_PARAM] = True |
| 181 return result | 184 return result |
| OLD | NEW |