Compare commits

..

No commits in common. "5974fcb1c87c751b955b1d77cc23f263bd962dd8" and "d86304795d1becd86486bf4f2fd795c0512644f9" have entirely different histories.

1 changed files with 8 additions and 9 deletions

17
run.sh
View File

@ -1,35 +1,37 @@
#$dirput: round app start_time start_type rss pss ratio pagefault itlbmiss dtlbmiss cpustalled
# 检查多个设备
# 如果有多台设备需要先手动export ANDROID_SERIAL=xxx运作这个脚本
nr_dev=$(adb devices | grep -v "List of devices" | grep device -c)
if [ $nr_dev -gt 1 ] && [ -z "$ANDROID_SERIAL" ] ; then
echo "adb: more than one device/emulator"
exit
fi
# 如果只有1台设备默认测试该设备
if [ -z "$ANDROID_SERIAL" ]; then
sid=$(adb devices | grep -v "List of devices" | grep device | awk '{print $1}')
export ANDROID_SERIAL=$sid
fi
echo $ANDROID_SERIAL
# adb root并推送perfetto配置文件
adb root
adb push perfconf.txt /data/misc/perfetto-configs
if [ $? -ne 0 ]; then
exit
fi
dir=$ANDROID_SERIAL/$(/usr/bin/date +%Y-%m%d-%H%M)
mkdir -p $dir
mkdir $dir/system_mem
mkdir $dir/battery
mkdir $dir/traces
mkdir $dir/meminfo
mkdir $dir/simpleperf
echo "round app start_type start_time inc_ratio inc_total rss pss pagefaults itlbmiss dtlbmiss cpustall" > $dir/result
for round in $(seq 1 3); do
for round in $(seq 1 1); do
for app in `cat applist`; do
sleep 3
@ -63,9 +65,6 @@ for round in $(seq 1 3); do
sleep 1
echo "starting $activity"
# 抓电池信息
adb shell "dumpsys battery" > $dir/battery/battery-$app-$round
prev_alloc=$(adb shell cat /sys/kernel/mm/transparent_hugepage/hugepages-64kB/stats/anon_fault_alloc)
prev_alloc_fallback=$(adb shell cat /sys/kernel/mm/transparent_hugepage/hugepages-64kB/stats/anon_fault_fallback)