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

View File

@ -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)
# the test script
include $(CLEAR_VARS)
LOCAL_MODULE := stm_test.sh
LOCAL_SRC_FILES := stm_test.sh
LOCAL_MODULE_CLASS := EXECUTABLES
LOCAL_MODULE_TAGS := debug
LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/kernel-tests/coresight/stm-trace-marker
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := run.sh
LOCAL_SRC_FILES := run.sh
LOCAL_MODULE_CLASS := EXECUTABLES
LOCAL_MODULE_TAGS := debug
LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/kernel-tests/coresight/stm-trace-marker
include $(BUILD_PREBUILT)
endif

View File

@ -0,0 +1,39 @@
STM Testing Documentation
Usage: stm_test.sh [runs] [run-size] [delay] [usb|mem]
Runs the basic stm test.
OPTIONS:
The following options can be used:
- runs: Number of runs to be performed
- run-size: Number of trace_marker entries in each run
- delay: The delay between runs, specified in seconds
- usb/mem: If you want the coresight sink to be usb or etr mem, default is etf
Not specifying any of these will default runs=50, run-size=10 and
delay=0.001s, that is 1ms. Also coresight sink will be etf.
TEST BEHAVIOR:
* Test will use trace_marker to test stm. It will start by enabling STM.
It will then echo an increasing counter to the trace_marker
and will continue doing so depending on the number of runs and
run-size specified, The total entries echoed will be run*run-size.
The echoed text will be visible on the screen
It will then disable the STM and dump the ETF dump to the
/data/ftace/stm_trace.bin file. It will also collect the trace.txt
file from debugfs and dump it under /data/coresight alongwith the
format file.
After obtaining the stm_trace.bin file from the device, the qht
tool can be used to parse it and observe the text echoed to the
trace_marker event.
This parsed data can be compared with the data for the trace_marker
event observed in the trace.txt file previously dumped and should
match that exactly.
TARGETS:
* 8974
NOTE:
* Assumes /data partition exists

View File

@ -0,0 +1,78 @@
#!/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
if [ $# -eq 0 ]
then
cd `dirname $0` && exec ./stm_test.sh 10 10 0.001
exit 0
fi
#Parse the args for valid switches
while [ $# -gt 0 ]; do
case $1 in
-n | --nominal)
cd `dirname $0` && exec ./stm_test.sh 10 10 0.001
exit 0
;;
-a | --adversarial)
cd `dirname $0` && exec ./stm_test.sh 50 10 0.001
exit 0
;;
-r | --repeatability)
echo $1
if [[ $# -eq 2 && "$2" -gt 0 ]]; then
echo "Specified $2 iterations"
cnt=0
while [ $cnt -le $2 ]
do
cd `dirname $0` && ./stm_test.sh 10 10 0.001
cnt=$(($cnt+1))
done
exit 0
else
echo "Invalid number of iterations"
exit 1
fi
;;
-s | --stress)
cd `dirname $0` && exec ./stm_test.sh 100 10 0.001
exit 0
;;
-v | --verbose)
cd `dirname $0` && exec ./stm_test.sh 10 10 0.001
exit 0
;;
-h | --help | *)
echo "Usage: ./run.sh -[n][a][r][s]"
exit 1
;;
esac
done

View File

@ -0,0 +1,130 @@
#! /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.
runs=49
sets=10
delay=0.001
if [ $# -gt 4 ]
then
echo "Usage: ./stm-test.sh [runs] [run-size] [delay] [usb|mem]"
echo "Delay is specified in seconds."
echo "To specify smaller delays use fractions. For 1ms, use 0.001"
exit
else
if [ $# -eq 1 ]
then
runs=$(($1-1))
echo 1 > /sys/bus/coresight/devices/coresight-tmc-etf/curr_sink
elif [ $# -eq 2 ]
then
runs=$(($1-1))
sets=$2
echo 1 > /sys/bus/coresight/devices/coresight-tmc-etf/curr_sink
elif [ $# -eq 3 ]
then
runs=$(($1-1))
sets=$2
delay=$3
echo 1 > /sys/bus/coresight/devices/coresight-tmc-etf/curr_sink
elif [ $# -eq 4 ]
then
runs=$(($1-1))
sets=$2
delay=$3
if [ $4 = "usb" ] || [ $4 = "mem" ]
then
echo $4 > /sys/bus/coresight/devices/coresight-tmc-etr/out_mode
echo 1 > /sys/bus/coresight/devices/coresight-tmc-etr/curr_sink
else
echo 1 > /sys/bus/coresight/devices/coresight-tmc-etf/curr_sink
fi
fi
fi
echo "STM TEST"
# Mount debugfs
mount -t debugfs nodev /sys/kernel/debug
# create output directory
if [ ! -d "/data" ]
then
mkdir /data
fi
if [ ! -d "/data/coresight" ]
then
mkdir /data/coresight
fi
# Enable stm
echo 1 > /sys/bus/coresight/devices/coresight-stm/enable
# Insert an text marker to indicate start of current test
echo "Starting trace" > /sys/kernel/debug/tracing/trace_marker
# 'X' Sets of 'Y' events with delay
for i in $(seq 0 $runs)
do
echo "Run $(($i+1)): Generating $sets events and sleeping for $delay sec"
for j in $(seq 1 $sets)
do
echo "Event $(($i*$sets+$j))" > /sys/kernel/debug/tracing/trace_marker
done
sleep $delay
done
# Again insert text marker to indicate end of test
echo "Stopping trace" > /sys/kernel/debug/tracing/trace_marker
# Disable stm
echo 0 > /sys/bus/coresight/devices/coresight-stm/enable
# dump trace from etf
if [ $# -eq 4 ]
then
if [ $4 == "mem" ]
then
cat /dev/coresight-tmc-etr > /data/coresight/stm_trace.bin
elif [ $4 != "usb" ]
then
cat /dev/coresight-tmc-etf > /data/coresight/stm_trace.bin
fi
else
cat /dev/coresight-tmc-etf > /data/coresight/stm_trace.bin
fi
cat /sys/kernel/debug/tracing/trace > /data/coresight/trace.txt
# Get format file
cat /sys/kernel/debug/tracing/events/*/*/format > /data/coresight/formats.txt
echo "TEST COMPLETE"
exit 0