diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2019-05-23 00:09:06 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2019-05-23 00:09:06 +0000 |
commit | 9ef54cc3262f02c2a5f42d62b8043d1a5611cd01 (patch) | |
tree | 2e90306717a093988763ca8a9f7341ad78fc4310 | |
parent | 3ef3ae4609c939ed07679ab6e3f586ad6e54a035 (diff) | |
parent | dd783b814bf045ff631c32645c15ed9c94133de6 (diff) | |
download | extras-9ef54cc3262f02c2a5f42d62b8043d1a5611cd01.tar.gz |
Snap for 5571616 from dd783b814bf045ff631c32645c15ed9c94133de6 to qt-aml-release
Change-Id: I9793a07bc468791813655f60b0bbfd73743be1e0
-rwxr-xr-x | boottime_tools/bootanalyze/bootanalyze.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/boottime_tools/bootanalyze/bootanalyze.py b/boottime_tools/bootanalyze/bootanalyze.py index f765cb99..095f8995 100755 --- a/boottime_tools/bootanalyze/bootanalyze.py +++ b/boottime_tools/bootanalyze/bootanalyze.py @@ -309,7 +309,7 @@ def iterate(args, search_events_pattern, timings_pattern, shutdown_events_patter # sleep to make sure that logcat reader is reading before adb is gone by reboot. ugly but make # impl simple. t = threading.Thread(target = lambda : (time.sleep(2), reboot(args.serial, args.stressfs != '',\ - args.permissive, args.adb_reboot))) + args.permissive, args.adb_reboot, args.buffersize))) t.start() shutdown_events, shutdown_timing_events = handle_reboot_log(True, shutdown_events_pattern,\ components_to_monitor) @@ -531,6 +531,9 @@ def init_arguments(): parser.add_argument('-y', '--systrace', dest='systrace', action='store_true', help='collect systrace from the device. kernel trace should be already enabled', ) + parser.add_argument('-G', '--buffersize', dest='buffersize', action='store', type=str, + default=None, + help='set logcat buffersize') return parser.parse_args() def handle_zygote_event(zygote_pids, events, event, line): @@ -763,7 +766,7 @@ def do_reboot(serial, use_adb_reboot): retry += 1 return False -def reboot(serial, use_stressfs, permissive, use_adb_reboot): +def reboot(serial, use_stressfs, permissive, use_adb_reboot, adb_buffersize=None): if use_stressfs: print 'Starting write to data partition' run_adb_shell_cmd('am start' +\ @@ -783,6 +786,11 @@ def reboot(serial, use_stressfs, permissive, use_adb_reboot): print 'Waiting the device' run_adb_cmd('wait-for-device') + if adb_buffersize is not None: + # increase the buffer size + if run_adb_cmd('logcat -G {}'.format(adb_buffersize)) != 0: + debug('Fail to set logcat buffer size as {}'.format(adb_buffersize)) + def run_adb_cmd(cmd): return subprocess.call(ADB_CMD + ' ' + cmd, shell=True) |