summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorYongqin Liu <yongqin.liu@linaro.org>2016-11-21 12:58:41 +0800
committerYongqin Liu <yongqin.liu@linaro.org>2016-11-21 12:58:41 +0800
commit2d252a05ae88500d304b7a012894ee126d01051d (patch)
tree5d19fac66782b2fabd95d9e696b788a411209d53 /android
parentddd59cb83b18f770c949807453184c25bc45a61c (diff)
improvement on boottime2
Change-Id: Ie83676c5f55005575e77fde874fac1d9e8c6cebe Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
Diffstat (limited to 'android')
-rwxr-xr-xandroid/scripts/boottime2.sh22
-rw-r--r--android/scripts/common.sh3
2 files changed, 21 insertions, 4 deletions
diff --git a/android/scripts/boottime2.sh b/android/scripts/boottime2.sh
index 3662139..f7f23b6 100755
--- a/android/scripts/boottime2.sh
+++ b/android/scripts/boottime2.sh
@@ -4,12 +4,12 @@ local_file_path="$0"
local_file_parent=$(cd $(dirname ${local_file_path}); pwd)
. ${local_file_parent}/common.sh
-dir_boottime_data="/data/local/tmp/boottime"
+local_tmp="/data/local/tmp/"
+dir_boottime_data="${local_tmp}/boottime"
F_RAW_DATA_CSV="${dir_boottime_data}/boot_time_raw_data.csv"
F_STATISTIC_DATA_CSV="${dir_boottime_data}/boot_time_statistic_data.csv"
-
# dmeg line example
# [ 7.410422] init: Starting service 'logd'...
getTime(){
@@ -95,6 +95,7 @@ if [ "X${OPERATION}" = "XCOLLECT" ]; then
elif [ "X${OPERATION}" = "XANALYZE" ]; then
count=$2
i=1
+ G_RESULT_NOT_RECORD=TRUE
while true; do
if [ $i -gt $count ]; then
break
@@ -102,7 +103,22 @@ elif [ "X${OPERATION}" = "XANALYZE" ]; then
getBootTimeInfoFromDmesg ${i}
i=$((i+1))
done
- cd ${dir_boottime_data}
+ G_RESULT_NOT_RECORD=FALSE
+ if [ "X${G_RECORD_LOCAL_CSV}" = "XTRUE" ]; then
+ statistic ${F_RAW_DATA_CSV} 2 |tee ${F_STATISTIC_DATA_CSV}
+ sed -i 's/=/,/' "${F_STATISTIC_DATA_CSV}"
+
+ for line in $(cat "${F_STATISTIC_DATA_CSV}"); do
+ if ! echo "$line"|grep -q ,; then
+ continue
+ fi
+ local key=$(echo $line|cut -d, -f1)
+ local measurement=$(echo $line|cut -d, -f2)
+ local units=$(echo $line|cut -d, -f3)
+ output_test_result "${key}" "pass" "${measurement}" "${units}"
+ done
+ fi
+ cd ${local_tmp}
tar -czvf boottime.tgz boottime
lava-test-run-attach boottime.tgz application/x-gzip
output_test_result "BOOTTIME_ANALYZE" "pass"
diff --git a/android/scripts/common.sh b/android/scripts/common.sh
index bc4a526..819523a 100644
--- a/android/scripts/common.sh
+++ b/android/scripts/common.sh
@@ -3,6 +3,7 @@
G_LOOP_COUNT=12
G_RECORD_LOCAL_CSV=TRUE
G_VERBOSE_OUTPUT=FALSE
+G_RESULT_NOT_RECORD=FALSE
F_RAW_DATA_CSV="/data/local/tmp/lava_test_shell_raw_data.csv"
F_STATISTIC_DATA_CSV="/data/local/tmp/lava_test_shell_statistic_data.csv"
@@ -161,7 +162,7 @@ output_test_result(){
fi
local cmd="lava-test-case"
- if [ -n "$(which $cmd)" ];then
+ if [ "X${G_RESULT_NOT_RECORD}" = "XFALSE" ] && [ -n "$(which $cmd)" ];then
$cmd ${lava_paras}
elif [ "X${G_VERBOSE_OUTPUT}" = "XTRUE" ];then
echo "$cmd ${lava_paras}"