summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2019-05-18 23:26:31 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2019-05-18 23:26:31 +0000
commitad7643b1a8dfe5daa0ed601a6e46e85db0c2caaa (patch)
tree2e90306717a093988763ca8a9f7341ad78fc4310
parent9f3fe616554718ac4f8bf523c4d55f2debfa2e3c (diff)
parentc3961e7d74734c7632fc6157ad82ef6e3bca4abc (diff)
downloadextras-ad7643b1a8dfe5daa0ed601a6e46e85db0c2caaa.tar.gz
Snap for 5582435 from c3961e7d74734c7632fc6157ad82ef6e3bca4abc to qt-qpr1-release
Change-Id: I23658ac430edf9c010f7093de8e19b1a1f0aca6c
-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)