diff options
author | Yongqin Liu <yongqin.liu@linaro.org> | 2017-04-05 20:01:46 +0800 |
---|---|---|
committer | Yongqin Liu <yongqin.liu@linaro.org> | 2017-04-05 20:01:46 +0800 |
commit | 93287429e767436ee301d88b76990be751d0862d (patch) | |
tree | fefecaca65bb393a71b6f0929007e6e851f5dd9e /android | |
parent | e44487d9bc843caeb39222743ed19a19dc3a8153 (diff) |
bootchart: support AOSP master
Change-Id: I104bf26c187673942324ffa9195f4627cb375504
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
Diffstat (limited to 'android')
-rwxr-xr-x | android/scripts/bootchart.sh | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/android/scripts/bootchart.sh b/android/scripts/bootchart.sh index 183dc46..d80e98f 100755 --- a/android/scripts/bootchart.sh +++ b/android/scripts/bootchart.sh @@ -25,8 +25,10 @@ LOGROOT="/data/bootchart" start_f="${LOGROOT}/start" +enabled_f="${LOGROOT}/enabled" stop_f="${LOGROOT}/stop" -TARBALL="/data/local/tmp/bootchart.tgz" +DATA_TMP="/data/local/tmp" +TARBALL="${DATA_TMP}/bootchart.tgz" start_bootchart(){ echo "${BOOTCHART_TIME}" > ${start_f} @@ -37,14 +39,23 @@ start_bootchart(){ fi } +enabled_bootchart(){ + touch ${enabled_f} + if [ $? -ne 0 ]; then + echo "enabled_bootchart: fail" + else + echo "enabled_bootchart: pass" + fi +} + stop_bootchart(){ - echo 1 > ${stop_f} + echo 1 > ${stop_f} if [ $? -ne 0 ]; then echo "stop_bootchart: fail" else echo "stop_bootchart: pass" fi - rm ${start_f} + rm -fr ${start_f} ${enabled_f} if [ $? -ne 0 ]; then echo "rm_start_file: fail" else @@ -58,14 +69,20 @@ collect_data(){ echo "There is no ${LOGROOT} directory!" return fi - cd ${LOGROOT} + cd ${LOGROOT} || exit 1 + # shellcheck disable=SC2086 tar -czvf ${TARBALL} ${FILES} if [ $? -ne 0 ]; then echo "bootchart_collect_data: fail" else echo "bootchart_collect_data: pass" fi + # shellcheck disable=SC2086 rm -fr ${FILES} + cd ${DATA_TMP} || exit 1 + if [ -n "$(which lava-test-run-attach)" ]; then + lava-test-run-attach bootchart.tgz application/x-gzip + fi } main(){ @@ -82,6 +99,7 @@ main(){ case "X${OPERATION}" in "Xstart") start_bootchart + enabled_bootchart ;; "Xstop") stop_bootchart |