From 18d5035a75c3a065801cbe078f1478c2a8682432 Mon Sep 17 00:00:00 2001 From: Vijay Dandiga Date: Wed, 17 Sep 2014 03:29:18 +0530 Subject: Adding coresight-test.sh Signed-off-by: Vijay Dandiga --- common/scripts/coresight-test.sh | 44 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100755 common/scripts/coresight-test.sh (limited to 'common') 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 + + + + -- cgit v1.2.3