1set -e 2 3if ! [ -e $ANDROID_BUILD_TOP/external/chromium-trace/systrace.py ]; then 4 echo "error: can't find systrace.py at \$ANDROID_BUILD_TOP/external/chromium-trace/systrace.py" 5 exit 1 6fi 7 8adb shell "sleep 1; atrace -b 65536 --async_start adb sched power freq idle disk mmc load" 9adb shell killall adbd 10adb wait-for-device 11echo "press enter to finish..." 12read 13TRACE_TEMP=`mktemp /tmp/trace.XXXXXX` 14echo Saving trace to ${TRACE_TEMP}, html file to ${TRACE_TEMP}.html 15adb shell atrace --async_stop -z > ${TRACE_TEMP} 16$ANDROID_BUILD_TOP/external/chromium-trace/systrace.py --from-file=${TRACE_TEMP} -o ${TRACE_TEMP}.html 17chrome ${TRACE_TEMP}.html 18