3 if [[ -z $1 ]] || [[ -z $2 ]]
5 echo "[!] Execute [./performance_test.sh]"
13 APP_MEMORY=$(sdb shell "memps -v | grep 'Available'" | tail -1)
14 BEFORE_MEMORY=($(echo $APP_MEMORY | awk '{print $5}'))
15 while inotifywait -qqre modify "$LOG_FILE"; do
16 sleep $WAIT_FOR_LAUNCH
17 APP_MEMORY=$(sdb shell "memps -v | grep 'Tizen.exe'" | tail -1)
18 MEMORY_PID=($(echo $APP_MEMORY | awk '{print $1}'))
19 MEMORY_PSS=($(echo $APP_MEMORY | awk '{print $7}'))
20 MEMORY_3D=($(echo $APP_MEMORY | awk '{print $8}'))
21 MEMORY_GEM=($(echo $APP_MEMORY | awk '{print $9}'))
22 APP_MEMORY=$(sdb shell "memps -v | grep 'Available'" | tail -1)
23 AFTER_MEMORY=($(echo $APP_MEMORY | awk '{print $5}'))
24 let MEMORY_FREE=$BEFORE_MEMORY-$AFTER_MEMORY
25 echo -e "PSS\t3D\tGEM\tFREE" | tee -a $RESULT_FILE
26 echo -e "$MEMORY_PSS\t$MEMORY_3D\t$MEMORY_GEM\t$MEMORY_FREE" | tee -a $RESULT_FILE
27 DETAIL_MEMORY=$(sdb shell "memps $MEMORY_PID" | while read line
29 DETAIL_MEMORY_LIST=$line
30 DETAIL_PCODE=($(echo $DETAIL_MEMORY_LIST | awk '{print $3}' | tr -d '\r'))
31 DETAIL_PDATA=($(echo $DETAIL_MEMORY_LIST | awk '{print $4}' | tr -d '\r'))
32 if [[ $DETAIL_PCODE != "P(CODE)" ]] && [[ $DETAIL_PDATA != "P(DATA)" ]] &&
33 [[ $DETAIL_PCODE != "--------" ]] && [[ $DETAIL_PDATA != "--------" ]]
35 let DETAIL_SUM=$DETAIL_PCODE+$DETAIL_PDATA
36 if [[ $DETAIL_SUM -ge 100 ]]
38 DETAIL_OBJECT=($(echo $DETAIL_MEMORY_LIST | awk '{print $6}'))
39 echo -n "$DETAIL_SUM\t$DETAIL_OBJECT"
43 done | sort -n -r | tr -d '\r'
45 echo -e "P(C+D)\tOBJECT NAME" | tee -a $RESULT_FILE
46 for item in ${DETAIL_MEMORY[*]}
48 echo -e $item | tee -a $RESULT_FILE
50 echo -e "" | tee -a $RESULT_FILE
52 sdb shell kill -9 $MEMORY_PID
53 sleep $WAIT_FOR_LAUNCH
54 echo -e "T(ms)\tAPP ID" | tee -a $RESULT_FILE
55 APP_MEMORY=$(sdb shell "memps -v | grep 'Available'" | tail -1)
56 BEFORE_MEMORY=($(echo $APP_MEMORY | awk '{print $5}'))