1*288bf522SAndroid Build Coastguard Worker# bootanalyze 2*288bf522SAndroid Build Coastguard Worker 3*288bf522SAndroid Build Coastguard WorkerThe bootanalyze tool helps to profile boot timing. 4*288bf522SAndroid Build Coastguard Worker 5*288bf522SAndroid Build Coastguard Worker[TOC] 6*288bf522SAndroid Build Coastguard Worker 7*288bf522SAndroid Build Coastguard Worker## Preliminaries 8*288bf522SAndroid Build Coastguard Worker 9*288bf522SAndroid Build Coastguard Worker* Need to access "su" on the Device Under Test, e.g. a userdebug build. 10*288bf522SAndroid Build Coastguard Worker* This only works on Linux with Python 2.7, PyYAML and pybootchartgui. 11*288bf522SAndroid Build Coastguard Worker 12*288bf522SAndroid Build Coastguard Worker``` 13*288bf522SAndroid Build Coastguard Workersudo pip install pyyaml 14*288bf522SAndroid Build Coastguard Workersudo apt-get install pybootchartgui 15*288bf522SAndroid Build Coastguard Worker``` 16*288bf522SAndroid Build Coastguard Worker 17*288bf522SAndroid Build Coastguard Worker## Examples 18*288bf522SAndroid Build Coastguard Worker 19*288bf522SAndroid Build Coastguard Worker* bootanalyze.sh provides an example to analyze boot-times and bootcharts. 20*288bf522SAndroid Build Coastguard Worker``` 21*288bf522SAndroid Build Coastguard WorkerANDROID_BUILD_TOP="$PWD" \ 22*288bf522SAndroid Build Coastguard WorkerCONFIG_YMAL="$ANDROID_BUILD_TOP/system/extras/boottime_tools/bootanalyze/config.yaml" \ 23*288bf522SAndroid Build Coastguard Worker LOOPS=3 \ 24*288bf522SAndroid Build Coastguard Worker RESULTS_DIR="$ANDROID_BUILD_TOP/bootAnalyzeResults" \ 25*288bf522SAndroid Build Coastguard Worker $PWD/system/extras/boottime_tools/bootanalyze/bootanalyze.sh 26*288bf522SAndroid Build Coastguard Worker``` 27*288bf522SAndroid Build Coastguard Worker 28*288bf522SAndroid Build Coastguard Worker## config.yaml 29*288bf522SAndroid Build Coastguard WorkerPer specific product modify config.yaml file to include 30*288bf522SAndroid Build Coastguard Workerevents you are looking for. Config should look like: 31*288bf522SAndroid Build Coastguard Worker 32*288bf522SAndroid Build Coastguard Worker stop_event: <logcat log message which will terminate log collection after reboot> 33*288bf522SAndroid Build Coastguard Worker events: 34*288bf522SAndroid Build Coastguard Worker event1_name: <pattern that matches log message> 35*288bf522SAndroid Build Coastguard Worker event2_..... 36*288bf522SAndroid Build Coastguard Worker 37*288bf522SAndroid Build Coastguard WorkerOn some devise clock is showing incorrect time for first couple of seconds after boot. 38*288bf522SAndroid Build Coastguard WorkerTo ensure correct adjustment of time, one has to include event in config that will 39*288bf522SAndroid Build Coastguard Workerbe present in dmesg log after clock correction. 40