Chromium Code Reviews| Index: systrace/bin/adb_profile_chrome_startup |
| diff --git a/systrace/bin/adb_profile_chrome_startup b/systrace/bin/adb_profile_chrome_startup |
| index 80a266bfd2272c735466acbaed728a8b6284e2c1..016f8caf17996b1b580b8c357015fa11bed5c6ed 100755 |
| --- a/systrace/bin/adb_profile_chrome_startup |
| +++ b/systrace/bin/adb_profile_chrome_startup |
| @@ -26,6 +26,9 @@ sys.path.append(os.path.join(_CATAPULT_DIR, 'devil')) |
| from devil.android import device_utils |
| +_DEFAULT_CHROME_CATEGORIES = '_DEFAULT_CHROME_CATEGORIES' |
| + |
| + |
| def _CreateOptionParser(): |
| parser = optparse.OptionParser(description='Record about://tracing profiles ' |
| 'from Android browsers startup, combined with ' |
| @@ -45,7 +48,7 @@ def _CreateOptionParser(): |
| 'with gzip. ', action='store_true') |
| parser.add_option('-t', '--time', help='Stops tracing after N seconds, 0 to ' |
| 'manually stop (startup trace ends after at most 5s).', |
| - default=5, metavar='N', type='int') |
| + default=5, metavar='N', type='int', dest='trace_time') |
| parser.add_option_group(chrome_startup_tracing_agent.add_options(parser)) |
| parser.add_option_group(atrace_tracing_agent.add_options(parser)) |
| @@ -68,29 +71,39 @@ def main(): |
| device = devices[0] |
| package_info = profiler.GetSupportedBrowsers()[options.browser] |
| + options.chrome_startup = True |
|
Sami
2016/09/01 12:15:59
Why are we overriding the options set by the user
washingtonp
2016/09/01 17:44:41
adb_profile_chrome_startup does not provide the us
Sami
2016/09/02 12:57:42
My worry is that in 1) the list will quickly get o
washingtonp
2016/09/02 20:10:27
I like that idea, and have implemented it in the m
|
| + options.device = device |
| + options.package_info = package_info |
| + options.ring_buffer = False |
| + options.trace_memory = False |
| + options.trace_cc = None |
| + options.trace_frame_viewer = None |
| + options.trace_ubercompositor = None |
| + options.trace_gpu = None |
| + options.trace_flow = None |
| + options.trace_scheduler = None |
| + options.ddms = None |
| + options.perf_categories = None |
| + options.list_categories = None |
| + options.link_assets = None |
| + options.asset_dir = None |
| + options.timeout = None |
| + options.collection_timeout = None |
| + options.device_serial_number = device |
| + options.target = None |
| + options.chrome_categories = _DEFAULT_CHROME_CATEGORIES |
| + if options.output_file: |
| + options.output_file = os.path.expanduser(options.output_file) |
| + |
| if options.atrace_categories in ['list', 'help']: |
| ui.PrintMessage('\n'.join( |
| atrace_tracing_agent.AtraceAgent.GetCategories(device))) |
| return 0 |
| - atrace_categories = (options.atrace_categories.split(',') |
| - if options.atrace_categories else []) |
| - enabled_agents = [] |
| - # Enable the atrace and chrome agents. The atrace agent should go |
| - # first because otherwise the resulting traces miss early atrace data. |
| - if atrace_categories: |
| - enabled_agents.append(atrace_tracing_agent.AtraceAgent( |
| - device, atrace_categories, False)) |
| - enabled_agents.append( |
| - chrome_startup_tracing_agent.ChromeStartupTracingAgent( |
| - device, package_info, options.cold, options.url)) |
| - if options.output: |
| - options.output = os.path.expanduser(options.output) |
| result = profiler.CaptureProfile(options, |
| - enabled_agents, |
| - options.time, |
| - output=options.output, |
| + options.trace_time, |
| + output=options.output_file, |
| compress=options.compress, |
| - write_json=options.json) |
| + write_json=options.write_json) |
| if options.view: |
| if sys.platform == 'darwin': |
| os.system('/usr/bin/open %s' % os.path.abspath(result)) |