From 52df920fd6caa810da62bb0e6bcc4da3434248e6 Mon Sep 17 00:00:00 2001 From: Josh Gao Date: Tue, 13 Dec 2016 14:24:12 -0800 Subject: [PATCH] adb: add script to trace adbd. Bug: http://b/31289465 Test: sh trace.sh Change-Id: Id6e20e83742541aec6bfd9f4112adbdadc078f74 --- adb/sysdeps_win32_test.cpp | 0 adb/trace.sh | 17 +++++++++++++++++ 2 files changed, 17 insertions(+) mode change 100755 => 100644 adb/sysdeps_win32_test.cpp create mode 100755 adb/trace.sh diff --git a/adb/sysdeps_win32_test.cpp b/adb/sysdeps_win32_test.cpp old mode 100755 new mode 100644 diff --git a/adb/trace.sh b/adb/trace.sh new file mode 100755 index 000000000..49e50264f --- /dev/null +++ b/adb/trace.sh @@ -0,0 +1,17 @@ +set -e + +if ! [ -e $ANDROID_BUILD_TOP/external/chromium-trace/systrace.py ]; then + echo "error: can't find systrace.py at \$ANDROID_BUILD_TOP/external/chromium-trace/systrace.py" + exit 1 +fi + +adb shell "sleep 1; atrace -b 65536 --async_start adb sched power freq idle disk mmc load" +adb shell killall adbd +adb wait-for-device +echo "press enter to finish..." +read +TRACE_TEMP=`mktemp /tmp/trace.XXXXXX` +echo Saving trace to ${TRACE_TEMP}, html file to ${TRACE_TEMP}.html +adb shell atrace --async_stop -z > ${TRACE_TEMP} +$ANDROID_BUILD_TOP/external/chromium-trace/systrace.py --from-file=${TRACE_TEMP} -o ${TRACE_TEMP}.html +chrome ${TRACE_TEMP}.html