import optparse
import os
import re
+import select
import shutil
import sys
import threading
sys.stdout.flush()
+def _WaitForEnter(timeout):
+ select.select([sys.stdin], [], [], timeout)
+
+
def _StartTracing(controllers, interval):
for controller in controllers:
controller.StartTracing(interval)
try:
_StartTracing(controllers, interval)
if interval:
- _PrintMessage('Capturing %d-second %s. Press Ctrl-C to stop early...' % \
+ _PrintMessage('Capturing %d-second %s. Press Enter to stop early...' % \
(interval, trace_type), eol='')
- time.sleep(interval)
+ _WaitForEnter(interval)
else:
_PrintMessage('Capturing %s. Press Enter to stop...' % trace_type, eol='')
raw_input()
- except KeyboardInterrupt:
- _PrintMessage('\nInterrupted...', eol='')
finally:
_StopTracing(controllers)
if interval:
def _ComputeChromeCategories(options):
categories = []
- if options.trace_cc:
+ if options.trace_frame_viewer:
+ categories.append('disabled-by-default-cc.debug')
+ if options.trace_ubercompositor:
categories.append('disabled-by-default-cc.debug*')
if options.trace_gpu:
categories.append('disabled-by-default-gpu.debug*')
'available categories. Systrace is disabled by '
'default.', metavar='SYS_CATEGORIES',
dest='systrace_categories', default='')
- categories.add_option('--trace-cc', help='Enable extra trace categories for '
- 'compositor frame viewer data.', action='store_true')
+ categories.add_option('--trace-cc',
+ help='Deprecated, use --trace-frame-viewer.',
+ action='store_true')
+ categories.add_option('--trace-frame-viewer',
+ help='Enable enough trace categories for '
+ 'compositor frame viewing.', action='store_true')
+ categories.add_option('--trace-ubercompositor',
+ help='Enable enough trace categories for '
+ 'ubercompositor frame data.', action='store_true')
categories.add_option('--trace-gpu', help='Enable extra trace categories for '
'GPU data.', action='store_true')
parser.add_option_group(categories)
parser.add_option('-z', '--compress', help='Compress the resulting trace '
'with gzip. ', action='store_true')
options, args = parser.parse_args()
+ if options.trace_cc:
+ parser.parse_error("""--trace-cc is deprecated.
+
+For basic jank busting uses, use --trace-frame-viewer
+For detailed study of ubercompositor, pass --trace-ubercompositor.
+
+When in doubt, just try out --trace-frame-viewer.
+""")
if options.verbose:
logging.getLogger().setLevel(logging.DEBUG)