Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 import optparse | 6 import optparse |
| 7 import os | 7 import os |
| 8 import py_utils | 8 import py_utils |
| 9 import re | 9 import re |
| 10 | 10 |
| 11 from devil.android import device_errors | 11 from devil.android import device_errors |
| 12 from devil.android.sdk import intent | 12 from devil.android.sdk import intent |
| 13 from systrace import trace_result | 13 from systrace import trace_result |
| 14 from systrace import tracing_agents | 14 from systrace import tracing_agents |
| 15 | 15 |
| 16 | 16 |
| 17 _DEFAULT_CHROME_CATEGORIES = '_DEFAULT_CHROME_CATEGORIES' | 17 DEFAULT_CHROME_CATEGORIES = '_DEFAULT_CHROME_CATEGORIES' |
|
Chris Craik
2016/10/06 19:56:37
why is this just a string that refers to its previ
Zhen Wang
2016/10/06 19:58:37
This is a magic string used by Chrome for Android.
| |
| 18 _HEAP_PROFILE_MMAP_PROPERTY = 'heapprof.mmap' | 18 _HEAP_PROFILE_MMAP_PROPERTY = 'heapprof.mmap' |
| 19 | 19 |
| 20 | 20 |
| 21 class ChromeTracingAgent(tracing_agents.TracingAgent): | 21 class ChromeTracingAgent(tracing_agents.TracingAgent): |
| 22 def __init__(self, device, package_info, ring_buffer, trace_memory=False): | 22 def __init__(self, device, package_info, ring_buffer, trace_memory=False): |
| 23 tracing_agents.TracingAgent.__init__(self) | 23 tracing_agents.TracingAgent.__init__(self) |
| 24 self._device = device | 24 self._device = device |
| 25 self._package_info = package_info | 25 self._package_info = package_info |
| 26 self._ring_buffer = ring_buffer | 26 self._ring_buffer = ring_buffer |
| 27 self._logcat_monitor = self._device.GetLogcatMonitor() | 27 self._logcat_monitor = self._device.GetLogcatMonitor() |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 156 return None | 156 return None |
| 157 | 157 |
| 158 def add_options(parser): | 158 def add_options(parser): |
| 159 chrome_opts = optparse.OptionGroup(parser, 'Chrome tracing options') | 159 chrome_opts = optparse.OptionGroup(parser, 'Chrome tracing options') |
| 160 chrome_opts.add_option('-c', '--categories', help='Select Chrome tracing ' | 160 chrome_opts.add_option('-c', '--categories', help='Select Chrome tracing ' |
| 161 'categories with comma-delimited wildcards, ' | 161 'categories with comma-delimited wildcards, ' |
| 162 'e.g., "*", "cat1*,-cat1a". Omit this option to trace ' | 162 'e.g., "*", "cat1*,-cat1a". Omit this option to trace ' |
| 163 'Chrome\'s default categories. Chrome tracing can be ' | 163 'Chrome\'s default categories. Chrome tracing can be ' |
| 164 'disabled with "--categories=\'\'". Use "list" to ' | 164 'disabled with "--categories=\'\'". Use "list" to ' |
| 165 'see the available categories.', | 165 'see the available categories.', |
| 166 metavar='CHROME_CATEGORIES', dest='chrome_categories', | 166 metavar='CHROME_CATEGORIES', dest='chrome_categories') |
| 167 default=_DEFAULT_CHROME_CATEGORIES) | |
| 168 chrome_opts.add_option('--trace-cc', | 167 chrome_opts.add_option('--trace-cc', |
| 169 help='Deprecated, use --trace-frame-viewer.', | 168 help='Deprecated, use --trace-frame-viewer.', |
| 170 action='store_true') | 169 action='store_true') |
| 171 chrome_opts.add_option('--trace-frame-viewer', | 170 chrome_opts.add_option('--trace-frame-viewer', |
| 172 help='Enable enough trace categories for ' | 171 help='Enable enough trace categories for ' |
| 173 'compositor frame viewing.', action='store_true') | 172 'compositor frame viewing.', action='store_true') |
| 174 chrome_opts.add_option('--trace-ubercompositor', | 173 chrome_opts.add_option('--trace-ubercompositor', |
| 175 help='Enable enough trace categories for ' | 174 help='Enable enough trace categories for ' |
| 176 'ubercompositor frame data.', action='store_true') | 175 'ubercompositor frame data.', action='store_true') |
| 177 chrome_opts.add_option('--trace-gpu', help='Enable extra trace categories ' | 176 chrome_opts.add_option('--trace-gpu', help='Enable extra trace categories ' |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 206 categories.append('disabled-by-default-toplevel.flow') | 205 categories.append('disabled-by-default-toplevel.flow') |
| 207 if config.trace_memory: | 206 if config.trace_memory: |
| 208 categories.append('disabled-by-default-memory') | 207 categories.append('disabled-by-default-memory') |
| 209 if config.trace_scheduler: | 208 if config.trace_scheduler: |
| 210 categories.append('disabled-by-default-blink.scheduler') | 209 categories.append('disabled-by-default-blink.scheduler') |
| 211 categories.append('disabled-by-default-cc.debug.scheduler') | 210 categories.append('disabled-by-default-cc.debug.scheduler') |
| 212 categories.append('disabled-by-default-renderer.scheduler') | 211 categories.append('disabled-by-default-renderer.scheduler') |
| 213 if config.chrome_categories: | 212 if config.chrome_categories: |
| 214 categories += config.chrome_categories.split(',') | 213 categories += config.chrome_categories.split(',') |
| 215 return categories | 214 return categories |
| OLD | NEW |