summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJongHeon Choi <j-h.choi@samsung.com>2017-01-04 11:20:15 +0900
committerJongHeon Choi <j-h.choi@samsung.com>2017-01-16 17:54:11 +0900
commitaaf7f9ebdb31954599e59ee4a770867f6fc26825 (patch)
tree9e9c8caa079e4762133f5925e1f76b8ea4ee4182
parent4a3f29faebc1a96ce5197a25934538d79f0b1687 (diff)
downloadlauncher-aaf7f9ebdb31954599e59ee4a770867f6fc26825.tar.gz
launcher-aaf7f9ebdb31954599e59ee4a770867f6fc26825.tar.bz2
launcher-aaf7f9ebdb31954599e59ee4a770867f6fc26825.zip
Add tool option for check launching memory
Change-Id: Id683972b75950ff031550bd74c3d4003fb41d032
-rwxr-xr-xtools/memorystamp.sh57
-rwxr-xr-xtools/performance_test.sh144
2 files changed, 169 insertions, 32 deletions
diff --git a/tools/memorystamp.sh b/tools/memorystamp.sh
new file mode 100755
index 0000000..6db944f
--- /dev/null
+++ b/tools/memorystamp.sh
@@ -0,0 +1,57 @@
+#!/bin/bash
+
+if [[ -z $1 ]] || [[ -z $2 ]]
+then
+ echo "[!] Execute [./performance_test.sh]"
+ exit 0
+fi
+
+LOG_FILE=$1
+RESULT_FILE=$2
+WAIT_FOR_LAUNCH=10
+
+APP_MEMORY=$(sdb shell "memps -v | grep 'Available'" | tail -1)
+BEFORE_MEMORY=($(echo $APP_MEMORY | awk '{print $5}'))
+while inotifywait -qqre modify "$LOG_FILE"; do
+ sleep $WAIT_FOR_LAUNCH
+ APP_MEMORY=$(sdb shell "memps -v | grep 'Tizen.exe'" | tail -1)
+ MEMORY_PID=($(echo $APP_MEMORY | awk '{print $1}'))
+ MEMORY_PSS=($(echo $APP_MEMORY | awk '{print $7}'))
+ MEMORY_3D=($(echo $APP_MEMORY | awk '{print $8}'))
+ MEMORY_GEM=($(echo $APP_MEMORY | awk '{print $9}'))
+ APP_MEMORY=$(sdb shell "memps -v | grep 'Available'" | tail -1)
+ AFTER_MEMORY=($(echo $APP_MEMORY | awk '{print $5}'))
+ let MEMORY_FREE=$BEFORE_MEMORY-$AFTER_MEMORY
+ echo -e "PSS\t3D\tGEM\tFREE" | tee -a $RESULT_FILE
+ echo -e "$MEMORY_PSS\t$MEMORY_3D\t$MEMORY_GEM\t$MEMORY_FREE" | tee -a $RESULT_FILE
+ DETAIL_MEMORY=$(sdb shell "memps $MEMORY_PID" | while read line
+ do
+ DETAIL_MEMORY_LIST=$line
+ DETAIL_PCODE=($(echo $DETAIL_MEMORY_LIST | awk '{print $3}' | tr -d '\r'))
+ DETAIL_PDATA=($(echo $DETAIL_MEMORY_LIST | awk '{print $4}' | tr -d '\r'))
+ if [[ $DETAIL_PCODE != "P(CODE)" ]] && [[ $DETAIL_PDATA != "P(DATA)" ]] &&
+ [[ $DETAIL_PCODE != "--------" ]] && [[ $DETAIL_PDATA != "--------" ]]
+ then
+ let DETAIL_SUM=$DETAIL_PCODE+$DETAIL_PDATA
+ if [[ $DETAIL_SUM -ge 100 ]]
+ then
+ DETAIL_OBJECT=($(echo $DETAIL_MEMORY_LIST | awk '{print $6}'))
+ echo -n "$DETAIL_SUM\t$DETAIL_OBJECT"
+ echo ""
+ fi
+ fi
+ done | sort -n -r | tr -d '\r'
+ )
+ echo -e "P(C+D)\tOBJECT NAME" | tee -a $RESULT_FILE
+ for item in ${DETAIL_MEMORY[*]}
+ do
+ echo -e $item | tee -a $RESULT_FILE
+ done
+ echo -e "" | tee -a $RESULT_FILE
+ sleep 3
+ sdb shell kill -9 $MEMORY_PID
+ sleep $WAIT_FOR_LAUNCH
+ echo -e "T(ms)\tAPP ID" | tee -a $RESULT_FILE
+ APP_MEMORY=$(sdb shell "memps -v | grep 'Available'" | tail -1)
+ BEFORE_MEMORY=($(echo $APP_MEMORY | awk '{print $5}'))
+done
diff --git a/tools/performance_test.sh b/tools/performance_test.sh
index fa42f79..370f425 100755
--- a/tools/performance_test.sh
+++ b/tools/performance_test.sh
@@ -60,33 +60,30 @@ install_tpk ()
for item in ${TPKS[*]}
do
-# INSTALL_MSG=$(sdb install tpk/$item | grep start)
-# INSTALL_MSG=$(echo $INSTALL_MSG | sed "s/\[/ /g")
-# INSTALL_MSG=$(echo $INSTALL_MSG | sed "s/\]/ /g")
-# PKG_IDS+=($(echo $INSTALL_MSG | awk '{print $7}'))
- INSTALL_PKG=$(sdb install tpk/$item | grep start | sed "s/\[/ /g" | sed "s/\]/ /g" | awk '{print $7}' | tr -d '\r')
- PKG_IDS+=$INSTALL_PKG
- #($(echo $INSTALL_PKG)
- echo " [>] $INSTALL_PKG installs complete"
+ INSTALL_MSG=$(sdb install tpk/$item | grep start)
+ INSTALL_MSG=$(echo $INSTALL_MSG | sed "s/\[/ /g")
+ INSTALL_MSG=$(echo $INSTALL_MSG | sed "s/\]/ /g")
+ PKG_IDS+=($(echo $INSTALL_MSG | awk '{print $7}' | tr -d '\r'))
+ echo " [>] ($(echo $INSTALL_MSG | awk '{print $7}')) installs complete"
done
}
get_current_tpk_apps ()
{
echo "[>] Get application list in device"
- PKG_IDS+=$(
- sdb shell "su - owner -c 'pkgcmd -l | grep tpk'" | while read line
- do
- APP_LIST_ENTITY=$line
- APP_LIST_ENTITY=$(echo $APP_LIST_ENTITY | sed "s/\[/ /g")
- APP_LIST_ENTITY=$(echo $APP_LIST_ENTITY | sed "s/\]/ /g")
- APP_OWNER=($(echo $APP_LIST_ENTITY | awk '{print $1}'))
- if [[ $APP_OWNER == 'user' ]]
- then
- echo $APP_LIST_ENTITY | awk '{print $6}'
- fi
- done | sort | tr -d '\r'
- )
+# PKG_IDS+=$(
+# sdb shell "su - owner -c 'pkgcmd -l | grep tpk'" | while read line
+# do
+# APP_LIST_ENTITY=$line
+# APP_LIST_ENTITY=$(echo $APP_LIST_ENTITY | sed "s/\[/ /g")
+# APP_LIST_ENTITY=$(echo $APP_LIST_ENTITY | sed "s/\]/ /g")
+# APP_OWNER=($(echo $APP_LIST_ENTITY | awk '{print $1}'))
+# if [[ $APP_OWNER == 'user' ]]
+# then
+# echo $APP_LIST_ENTITY | awk '{print $6}'
+# fi
+# done | sort | tr -d '\r'
+# )
#In 3.0 mobile / wearable, appfw install all of application to global application
PKG_IDS+=$(
sdb shell "su - owner -c 'ls -al /opt/usr/globalapps/ | grep tizenglobalapp'" | while read line
@@ -131,7 +128,7 @@ initialize_first_launch ()
execute_time_stamp_auto ()
{
echo ""
- echo "[>] Start performance test that applciation launching "
+ echo "[>] Start performance test that applciation launching time"
echo ""
#execute dlogstreamer
sdb shell "dlogutil -c"
@@ -142,11 +139,27 @@ execute_time_stamp_auto ()
TIMESTAMP_PID=$!
}
+execute_time_stamp_auto_memory ()
+{
+ echo ""
+ echo "[>] Start performance test that applciation launching memory"
+ echo ""
+ sdb shell "dlogutil -c"
+ sdb shell "dlogutil -v time AUL APP_CORE|grep -E 'app_request_to_launchpad_for_uid.*[SECURE_LOG].*launch.*request|__show_cb.*[EVENT_TEST][EVENT]'" >> $STREAM_LOG_FILE &
+ DLOG_STREAMER_PID=$!
+#execute timestamp
+ /bin/bash ./timestamp.sh $STREAM_LOG_FILE $RESULT_LOG_FILE &
+ TIMESTAMP_PID=$!
+#execute memorystamp
+ /bin/bash ./memorystamp.sh $STREAM_LOG_FILE $RESULT_LOG_FILE &
+ MEMORYSTAMP_PID=$!
+}
+
execute_time_stamp_manual ()
{
#execute dlogstreamer
echo ""
- echo "[>] Start performance test that applciation launching "
+ echo "[>] Start performance test that applciation launching time"
echo ""
rm $STREAM_LOG_FILE
touch $STREAM_LOG_FILE
@@ -163,7 +176,7 @@ execute_time_stamp_manual_trace ()
{
#execute dlogstreamer
echo ""
- echo "[>] Start performance test that applciation launching "
+ echo "[>] Start performance test that applciation launching time"
echo ""
rm $STREAM_LOG_FILE
touch $STREAM_LOG_FILE
@@ -181,6 +194,25 @@ execute_time_stamp_manual_trace ()
rm result/*.raw
}
+execute_time_stamp_manual_memory ()
+{
+ echo ""
+ echo "[>] Start performance test that applciation launching memory"
+ echo ""
+ rm $STREAM_LOG_FILE
+ touch $STREAM_LOG_FILE
+ sdb shell "dlogutil -c"
+ sdb shell "dlogutil -v time AUL APP_CORE|grep -E 'app_request_to_launchpad_for_uid.*[SECURE_LOG].*launch.*request|__show_cb.*[EVENT_TEST][EVENT]'" >> $STREAM_LOG_FILE &
+ DLOG_STREAMER_PID=$!
+#execute timestamp
+ /bin/bash ./timestamp.sh $STREAM_LOG_FILE $RESULT_LOG_FILE &
+ TIMESTAMP_PID=$!
+#execute memorystamp
+ /bin/bash ./memorystamp.sh $STREAM_LOG_FILE $RESULT_LOG_FILE &
+ MEMORYSTAMP_PID=$!
+ wait $MEMORYSTAMP_PID
+}
+
execute_all_app ()
{
#execute each apps
@@ -206,7 +238,11 @@ execute_all_app_trace ()
TTRACE_PID=$!
sleep 1
APP_LIST_MSG=$(sdb shell "su - owner -c 'app_launcher -s $item'")
+ if [[ "${LONG_LAUNCHING_APP[@]}" =~ "${item}" ]]; then
+ sleep $WAIT_FOR_LONG_LAUNCH
+ else
sleep $WAIT_FOR_LAUNCH
+ fi
APP_LIST_MSG=$(sdb shell "su - owner -c 'app_launcher -t $item'")
sleep $WAIT_FOR_KILL
sleep 4
@@ -215,6 +251,24 @@ execute_all_app_trace ()
rm result/*.raw
}
+execute_all_app_memory ()
+{
+ sleep $WAIT_FOR_LAUNCH
+#execute each apps
+ for item in ${APP_IDS[*]}
+ do
+ if [[ "${LONG_LAUNCHING_APP[@]}" =~ "${item}" ]]; then
+ echo ""
+ else
+ APP_LIST_MSG=$(sdb shell "su - owner -c 'app_launcher -s $item'")
+ sleep $WAIT_FOR_LONG_LAUNCH
+ #APP_LIST_MSG=$(sdb shell "su - owner -c 'app_launcher -t $item'")
+ sleep $WAIT_FOR_KILL
+ fi
+ sleep $WAIT_FOR_LONG_LAUNCH
+ done
+}
+
finalize ()
{
echo ""
@@ -231,6 +285,7 @@ destory ()
kill -9 $DLOG_STREAMER_PID>/dev/null 2>&1
kill -9 $TIMESTAMP_PID>/dev/null 2>&1
kill -9 $TTRACE_PID>/dev/null 2>&1
+ kill -9 $MEMORYSTAMP_PID>/dev/null 2>&1
rm $STREAM_LOG_FILE>/dev/null 2>&1
sdb shell "devicectl display start">/dev/null 2>&1
echo "[>] Finalize for Performance Test"
@@ -241,11 +296,13 @@ help ()
{
echo ""
echo "[!] usage : <script> [option]"
- echo " options : -a --auto full automatic test"
+ echo " options : -a --auto full automatic launching time test"
echo " : (suboption for auto) -s --skip-install skip install tpk (execute tpk app in device)"
- echo " : -m --manual execute application manually "
- echo " : -ta --ttrace-auto full automatic test with ttrace"
- echo " : -tm --ttrace-manual execute only one application manually with ttrace"
+ echo " : -m --manual execute application manually"
+ echo " : -am --auto-memory full automatic launching memory test"
+ echo " : -mm --manual-memory execute application manually with memory test"
+ echo " : -at --auto-ttrace full automatic launching time test with ttrace"
+ echo " : -mt --manual-ttrace execute application manually with ttrace"
echo "example : ./performance_test.sh --auto"
echo ""
}
@@ -269,7 +326,7 @@ then
execute_time_stamp_auto
execute_all_app
finalize
-elif [[ $1 == '-m' ]] || [[ $1 == "--manual" ]]
+elif [[ $1 == "-m" ]] || [[ $1 == "--manual" ]]
then
echo ""
echo "[>] Start with MANUAL mode"
@@ -277,7 +334,30 @@ then
initialize
execute_time_stamp_manual
finalize
-elif [[ $1 == '-ta' ]] || [[ $1 == "--ttrace-auto" ]]
+elif [[ $1 == "-am" ]] || [[ $1 == "--auto-memory" ]]
+then
+ echo ""
+ echo "[>] Launching Memory Profiling with AUTO mode"
+ initialize
+ if [[ $2 == "-s" ]] || [[ $2 == "--skip-install" ]]
+ then
+ get_current_tpk_apps
+ else
+ install_tpk
+ fi
+ make_appid_list
+ initialize_first_launch
+ execute_time_stamp_auto_memory
+ execute_all_app_memory
+ finalize
+elif [[ $1 == "-mm" ]] || [[ $1 == "--manual-memory" ]]
+then
+ echo ""
+ echo "[>] Launching Memory Profiling with MANUAL mode"
+ initialize
+ execute_time_stamp_manual_memory
+ finalize
+elif [[ $1 == "-at" ]] || [[ $1 == "--auto-ttrace" ]]
then
echo ""
echo "[>] Start with T-trace Auto mode"
@@ -293,7 +373,7 @@ then
execute_time_stamp_auto
execute_all_app_trace
finalize
-elif [[ $1 == '-tm' ]] || [[ $1 == "--ttrace-manual" ]]
+elif [[ $1 == "-mt" ]] || [[ $1 == "--manual-ttrace" ]]
then
echo ""
echo "[>] Start with T-trace Manual mode"
@@ -303,4 +383,4 @@ then
finalize
else
help
-fi \ No newline at end of file
+fi