M7350v1_en_gpl

This commit is contained in:
T
2024-09-09 08:52:07 +00:00
commit f9cc65cfda
65988 changed files with 26357421 additions and 0 deletions
@@ -0,0 +1,26 @@
BOARD_PLATFORM_LIST := msm8974
BOARD_PLATFORM_LIST += msm8226
BOARD_PLATFORM_LIST += msm8610
ifeq ($(call is-board-platform-in-list,$(BOARD_PLATFORM_LIST)),true)
LOCAL_PATH := $(call my-dir)
define ADD_TEST
include $(CLEAR_VARS)
LOCAL_MODULE := $1
LOCAL_SRC_FILES := $1
LOCAL_MODULE_CLASS := EXECUTABLE
LOCAL_MODULE_TAGS := debug
LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/kernel-tests/coresight/core
include $(BUILD_PREBUILT)
endef
TEST_LIST := cs_adversary.sh cs_common.sh cs_test.sh run.sh README.txt
$(foreach TEST,$(TEST_LIST),$(eval $(call ADD_TEST,$(TEST))))
include $(LOCAL_PATH)/*/Android.mk
endif
@@ -0,0 +1,88 @@
Test: coresight
Usage: cs_test.sh [-n | --nominal] [-a | --adversarial] [-r | --repeatability]\
[-s | stress ]
Runs the tests for CoreSight trace drivers.
Options:
The following options can be used:
-n | --nominal nominal test, runs by default
-a | --adversarial adversarial test
-r | --repeatability iterations repeatability test, runs 10
iterations by default
-s | --stress stress test
--source trace_source trace source, supported
trace_source values are 'etm'
and 'stm'
Requirement:
CoreSight ETM and STM sources are initially disabled before running any test.
Description:
Nominal Test:
All CoreSight tests are invoked.
Adversarial Test:
Runs cs_adversary.sh. This test enables all trace sources, all ftrace events and
toggles the cpu cores on/off.
Repeatability Tests:
All test cases except probe test are invoked for user specified number of iterations,
or for 10 iterations by default.
Stress Test:
All test cases except probe test are invoked for 100 iterations.
Test case description:
1. platform/platform.sh
Tests that CoreSight trace drivers are probed without failures.
2. etm/etm_enable.sh
Tests ETM tracing gets properly enabled.
3. etm/etm_disable.sh
Tests ETM tracing get properly disabled.
4. stm/stm_enable.sh
Tests STM tracing gets properly enabled.
5. stm/stm_disable.sh
Tests STM tracing gets properly disabled.
6. stm/stm_etf_dump.sh
Tests ETF can be dumped with good data while STM is the only trace source. All ftrace,
hardware events are disabled while single string data is sent over STM. Once trailing
zeros of output file are truncated, size is compared with reference size for same
input data.
7. stm/stm_etr_dump.sh
Please refer to stm/stm_etf_dump.sh. Here ETR is the trace sink instead of ETM.
8. mult_trace/mult_source_enable.sh
Tests that multiple CoreSight trace sources (ETM and STM) can be successfully enabled
at the same time.
9. mult_trace/mult_source_disable.sh
Tests that multiple CoreSight trace sources (ETM and STM) can be successfully disabled
at the same time.
10. sink_switch/sinkswitch.sh
Tests that the device can switch between multiple CoreSight tracesinks. Assumes etf,
etr and tpiu sinks are present.
11. sink_switch/etr_modes.sh
Tests that the modes of ETR can be changed from usb to memory and vice versa.
12. cs_adversary.sh
While having trace sources enabled, enables and disables all cores in a loop.
Targets supported: 8974
Test output:
All tests prints:
"PASS: <message>" if the test case passes
or
"FAIL: <message>" otherwise
Note: Tests assume /data partition exists
@@ -0,0 +1,87 @@
#!/bin/sh
# Copyright (c) 2013, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of The Linux Foundation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
online_offline_cores() {
cores=`grep -c "processor" $cpuinfo`
count=1
loop=10
stop mpdecision
#off-on each core in sequence. Repeat 10 times
for i in $(seq 1 $loop)
do
while [ $count -lt $cores ]
do
echo 0 > $cpupath$count"/online"
sleep 1
echo 1 > $cpupath$count"/online"
count=$(( count + 1 ))
done
done
#off-on multiple cores at a time. Repeat 10 times
loop=10
count=1
for i in $(seq 1 $loop)
do
while [ $count -lt $cores ]
do
echo 0 > $cpupath$count"/online"
count=$(( count + 1 ))
done
sleep 1
count=1
while [ $count -lt $cores ]
do
echo 1 > $cpupath$count"/online"
count=$(( count + 1 ))
done
done
start mpdecision
}
echo "-----Coresight Trace Driver Adversarial Test Starting-----"
echo "----------------------------------------------------------"
source "$(dirname $0)/cs_common.sh"
etm_enable_all_cores
stm_enable
if [ ! -d $debugfs ]
then
mkdir -p $debugfs
fi
mount -t debugfs nodev $debugfs 2>"/dev/null"
echo 1 > $debugfs"/tracing/tracing_on"
echo 1 > $debugfs"/tracing/events/enable"
echo "*:*" > $debugfs"/tracing/set_event"
online_offline_cores
etm_disable_all_cores
stm_disable
umount $debugfs 2>"/dev/null"
echo "PASS: Online-Offline all cores with trace drivers enabled"
echo "-----Coresight Trace Driver Adversarial Test Complete-----"
echo "----------------------------------------------------------"
echo ""
+236
View File
@@ -0,0 +1,236 @@
#!/bin/sh
# Copyright (c) 2013, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of The Linux Foundation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
cpupath="/sys/devices/system/cpu/cpu"
cpuinfo="/proc/cpuinfo"
csrpath="/sys/bus/coresight/devices/coresight-csr"
debugfs="/sys/kernel/debug"
etmpath="/sys/bus/coresight/devices/coresight-etm"
f0path="/sys/bus/coresight/devices/coresight-funnel-in0"
f1path="/sys/bus/coresight/devices/coresight-funnel-in1"
fmergpath="/sys/bus/coresight/devices/coresight-funnel-merg"
fkpsspath="/sys/bus/coresight/devices/coresight-funnel-kpss"
fmmsspath="/sys/bus/coresight/devices/coresight-funnel-mmss"
replicatorpath="/sys/bus/coresight/devices/coresight-replicator"
stmpath="/sys/bus/coresight/devices/coresight-stm"
tmcetfpath="/sys/bus/coresight/devices/coresight-tmc-etf"
tmcetrpath="/sys/bus/coresight/devices/coresight-tmc-etr"
tpiupath="/sys/bus/coresight/devices/coresight-tpiu"
#===============================================================
#function to enable etm for all cores
#returns 0 if etm for all cores are present and could be written to, 1 otherwise
#===============================================================
etm_enable_all_cores() {
count=0
retval=0
cores=`grep -c "processor" $cpuinfo`
stop mpdecision
while [ $count -lt $cores ]
do
etmpath_enable=$etmpath$count"/enable"
cpupath_enable=$cpupath$count"/online"
echo 1 > $cpupath_enable
if [ -f $etmpath_enable ]
then
echo 1 > $etmpath_enable
else
echo "FAIL: No coresight-etm$count driver present ****"
retval=1
fi
count=$(( count + 1 ))
done
start mpdecision
return $retval
}
#=============================================================
#function to test if etm of all cores are enabled
#returns 0 if all cores are enabled, 1 otherwise
#=============================================================
etm_test_if_enabled() {
count=0
retval=0
cores=`grep -c "processor" $cpuinfo`
while [ $count -lt $cores ]
do
etmpath_enable=$etmpath$count"/enable"
if [ -f $etmpath_enable ]
then
read value < $etmpath_enable
if [ $value != "1" ]
then
echo "FAIL: coresight-etm$count device not enabled ****"
retval=1
fi
else
retval=1
fi
count=$(( count + 1 ))
done
return $retval
}
#===============================================================
#function to disable etm for all cores
#returns 0 if etm for all cores are present and could be written to, 1 otherwise
#===============================================================
etm_disable_all_cores() {
count=0
retval=0
cores=`grep -c "processor" $cpuinfo`
stop mpdecision
while [ $count -lt $cores ]
do
etmpath_enable=$etmpath$count"/enable"
cpupath_enable=$cpupath$count"/online"
echo 1 > $cpupath_enable
if [ -f $etmpath_enable ]
then
echo 0 > $etmpath_enable
else
echo "FAIL: No coresight-etm$count driver present ****"
retval=1
fi
count=$(( count + 1 ))
done
start mpdecision
return $retval
}
#=============================================================
#function to test if etm of all cores are disabled
#returns 0 if all cores are disabled, 1 otherwise
#=============================================================
etm_test_if_disabled() {
count=0
retval=0
cores=`grep -c "processor" $cpuinfo`
while [ $count -lt $cores ]
do
etmpath_enable=$etmpath$count"/enable"
if [ -f $etmpath_enable ]
then
read value < $etmpath_enable
if [ $value != "0" ]
then
echo "FAIL: coresight-etm$count device not disabled ****"
retval=1
fi
else
retval=1
fi
count=$(( count + 1 ))
done
return $retval
}
#==============================================================
#function to enable stm
#returns 0 if device is written to, 1 otherwise
#==============================================================
stm_enable() {
stmpath_enable=$stmpath"/enable"
if [ -f $stmpath_enable ]
then
echo 1 > $stmpath_enable
retval=0
else
echo "FAIL: No coresight-stm driver present ****"
retval=1
fi
return $retval
}
#==============================================================
#function to test if stm is enabled
#returns 0 on success, 1 otherwise
#==============================================================
stm_test_if_enabled() {
stmpath_enable=$stmpath"/enable"
if [ -f $stmpath_enable ]
then
read value < $stmpath_enable
if [ $value = "1" ]
then
retval=0
else
echo "FAIL: coresight-stm device not enabled ****"
retval=1
fi
else
retval=1
fi
return $retval
}
#==============================================================
#function to disable stm
#returns 0 if device could be written to, 1 otherwise
#==============================================================
stm_disable() {
stmpath_enable=$stmpath"/enable"
if [ -f $stmpath_enable ]
then
echo 0 > $stmpath_enable
retval=0
else
echo "FAIL: No coresight-stm driver present ****"
retval=1
fi
return $retval
}
#===============================================================
#function to test if stm is disabled
#returns 0 on success, 1 otherwise
#===============================================================
stm_test_if_disabled() {
stmpath_enable=$stmpath"/enable"
if [ -f $stmpath_enable ]
then
read value < $stmpath_enable
if [ $value = "0" ]
then
retval=0
else
echo "FAIL: coresight-stm device not disabled ****"
retval=1
fi
else
retval=1
fi
return $retval
}
+242
View File
@@ -0,0 +1,242 @@
#! /bin/sh --
# Copyright (c) 2013, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of The Linux Foundation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Invoked by run.sh
directory=$(cd `dirname $0` && pwd)
#Requirement: Before running test, ensure STM/ETM is initially disabled
cs_test_setup(){
source "$(dirname $0)/cs_common.sh"
retval=0
if [ $stm -eq 1 ]
then
stm_disable
retval=$?
fi
if [ $retval -eq 0 ] && [ $etm -eq 1 ]
then
etm_disable_all_cores
retval=$?
fi
if [ $retval -ne 0 ]
then
echo "Requirement for running test:"
echo "ETM/STM cannot be disabled. Exiting tests"
exit 1
fi
}
cs_nominal(){
cd $directory"/platform" && sh platform.sh
if [ $etm -eq 1 ]
then
cd $directory"/etm" && sh etm_enable.sh
cd $directory"/etm" && sh etm_disable.sh
fi
if [ $stm -eq 1 ]
then
cd $directory"/stm" && sh stm_enable.sh
cd $directory"/stm" && sh stm_disable.sh
cd $directory"/stm" && sh stm_etf_dump.sh
cd $directory"/stm" && sh stm_etr_dump.sh
fi
if [ $stm -eq 1 ] && [ $etm -eq 1 ]
then
cd $directory"/mult_trace" && sh mult_source_enable.sh
cd $directory"/mult_trace" && sh mult_source_disable.sh
fi
cd $directory"/sink_switch" && sh sinkswitch.sh "--source $source"
cd $directory"/sink_switch" && sh etr_modes.sh "--source $source"
}
cs_adversary(){
if [ $stm -eq 1 ] && [ $etm -eq 1 ]
then
cd $directory && sh cs_adversary.sh
else
echo "Both STM and ETM required as trace source."
fi
}
cs_repeatability(){
if [ $# -eq 1 ]
then
run=$1
else
run=10
fi
if [ $etm -eq 1 ]
then
echo "Coresight ETM enable/disable repeat test started for $run
iterations"
for i in $(seq 1 $run)
do
cd $directory"/etm" && sh etm_enable.sh
cd $directory"/etm" && sh etm_disable.sh
done
fi
if [ $stm -eq 1 ]
then
echo "Coresight STM enable/disable repeat test started for $run
iterations"
for i in $(seq 1 $run)
do
cd $directory"/stm" && sh stm_enable.sh
cd $directory"/stm" && sh stm_disable.sh
done
echo "Coresight STM ETF dump test started for $run iterations"
for i in $(seq 1 $run)
do
cd $directory"/stm" && sh stm_etf_dump.sh
done
echo "Coresight STM ETR dump test started for $run iterations"
for i in $(seq 1 $run)
do
cd $directory"/stm" && sh stm_etr_dump.sh
done
fi
if [ $stm -eq 1 ] && [ $etm -eq 1 ]
then
echo "Coresight multi trace enable/disable repeat test started for
$run iterations"
for i in $(seq 1 $run)
do
cd $directory"/mult_trace" && sh mult_source_enable.sh
cd $directory"/mult_trace" && sh mult_source_disable.sh
done
fi
echo "Coresight sink switching repeat test started for $run iterations"
for i in $(seq 1 $run)
do
cd $directory"/sink_switch" && sh sinkswitch.sh "--source $source"
done
echo "Coresight ETR modes change started for $run iterations"
for i in $(seq 1 $run)
do
cd $directory"/sink_switch" && sh etr_modes.sh "--source $source"
done
if [ $stm -eq 1 ] && [ $etm -eq 1 ]
then
echo "CoreSight adversarial repeat test started for $run iterations"
for i in $(seq 1 $run)
do
cd $directory && sh cs_adversary.sh
done
fi
}
cs_stress(){
run=100
echo "Coresight stress test started"
for i in $(seq 1 $run)
do
cs_adversary
done
}
source=`echo "$*" | sed -n 's/.*--source \(\w*\).*/\1/p'`
source=`echo $source | tr '[A-Z]' '[a-z]'`
if [[ "$source" ]]
then
if [[ $source == "stm" ]]
then
echo "All STM tests will be run"
stm=1
etm=0
elif [[ $source == "etm" ]]
then
echo "All ETM tests will be run"
stm=0
etm=1
fi
else
stm=1
etm=1
fi
if [[ $# -le 2 && -n "$source" || $# -eq 0 ]]
then
cs_test_setup
cs_nominal
exit 0
else
while [ $# -gt 0 ]
do
case $1 in
-n | --nominal)
echo "Coresight nominal test started"
cs_test_setup
cs_nominal
shift 1
;;
-a | --adversarial)
echo "Coresight adversarial test started"
cs_test_setup
cs_adversary
shift 1
;;
-r | --repeatability)
echo "Coresight repeatability test started"
shift 1
if [ "$1" -gt 0 ]
then
cs_test_setup
cs_repeatability $1
shift 1
else
echo "Invalid number of iterations, doing 10 iterations by default"
cs_test_setup
cs_repeatability 10
fi
;;
-s | --stress)
echo "Coresight stress test started"
cs_test_setup
cs_repeatability 100
shift 1
;;
--source)
shift 1
shift 1
;;
-h | --help | *)
echo "Usage: $0 [-n | --nominal] [-a | --adversarial ] \\ "
echo " [-r | --repeatability] [iterations] [-s | --stress ] \\"
echo " [--source] [trace_source]"
echo "Runs the coresight driver tests. If no options are provided "
echo "then nominal tests are run. If no iterations are provided for "
echo "repeatability tests, 10 is the default iteration. By default "
echo "both ETM and STM are enabled"
exit 1
;;
esac
done
exit 0
fi
@@ -0,0 +1,16 @@
LOCAL_PATH := $(call my-dir)
define ADD_TEST
include $(CLEAR_VARS)
LOCAL_MODULE := $1
LOCAL_SRC_FILES := $1
LOCAL_MODULE_CLASS := EXECUTABLE
LOCAL_MODULE_TAGS := debug
LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/kernel-tests/coresight/core/etm
include $(BUILD_PREBUILT)
endef
TEST_LIST := etm_enable.sh etm_disable.sh
$(foreach TEST,$(TEST_LIST),$(eval $(call ADD_TEST,$(TEST))))
@@ -0,0 +1,42 @@
#!/bin/sh
# Copyright (c) 2013, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of The Linux Foundation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
echo "-----Coresight ETM Disable Test(allcores) Starting-----"
echo "------------------------------------------------------"
source "$(dirname $0)/../cs_common.sh"
etm_disable_all_cores
etm_test_if_disabled
retval=$?
if [ $retval -eq 0 ]
then
echo "PASS: All ETM devices disabled"
fi
echo "-----Coresight ETM Disable Test(allcores) Complete-----"
echo "------------------------------------------------------"
echo ""
@@ -0,0 +1,42 @@
#!/bin/sh
# Copyright (c) 2013, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of The Linux Foundation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
echo "-----Coresight ETM Enable Test(allcores) Starting-----"
echo "------------------------------------------------------"
source "$(dirname $0)/../cs_common.sh"
etm_enable_all_cores
etm_test_if_enabled
retval=$?
if [ $retval -eq 0 ]
then
echo "PASS: All ETM devices enabled"
fi
echo "-----Coresight ETM Enable Test(allcores) Complete-----"
echo "------------------------------------------------------"
echo ""
@@ -0,0 +1,16 @@
LOCAL_PATH := $(call my-dir)
define ADD_TEST
include $(CLEAR_VARS)
LOCAL_MODULE := $1
LOCAL_SRC_FILES := $1
LOCAL_MODULE_CLASS := EXECUTABLE
LOCAL_MODULE_TAGS := debug
LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/kernel-tests/coresight/core/mult_trace
include $(BUILD_PREBUILT)
endef
TEST_LIST := mult_source_disable.sh mult_source_enable.sh
$(foreach TEST,$(TEST_LIST),$(eval $(call ADD_TEST,$(TEST))))
@@ -0,0 +1,65 @@
#! /bin/sh
# Copyright (c) 2013, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of The Linux Foundation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
echo "-----Coresight Multiple Test Source Disable Test Starting-----"
echo "-------------------------------------------------------------"
source "$(dirname $0)/../cs_common.sh"
etm_disable_all_cores
retval=$?
if [ $retval -eq 1 ]
then
echo "NA: ETM not present for all cores"
else
stm_disable
retval=$?
if [ $retval -eq 1 ]
then
echo "NA: STM not present"
else
etm_test_if_disabled
retval=$?
if [ $retval -eq 1 ]
then
echo "FAIL: ETM is not disabled"
else
stm_test_if_disabled
retval=$?
if [ $retval -eq 1 ]
then
echo "FAIL: STM is not disabled"
else
echo "PASS: both ETM and STM are disabled"
fi
fi
fi
fi
echo "-----Coresight Multiple Test Source Disable Test Complete-----"
echo "--------------------------------------------------------------"
echo ""
@@ -0,0 +1,65 @@
#!/bin/sh
# Copyright (c) 2013, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of The Linux Foundation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
echo "-----Coresight Multiple Test Source Enable Test Starting-----"
echo "-------------------------------------------------------------"
source "$(dirname $0)/../cs_common.sh"
etm_enable_all_cores
retval=$?
if [ $retval -eq 1 ]
then
echo "NA: ETM not present for all cores"
else
stm_enable
retval=$?
if [ $retval -eq 1 ]
then
echo "NA: STM not present"
else
etm_test_if_enabled
retval=$?
if [ $retval -eq 1 ]
then
echo "FAIL: ETM is not enabled"
else
stm_test_if_enabled
retval=$?
if [ $retval -eq 1 ]
then
echo "FAIL: STM is not enabled"
else
echo "PASS: both ETM and STM are enabled"
fi
fi
fi
fi
echo "-----Coresight Multiple Test Source Enable Test Complete-----"
echo "-------------------------------------------------------------"
echo ""
@@ -0,0 +1,9 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := platform.sh
LOCAL_SRC_FILES := platform.sh
LOCAL_MODULE_CLASS := EXECUTABLE
LOCAL_MODULE_TAGS := debug
LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/kernel-tests/coresight/core/platform
include $(BUILD_PREBUILT)
@@ -0,0 +1,107 @@
#! /bin/sh
# Copyright (c) 2013, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of The Linux Foundation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
count=0
source "$(dirname $0)/../cs_common.sh"
echo "-----Coresight Platform Test Starting-----"
echo "------------------------------------------"
if [ -d $csrpath ]
then
echo "PASS: coresight-csr driver initialized"
else
echo "FAIL: coresight-csr driver probe failed ****"
fi
cores=`grep -c "processor" $cpuinfo`
while [ $count -lt $cores ]
do
if [ -d $etmpath$count ]
then
echo "PASS: coresight-etm$count driver initialized"
else
echo "FAIL: coresight-etm$count driver probe failed ****"
fi
count=$(( count + 1 ))
done
if [ -d $f0path ]
then
echo "PASS: coresight-funnel-in0 driver initialized"
else
echo "FAIL: coresight-funnel-in0 driver probe failed ****"
fi
if [ -d $f1path ]
then
echo "PASS: coresight-funnel-in1 driver initialized"
else
echo "FAIL: coresight-funnel-in1 driver probe failed ****"
fi
if [ -d $fmergpath ]
then
echo "PASS: coresight-funnel-merg driver initialized"
else
echo "FAIL: coresight-funnel-merg driver probe failed ****"
fi
if [ -d $fkpsspath ]
then
echo "PASS: coresight-funnel-kpss driver initialized"
else
echo "FAIL: coresight-funnel-kpss driver probe failed ****"
fi
if [ -d $fmmsspath ]
then
echo "PASS: coresight-funnel-mmss driver initialized"
else
echo "FAIL: coresight-funnel-mmss driver probe failed ****"
fi
if [ -d $replicatorpath ]
then
echo "PASS: coresight-replicator driver initialized"
else
echo "FAIL: coresight-replicator driver probe failed ****"
fi
if [ -d $stmpath ]
then
echo "PASS: coresight-stm driver initialized"
else
echo "FAIL: coresight-stm driver probe failed ****"
fi
if [ -d $tmcetfpath ] && [ -d $tmcetrpath ]
then
echo "PASS: coresight-tmc driver initialized"
else
echo "FAIL: coresight-tmc driver probe failed ****"
fi
if [ -d $tpiupath ]
then
echo "PASS: coresight-tpu driver initialized"
else
echo "FAIL: coresight-tpu driver probe failed ****"
fi
echo "-----Coresight Platform Test Complete-----"
echo "------------------------------------------"
echo ""
+32
View File
@@ -0,0 +1,32 @@
#! /bin/sh --
# Copyright (c) 2013, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of The Linux Foundation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
set -e
cd `dirname $0` && exec ./cs_test.sh $@
@@ -0,0 +1,16 @@
LOCAL_PATH := $(call my-dir)
define ADD_TEST
include $(CLEAR_VARS)
LOCAL_MODULE := $1
LOCAL_SRC_FILES := $1
LOCAL_MODULE_CLASS := EXECUTABLE
LOCAL_MODULE_TAGS := debug
LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/kernel-tests/coresight/core/sink_switch
include $(BUILD_PREBUILT)
endef
TEST_LIST := etr_modes.sh sinkswitch.sh
$(foreach TEST,$(TEST_LIST),$(eval $(call ADD_TEST,$(TEST))))
@@ -0,0 +1,77 @@
#!/bin/sh
# Copyright (c) 2013, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of The Linux Foundation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
echo "-----Coresight ETR Switch Modes Test-----"
echo "-----------------------------------------"
source=`echo "$*" | sed -n 's/.*--source \(\w*\).*/\1/p'`
source=`echo $source | tr '[A-Z]' '[a-z]'`
#enable ETM and STM source
source "$(dirname $0)/../cs_common.sh"
if [[ -z "$source" ]]
then
source="all"
fi
if [[ $source != "stm" ]]
then
etm_enable_all_cores
fi
if [[ $source != "etm" ]]
then
stm_enable
fi
etrmode=$tmcetrpath"/out_mode"
#set etr mode to memory before starting test
echo "mem" > $etrmode
#change mode to usb
echo "usb" > $etrmode
value=`cat $etrmode`
if [[ $value != "usb" ]]
then
echo "FAIL: Changing ETR mode from memory to usb failed ****"
else
echo "mem" > $etrmode
value=`cat $etrmode`
if [[ $value != "mem" ]]
then
echo "FAIL: Changing ETR mode from usb to memory failed ****"
else
echo "PASS: Changed ETR modes successfully"
fi
fi
if [[ $source != "stm" ]]
then
etm_disable_all_cores
fi
if [[ $source != "etm" ]]
then
stm_disable
fi
echo "----- Coresight ETR Switch Modes Test Complete-----"
echo "---------------------------------------------------"
echo ""
@@ -0,0 +1,111 @@
#!/bin/sh
# Copyright (c) 2013, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of The Linux Foundation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
etfsink="/sys/bus/coresight/devices/coresight-tmc-etf/curr_sink"
etrsink="/sys/bus/coresight/devices/coresight-tmc-etr/curr_sink"
tpiusink="/sys/bus/coresight/devices/coresight-tpiu/curr_sink"
echo "-----Coresight Sink Switching Test-----"
echo "---------------------------------------"
source=`echo "$*" | sed -n 's/.*--source \(\w*\).*/\1/p'`
source=`echo $source | tr '[A-Z]' '[a-z]'`
#enable ETM and STM source
source "$(dirname $0)/../cs_common.sh"
if [[ -z "$source" ]]
then
source="all"
fi
if [[ $source != "stm" ]]
then
etm_enable_all_cores
fi
if [[ $source != "etm" ]]
then
stm_enable
fi
echo 1 > $etrsink
read etfstatus < $etfsink
read etrstatus < $etrsink
read tpiustatus < $tpiusink
if [ $etfstatus = 0 ] && [ $etrstatus = 1 ] && [ $tpiustatus = 0 ]
then
echo "PASS: Changed current sink to ETR"
else
echo "FAIL: Sink Switching to ETR failed ****"
fi
echo 1 > $tpiusink
read etfstatus < $etfsink
read etrstatus < $etrsink
read tpiustatus < $tpiusink
if [ $etfstatus = 0 ] && [ $etrstatus = 0 ] && [ $tpiustatus = 1 ]
then
echo "PASS: Changed current sink to TPIU"
else
echo "FAIL: Sink Switching to TPIU failed ****"
fi
echo 1 > $etfsink
read etfstatus < $etfsink
read etrstatus < $etrsink
read tpiustatus < $tpiusink
if [ $etfstatus = 1 ] && [ $etrstatus = 0 ] && [ $tpiustatus = 0 ]
then
echo "PASS: Changed current sink to ETF"
else
echo "FAIL: Sink Switching to ETF failed ****"
fi
#test if trace sources are still enabled
if [[ $source != "stm" ]]
then
etm_test_if_enabled
retval=$?
if [ $retval -eq 0 ]
then
echo "PASS: All ETM devices enabled after sink switch"
fi
fi
if [[ $source != "etm" ]]
then
stm_test_if_enabled
retval=$?
if [ $retval -eq 0 ]
then
echo "PASS: STM Enabled after sink switch"
fi
fi
if [[ $source != "stm" ]]
then
etm_disable_all_cores
fi
if [[ $source != "etm" ]]
then
stm_disable
fi
echo "----- Coresight Sink Switching Test Complete-----"
echo "-------------------------------------------------"
echo ""
@@ -0,0 +1,16 @@
LOCAL_PATH := $(call my-dir)
define ADD_TEST
include $(CLEAR_VARS)
LOCAL_MODULE := $1
LOCAL_SRC_FILES := $1
LOCAL_MODULE_CLASS := EXECUTABLE
LOCAL_MODULE_TAGS := debug
LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/kernel-tests/coresight/core/stm
include $(BUILD_PREBUILT)
endef
TEST_LIST := stm_disable.sh stm_enable.sh stm_etf_dump.sh stm_etr_dump.sh
$(foreach TEST,$(TEST_LIST),$(eval $(call ADD_TEST,$(TEST))))
@@ -0,0 +1,46 @@
#! /bin/sh
# Copyright (c) 2013, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of The Linux Foundation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
echo "-----Coresight STM Disable Test Starting-----"
echo "---------------------------------------------"
source "$(dirname $0)/../cs_common.sh"
stm_disable
retval=$?
if [ $retval -eq 0 ]
then
stm_test_if_disabled
retval=$?
if [ $retval -eq 0 ]
then
echo "PASS: STM disabled"
fi
fi
echo "-----Coresight STM Disable Test Complete-----"
echo "---------------------------------------------"
echo ""
@@ -0,0 +1,47 @@
#! /bin/sh
# Copyright (c) 2013, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of The Linux Foundation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
echo "-----Coresight STM Enable Test Starting-----"
echo "--------------------------------------------"
source "$(dirname $0)/../cs_common.sh"
stm_enable
retval=$?
if [ $retval -eq 0 ]
then
stm_test_if_enabled
retval=$?
if [ $retval -eq 0 ]
then
echo "PASS: STM Enabled"
fi
fi
echo "-----Coresight STM Enable Test Complete-----"
echo "--------------------------------------------"
echo ""
@@ -0,0 +1,79 @@
#!/bin/sh
# Copyright (c) 2013, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of The Linux Foundation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
echo "-----Coresight ETF Dump Test for STM Starting-----"
echo "--------------------------------------------------"
source "$(dirname $0)/../cs_common.sh"
stm_port=$stmpath"/port_enable"
stm_hwevent=$stmpath"/hwevent_enable"
if [ ! -d $debugfs ]
then
mkdir $debufgs
fi
mount -t debugfs nodev $debugfs 2>/dev/null
echo 0 > $debugfs"/tracing/events/enable"
#make etf current trace sink
echo 1 > $tmcetfpath"/curr_sink"
stm_enable
#disable hwevents when stm is enabled
echo 0 > $stm_hwevent
echo "stm-dump" > "/dev/coresight-stm"
stm_disable
if [ ! -d "/data/coresight-test" ]
then
mkdir -p "/data/coresight-test"
fi
cat "/dev/coresight-tmc-etf" > "/data/coresight-test/stm_etf.bin"
chmod a+x "/data/coresight-test/stm_etf.bin"
hexdump -ve '1/1 "%.2X"' "/data/coresight-test/stm_etf.bin" > "/data/coresight-test/stm_etf.txt"
brk=0
skip=0
size=0
while [ $brk -eq 0 ]
do
dd if="/data/coresight-test/stm_etf.txt" bs=1 skip=$skip count=16 of="/data/coresight-test/stm_etf.out" 2> /dev/null
if grep '0\{16\}' "/data/coresight-test/stm_etf.out" > /dev/null
then
brk=1
else
size=$(( size + 16 ))
fi
skip=$(( skip + 16 ))
done
if [ $size -eq 160 ]
then
echo "PASS: STM ETF dump test"
else
echo "FAIL: STM ETF dump test"
fi
rm -r "/data/coresight-test"
umount "/sys/kernel/debug" 2>/dev/null
echo "-----Coresight ETF Dump Test for STM Complete-----"
echo "--------------------------------------------------"
echo ""
@@ -0,0 +1,79 @@
#!/bin/sh
# Copyright (c) 2013, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of The Linux Foundation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
echo "-----Coresight ETR Dump Test for STM Starting-----"
echo "--------------------------------------------------"
source "$(dirname $0)/../cs_common.sh"
stm_port=$stmpath"/port_enable"
stm_hwevent=$stmpath"/hwevent_enable"
if [ ! -d $debugfs ]
then
mkdir $debufgs
fi
mount -t debugfs nodev $debugfs 2>/dev/null
echo 0 > $debugfs"/tracing/events/enable"
#make etr current trace sink
echo 1 > $tmcetrpath"/curr_sink"
stm_enable
#disable hwevents when stm is enabled
echo 0 > $stm_hwevent
echo "stm-dump" > "/dev/coresight-stm"
stm_disable
if [ ! -d "/data/coresight-test" ]
then
mkdir -p "/data/coresight-test"
fi
cat "/dev/coresight-tmc-etr" > "/data/coresight-test/stm_etr.bin"
chmod a+x "/data/coresight-test/stm_etr.bin"
hexdump -ve '1/1 "%.2X"' "/data/coresight-test/stm_etr.bin" > "/data/coresight-test/stm_etr.txt"
brk=0
skip=0
size=0
while [ $brk -eq 0 ]
do
dd if="/data/coresight-test/stm_etr.txt" bs=1 skip=$skip count=16 of="/data/coresight-test/stm_etr.out" 2> /dev/null
if grep '0\{16\}' "/data/coresight-test/stm_etr.out" > /dev/null
then
brk=1
else
size=$(( size + 16 ))
fi
skip=$(( skip + 16 ))
done
if [ $size -eq 160 ]
then
echo "PASS: STM ETR dump test"
else
echo "FAIL: STM ETR dump test"
fi
rm -r "/data/coresight-test"
umount "/sys/kernel/debug" 2>/dev/null
echo "-----Coresight ETR Dump Test for STM Complete-----"
echo "--------------------------------------------------"
echo ""