summaryrefslogtreecommitdiff
path: root/common/scripts/coresight-test.sh
blob: 808e9098ae55346492ea593e0d712af787b9be17 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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