Compare commits

..

2 Commits

Author SHA1 Message Date
Wenchao Hao a8443bb0ad update
Signed-off-by: Wenchao Hao <haowenchao22@gmail.com>
2025-09-02 16:05:22 +08:00
Wenchao Hao da93ff2b1b update
Signed-off-by: Wenchao Hao <haowenchao22@gmail.com>
2025-09-02 14:54:43 +08:00
2 changed files with 4 additions and 30 deletions

View File

@ -1,29 +0,0 @@
#!/usr/bin/python3
import uiautomator2 as u2
import time
def clear_all_apps():
d = u2.connect()
while True:
try:
d.keyevent("HOME")
d.keyevent("HOME")
d.keyevent("312")
time.sleep(1)
if "com.miui.home:id/recents_container" not in d.dump_hierarchy():
continue
if "近期没有任何内容" in d.dump_hierarchy():
d.keyevent("HOME")
d.keyevent("HOME")
exit(0)
d.xpath('//*[@resource-id="com.miui.home:id/clearAnimView"]').click_exists(timeout=3)
d.keyevent("HOME")
d.keyevent("HOME")
except Exception as e:
print("clear_all_apps errors", e)
d = u2.connect()
continue
if __name__=="__main__":
clear_all_apps()

5
run.sh
View File

@ -70,6 +70,9 @@ mkdir $dir/thpmaps
echo "round app start_type start_time rss pss pagefaults minorfaults majorfaults itlbmiss dtlbmiss cpustall inc_ratio order4_ratio order4_cont inc_total nr_direct_reclaim" > $dir/result
adb shell cat /sys/kernel/mm/transparent_hugepage/hugepages-64kB/enabled > $dir/hugepages-64kB_enabled
adb shell cat /sys/kernel/mm/mthp_compact/enabled > $dir/mthp_compact_enabled
for round in $(seq 1 $cycle); do
# 重启并等待重启完成
echo "rebooting"
@ -243,7 +246,7 @@ for round in $(seq 1 $cycle); do
echo $round $app $start_type $start_time $rss $pss $pagefaults $minorfaults $majorfaults $itlbmiss $dtlbmiss $cpustall $inc_ratio $inc_total $order4_ratio $order4_cont $nr_inc_direct_reclaim >> $dir/result
if [ $clear_background -ne 0 ]; then
python3 clear_apps.py
./clearapp.sh
fi
rm tmp.txt