Compare commits

..

No commits in common. "a8443bb0ad901e412a2d409f02ffbc5c4c13d8c3" and "eaa21b20af7343e4bd8ce1c07fb40690562cf0da" have entirely different histories.

2 changed files with 30 additions and 4 deletions

29
clear_apps.py Executable file
View File

@ -0,0 +1,29 @@
#!/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,9 +70,6 @@ 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"
@ -246,7 +243,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
./clearapp.sh
python3 clear_apps.py
fi
rm tmp.txt