summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2019-05-16 03:03:59 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2019-05-16 03:03:59 +0000
commitdd783b814bf045ff631c32645c15ed9c94133de6 (patch)
tree2e90306717a093988763ca8a9f7341ad78fc4310
parent7bb75de623695cad15ec2fac759a1e881379552d (diff)
parent84d06f1474fbd39d1430fce55595d7929c9ecdf7 (diff)
downloadextras-dd783b814bf045ff631c32645c15ed9c94133de6.tar.gz
Snap for 5571215 from 84d06f1474fbd39d1430fce55595d7929c9ecdf7 to qt-release
Change-Id: I27c030b5e2ae6cb533c6ccf055a13acfa35a707e
-rwxr-xr-xboottime_tools/bootanalyze/bootanalyze.py12
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)