summaryrefslogtreecommitdiff
path: root/common/scripts/coresight-test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'common/scripts/coresight-test.sh')
-rwxr-xr-xcommon/scripts/coresight-test.sh44
1 files changed, 44 insertions, 0 deletions
diff --git a/common/scripts/coresight-test.sh b/common/scripts/coresight-test.sh
new file mode 100755
index 0000000..808e909
--- /dev/null
+++ b/common/scripts/coresight-test.sh
@@ -0,0 +1,44 @@
+#!/bin/bash
+# Script to test coresight
+
+CORESIGHT_PATH="/sys/kernel/debug/coresight"
+
+ETM=`ls $CORESIGHT_PATH | grep -m 1 etm`
+if [ $ETM ]
+then
+echo "ETM is $ETM"
+else
+echo "No ETM found"
+exit
+fi
+
+ETB=`ls $CORESIGHT_PATH | grep -m 1 etb`
+if [ $ETB ]
+then
+echo "ETB is $ETB"
+else
+echo "No ETB found"
+exit
+fi
+
+wrt_ptr1=`cat $CORESIGHT_PATH/$ETB/status | grep wrt | awk '{print $NF}'`
+echo 1 > $CORESIGHT_PATH/$ETM/enable
+sleep 1
+echo 0 > $CORESIGHT_PATH/$ETM/enable
+wrt_ptr2=`cat $CORESIGHT_PATH/$ETB/status | grep wrt | awk '{print $NF}'`
+
+#echo $wrt_ptr1
+#echo $wrt_ptr2
+
+echo
+if [ $wrt_ptr1 == $wrt_ptr2 ]
+then
+echo "coresight write FAIL"
+else
+echo "coresight write SUCCESS"
+fi
+echo
+
+
+
+