From 3c7abdcef8ec25274b5c69a362eec9960e430038 Mon Sep 17 00:00:00 2001 From: Wenchao Hao Date: Thu, 15 May 2025 17:30:00 +0800 Subject: [PATCH] udpate Signed-off-by: Wenchao Hao --- cold_start_app.sh | 2 +- run.sh | 29 +++++++++++++++-------------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/cold_start_app.sh b/cold_start_app.sh index e0aface..fe50e83 100755 --- a/cold_start_app.sh +++ b/cold_start_app.sh @@ -55,7 +55,7 @@ echo -e "$inc_ratio\t$inc_total" > $dir/ratio-"$app"-"$round".txt sleep 3 -adb pull /data/misc/perfetto-traces/trace-"$app"-"$round".ptrace $dir/ +adb pull /data/misc/perfetto-traces/trace-"$app"-"$round".ptrace $dir/traces adb pull /data/local/tmp/simpleperf-"$app"-"$round".txt $dir/ adb shell "rm /data/misc/perfetto-traces/trace-"$app"-"$round".ptrace" diff --git a/run.sh b/run.sh index cc48589..474fe19 100755 --- a/run.sh +++ b/run.sh @@ -9,7 +9,8 @@ fi dir=$(/usr/bin/date +%Y-%m%d-%H%M) mkdir $dir -mkdir $dir/mminfo +mkdir $dir/system_mem +mkdir $dir/traces echo "round app start_type start_time inc_ratio inc_total rss pss pagefaults itlbmiss dtlbmiss cpustall" > $dir/result for round in $(seq 1 2); do @@ -17,27 +18,27 @@ for round in $(seq 1 2); do sleep 3 # 抓内存相关信息 - adb shell free -h > $dir/mminfo/before_free-$app-$round - adb shell cat /proc/meminfo > $dir/mminfo/before_meminfo-$app-$round - adb shell cat /proc/zoneinfo > $dir/mminfo/before_zoneinfo-$app-$round - adb shell cat /proc/buddyinfo > $dir/mminfo/before_buddyinfo-$app-$round - adb shell cat /proc/pagetypeinfo > $dir/mminfo/before_pagetypeinfo-$app-$round - adb shell cat /proc/vmstat > $dir/mminfo/before_vmstat-$app-$round + adb shell free -h > $dir/system_mem/before_free-$app-$round + adb shell cat /proc/meminfo > $dir/system_mem/before_meminfo-$app-$round + adb shell cat /proc/zoneinfo > $dir/system_mem/before_zoneinfo-$app-$round + adb shell cat /proc/buddyinfo > $dir/system_mem/before_buddyinfo-$app-$round + adb shell cat /proc/pagetypeinfo > $dir/system_mem/before_pagetypeinfo-$app-$round + adb shell cat /proc/vmstat > $dir/system_mem/before_vmstat-$app-$round ./cold_start_app.sh $app $round $dir # 回到桌面,应用退后台 adb shell input keyevent 3 - adb shell free -h > $dir/mminfo/after_free-$app-$round - adb shell cat /proc/meminfo > $dir/mminfo/after_meminfo-$app-$round - adb shell cat /proc/zoneinfo > $dir/mminfo/after_zoneinfo-$app-$round - adb shell cat /proc/buddyinfo > $dir/mminfo/after_buddyinfo-$app-$round - adb shell cat /proc/pagetypeinfo > $dir/mminfo/after_pagetypeinfo-$app-$round - adb shell cat /proc/vmstat > $dir/mminfo/after_vmstat-$app-$round + adb shell free -h > $dir/system_mem/after_free-$app-$round + adb shell cat /proc/meminfo > $dir/system_mem/after_meminfo-$app-$round + adb shell cat /proc/zoneinfo > $dir/system_mem/after_zoneinfo-$app-$round + adb shell cat /proc/buddyinfo > $dir/system_mem/after_buddyinfo-$app-$round + adb shell cat /proc/pagetypeinfo > $dir/system_mem/after_pagetypeinfo-$app-$round + adb shell cat /proc/vmstat > $dir/system_mem/after_vmstat-$app-$round # 计算启动耗时 - python3 handle_perfetto.py $dir/trace-"$app"-"$round".ptrace mm > tmp.txt + python3 handle_perfetto.py $dir/traces/trace-"$app"-"$round".ptrace mm > tmp.txt if [ $(cat tmp.txt | wc -l) -ne 1 ]; then start_time=0