blob: 49e50264f778885a0a231cab61d1a47dab7c135a [file] [log] [blame]
Josh Gao80e97692016-12-13 14:24:12 -08001set -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