diff options
author | Vijay Dandiga <vijay.dandiga@linaro.org> | 2014-12-10 20:43:40 +0530 |
---|---|---|
committer | Vijay Dandiga <vijay.dandiga@linaro.org> | 2014-12-10 20:48:46 +0530 |
commit | 5566000145b124b9a95296dfe6994e07d2a56836 (patch) | |
tree | 0ae2e759d20a56b4e3a1770c98fea63f29954898 /common/scripts/coresight-test1.sh | |
parent | 370d8c6d1459a9feecee624ae60cdeca72c0b64a (diff) |
Add coresight test script working version
Diffstat (limited to 'common/scripts/coresight-test1.sh')
-rw-r--r-- | common/scripts/coresight-test1.sh | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/common/scripts/coresight-test1.sh b/common/scripts/coresight-test1.sh new file mode 100644 index 0000000..f6b24af --- /dev/null +++ b/common/scripts/coresight-test1.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# Script to test coresight + +CORESIGHT_PATH="/sys/bus/coresight/devices" + +echo -e "SOURCE\tSINK\tRESULT" +echo -e "------\t----\t------" +for SOURCE in `ls $CORESIGHT_PATH | egrep "etm|ptm"` ; do + for SINK in `ls $CORESIGHT_PATH | grep etb` ; do + + echo 1 > $CORESIGHT_PATH/$SINK/enable_sink + + wrt_ptr1=`cat $CORESIGHT_PATH/$SINK/status | grep wrt | awk '{print $NF}'` + echo 1 > $CORESIGHT_PATH/$SOURCE/enable_source + sleep 1 + echo 0 > $CORESIGHT_PATH/$SOURCE/enable_source + wrt_ptr2=`cat $CORESIGHT_PATH/$SINK/status | grep wrt | awk '{print $NF}'` + + echo 0 > $CORESIGHT_PATH/$SINK/enable_sink + + if [ $wrt_ptr1 == $wrt_ptr2 ]; + then + RES="FAIL" + else + RES="SUCCESS" + fi + + echo -e "$SOURCE\t$SINK\t$RES" + done + echo +done + |