Add cmdline to enable check mthp status
Signed-off-by: Wenchao Hao <haowenchao22@gmail.com>
This commit is contained in:
parent
b3a78b5960
commit
f2039d631c
20
run.sh
20
run.sh
|
|
@ -3,8 +3,9 @@
|
|||
cycle=3
|
||||
wait=3
|
||||
clear_background=0
|
||||
mthp_stat=0
|
||||
|
||||
while getopts ":s:c:w:h:C" opt
|
||||
while getopts ":s:c:w:h:C:T" opt
|
||||
do
|
||||
case $opt in
|
||||
s)
|
||||
|
|
@ -19,6 +20,9 @@ do
|
|||
w)
|
||||
wait=$OPTARG
|
||||
;;
|
||||
T)
|
||||
mthp_stat=1
|
||||
;;
|
||||
h)
|
||||
echo "usage: run.sh -s sid -c cycle -w wait_seconds"
|
||||
exit 1
|
||||
|
|
@ -30,6 +34,7 @@ do
|
|||
echo "-c: specify applist startup cycle"
|
||||
echo "-w: specify wait time after app start, before start next app, default 10 s"
|
||||
echo "-C: if to kill all background apps before start app"
|
||||
echo "-T: if check app's mTHP status"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
|
@ -176,10 +181,15 @@ for round in $(seq 1 $cycle); do
|
|||
fi
|
||||
|
||||
# 计算大页占比
|
||||
app_pid=$(adb shell "ps -ef" | grep $app | head -n 1 | awk '{print $2}')
|
||||
python3 thpmaps_v3_vir_cont.py --pid $app_pid --rollup --inc-empty --cont 64k > $dir/thpmaps/thp-$app-$round
|
||||
order4_ratio=$(cat $dir/thpmaps/thp-$app-$round | grep "anon-thp-pte-aligned-64kB" | awk -F '(' '{print $2}' | sed 's/)//g')
|
||||
order4_cont=$(cat $dir/thpmaps/thp-$app-$round | grep "anon-cont-pte-aligned-64kB" | awk -F '(' '{print $2}' | sed 's/)//g')
|
||||
if [ $mthp_stat -eq 1 ]; then
|
||||
app_pid=$(adb shell "ps -ef" | grep $app | head -n 1 | awk '{print $2}')
|
||||
python3 thpmaps_v3_vir_cont.py --pid $app_pid --rollup --inc-empty --cont 64k > $dir/thpmaps/thp-$app-$round
|
||||
order4_ratio=$(cat $dir/thpmaps/thp-$app-$round | grep "anon-thp-pte-aligned-64kB" | awk -F '(' '{print $2}' | sed 's/)//g')
|
||||
order4_cont=$(cat $dir/thpmaps/thp-$app-$round | grep "anon-cont-pte-aligned-64kB" | awk -F '(' '{print $2}' | sed 's/)//g')
|
||||
else
|
||||
order4_ratio=0
|
||||
order4_cont=0
|
||||
fi
|
||||
|
||||
pagefaults=$(cat $dir/simpleperf/simpleperf-"$app"-"$round".txt | grep 'page-faults' | awk '{print $4}')
|
||||
itlbmiss=$(cat $dir/simpleperf/simpleperf-"$app"-"$round".txt | grep 'iTLB-load-misses' | awk '{print $4}')
|
||||
|
|
|
|||
Loading…
Reference in New Issue