OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright 2014 The Chromium Authors. All rights reserved. | 3 # Copyright 2014 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 import logging | 7 import logging |
8 import optparse | 8 import optparse |
9 import os | 9 import os |
10 import sys | 10 import sys |
(...skipping 17 matching lines...) Expand all Loading... |
28 if options.trace_frame_viewer: | 28 if options.trace_frame_viewer: |
29 categories.append('disabled-by-default-cc.debug') | 29 categories.append('disabled-by-default-cc.debug') |
30 if options.trace_ubercompositor: | 30 if options.trace_ubercompositor: |
31 categories.append('disabled-by-default-cc.debug*') | 31 categories.append('disabled-by-default-cc.debug*') |
32 if options.trace_gpu: | 32 if options.trace_gpu: |
33 categories.append('disabled-by-default-gpu.debug*') | 33 categories.append('disabled-by-default-gpu.debug*') |
34 if options.trace_flow: | 34 if options.trace_flow: |
35 categories.append('disabled-by-default-toplevel.flow') | 35 categories.append('disabled-by-default-toplevel.flow') |
36 if options.trace_memory: | 36 if options.trace_memory: |
37 categories.append('disabled-by-default-memory') | 37 categories.append('disabled-by-default-memory') |
| 38 if options.trace_scheduler: |
| 39 categories.append('disabled-by-default-cc.debug.scheduler') |
38 if options.chrome_categories: | 40 if options.chrome_categories: |
39 categories += options.chrome_categories.split(',') | 41 categories += options.chrome_categories.split(',') |
40 return categories | 42 return categories |
41 | 43 |
42 | 44 |
43 def _ComputeSystraceCategories(options): | 45 def _ComputeSystraceCategories(options): |
44 if not options.systrace_categories: | 46 if not options.systrace_categories: |
45 return [] | 47 return [] |
46 return options.systrace_categories.split(',') | 48 return options.systrace_categories.split(',') |
47 | 49 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 chrome_opts.add_option('--trace-ubercompositor', | 105 chrome_opts.add_option('--trace-ubercompositor', |
104 help='Enable enough trace categories for ' | 106 help='Enable enough trace categories for ' |
105 'ubercompositor frame data.', action='store_true') | 107 'ubercompositor frame data.', action='store_true') |
106 chrome_opts.add_option('--trace-gpu', help='Enable extra trace categories ' | 108 chrome_opts.add_option('--trace-gpu', help='Enable extra trace categories ' |
107 'for GPU data.', action='store_true') | 109 'for GPU data.', action='store_true') |
108 chrome_opts.add_option('--trace-flow', help='Enable extra trace categories ' | 110 chrome_opts.add_option('--trace-flow', help='Enable extra trace categories ' |
109 'for IPC message flows.', action='store_true') | 111 'for IPC message flows.', action='store_true') |
110 chrome_opts.add_option('--trace-memory', help='Enable extra trace categories ' | 112 chrome_opts.add_option('--trace-memory', help='Enable extra trace categories ' |
111 'for memory profile. (tcmalloc required)', | 113 'for memory profile. (tcmalloc required)', |
112 action='store_true') | 114 action='store_true') |
| 115 chrome_opts.add_option('--trace-scheduler', help='Enable extra trace ' |
| 116 'categories for scheduler state', |
| 117 action='store_true') |
113 parser.add_option_group(chrome_opts) | 118 parser.add_option_group(chrome_opts) |
114 | 119 |
115 systrace_opts = optparse.OptionGroup(parser, 'Systrace tracing options') | 120 systrace_opts = optparse.OptionGroup(parser, 'Systrace tracing options') |
116 systrace_opts.add_option('-s', '--systrace', help='Capture a systrace with ' | 121 systrace_opts.add_option('-s', '--systrace', help='Capture a systrace with ' |
117 'the chosen comma-delimited systrace categories. You ' | 122 'the chosen comma-delimited systrace categories. You ' |
118 'can also capture a combined Chrome + systrace by ' | 123 'can also capture a combined Chrome + systrace by ' |
119 'enable both types of categories. Use "list" to see ' | 124 'enable both types of categories. Use "list" to see ' |
120 'the available categories. Systrace is disabled by ' | 125 'the available categories. Systrace is disabled by ' |
121 'default.', metavar='SYS_CATEGORIES', | 126 'default.', metavar='SYS_CATEGORIES', |
122 dest='systrace_categories', default='') | 127 dest='systrace_categories', default='') |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 enabled_controllers, | 249 enabled_controllers, |
245 options.time if not options.continuous else 0, | 250 options.time if not options.continuous else 0, |
246 output=options.output, | 251 output=options.output, |
247 compress=options.compress, | 252 compress=options.compress, |
248 write_json=options.json) | 253 write_json=options.json) |
249 if options.view: | 254 if options.view: |
250 if sys.platform == 'darwin': | 255 if sys.platform == 'darwin': |
251 os.system('/usr/bin/open %s' % os.path.abspath(result)) | 256 os.system('/usr/bin/open %s' % os.path.abspath(result)) |
252 else: | 257 else: |
253 webbrowser.open(result) | 258 webbrowser.open(result) |
OLD | NEW |