diff options
author | Mike Leach <mike.leach@linaro.org> | 2023-12-07 00:47:14 +0000 |
---|---|---|
committer | Mike Leach <mike.leach@linaro.org> | 2023-12-18 14:58:20 +0000 |
commit | d819cf19c472a6276069ccce005e7a166c0014e5 (patch) | |
tree | 38fab438d4b5e70b4b539c81306ba81ada9362cb | |
parent | 0eb514d153b7742daa41b689c3c0afa626a78482 (diff) |
tests: update test scripts to handle debug options
Test updates to check the debug features enabled by the OPENCSD_INSTR_RANGE_LIMIT
and OPENCSD_ERR_ON_AA64_BAD_OPCODE env vars.
Signed-off-by: Mike Leach <mike.leach@linaro.org>
-rwxr-xr-x | decoder/tests/run_pkt_decode_single_ete.bash | 77 | ||||
-rwxr-xr-x | decoder/tests/run_pkt_decode_tests-ete.bash | 1 | ||||
-rwxr-xr-x | decoder/tests/run_pkt_decode_tests.bash | 20 | ||||
-rw-r--r-- | decoder/tests/snapshots-ete/s_9001/ETE_0_s1.ini | 15 | ||||
-rw-r--r-- | decoder/tests/snapshots-ete/s_9001/ETE_0_s2.ini | 15 | ||||
-rw-r--r-- | decoder/tests/snapshots-ete/s_9001/bindir_64/OTHERS_exec | bin | 0 -> 143232 bytes | |||
-rw-r--r-- | decoder/tests/snapshots-ete/s_9001/bindir_64/TEST_NON_DET_CODE_exec | bin | 0 -> 564 bytes | |||
-rw-r--r-- | decoder/tests/snapshots-ete/s_9001/bindir_64/VAL_NON_DET_CODE_exec | bin | 0 -> 177340 bytes | |||
-rw-r--r-- | decoder/tests/snapshots-ete/s_9001/bindir_64/VAL_TEST_CODE_exec | bin | 0 -> 245376 bytes | |||
-rw-r--r-- | decoder/tests/snapshots-ete/s_9001/cpu_0.ini | 32 | ||||
-rw-r--r-- | decoder/tests/snapshots-ete/s_9001/session1.bin | bin | 0 -> 30 bytes | |||
-rw-r--r-- | decoder/tests/snapshots-ete/s_9001/session2.bin | bin | 0 -> 260 bytes | |||
-rw-r--r-- | decoder/tests/snapshots-ete/s_9001/snapshot.ini | 12 | ||||
-rw-r--r-- | decoder/tests/snapshots-ete/s_9001/trace.ini | 22 |
14 files changed, 194 insertions, 0 deletions
diff --git a/decoder/tests/run_pkt_decode_single_ete.bash b/decoder/tests/run_pkt_decode_single_ete.bash new file mode 100755 index 000000000000..ad3ce605ca5d --- /dev/null +++ b/decoder/tests/run_pkt_decode_single_ete.bash @@ -0,0 +1,77 @@ +#!/bin/bash +################################################################################# +# Copyright 2018 ARM. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# 2. 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. +# +# 3. Neither the name of the copyright holder 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 BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. +# +################################################################################# +# OpenCSD library: run single test +# +# +################################################################################# +# Usage options:- +# * default: run test on binary + libs in ./bin/linux64/rel +# run_pkt_decode_tests.bash <test> <options> +# +# * use installed opencsd libraries & program +# run_pkt_decode_tests.bash use-installed <test> <options> +# +# + +OUT_DIR=./results-ete +SNAPSHOT_DIR=./snapshots-ete +BIN_DIR=./bin/linux64/rel/ + +TEST="001-ack-test" + +mkdir -p ${OUT_DIR} + +if [ "$1" == "use-installed" ]; then + BIN_DIR="" + shift +fi + +if [ "$1" != "" ]; then + TEST=$1 + shift +fi + +echo "Running trc_pkt_lister on single snapshot-ete ${TEST}" + + +if [ "${BIN_DIR}" != "" ]; then + echo "Tests using BIN_DIR = ${BIN_DIR}" + export LD_LIBRARY_PATH=${BIN_DIR}. + echo "LD_LIBRARY_PATH set to ${BIN_DIR}" +else + echo "Tests using installed binaries" +fi + +# === test the decode set === +${BIN_DIR}trc_pkt_lister -ss_dir "${SNAPSHOT_DIR}/${TEST}" $@ -decode -logfilename "${OUT_DIR}/${TEST}.ppl" +echo "Done : Return $?" + + diff --git a/decoder/tests/run_pkt_decode_tests-ete.bash b/decoder/tests/run_pkt_decode_tests-ete.bash index a9fe0cc36e07..656e7db54018 100755 --- a/decoder/tests/run_pkt_decode_tests-ete.bash +++ b/decoder/tests/run_pkt_decode_tests-ete.bash @@ -63,6 +63,7 @@ declare -a test_dirs_decode=( "001-ack_test" "event_test" "infrastructure" "q_elem" + "s_9001" "src_addr" "tme_simple" "tme_tcancel" diff --git a/decoder/tests/run_pkt_decode_tests.bash b/decoder/tests/run_pkt_decode_tests.bash index 27a855e92899..9b660f22d13a 100755 --- a/decoder/tests/run_pkt_decode_tests.bash +++ b/decoder/tests/run_pkt_decode_tests.bash @@ -97,9 +97,29 @@ do echo "Done : Return $?" done +# === test for debugging issues === +# juno_r1_1 has fake data that triggers range limit and bad opcode if operating +echo "Test with run limit on..." +export OPENCSD_INSTR_RANGE_LIMIT=100 +env | grep OPENCSD +${BIN_DIR}trc_pkt_lister -ss_dir "${SNAPSHOT_DIR}/juno_r1_1" $@ -decode -logfilename "${OUT_DIR}/juno_r1_1_rangelimit.ppl" +unset OPENCSD_INSTR_RANGE_LIMIT +echo "Done : Return $?" +env | grep OPENCSD + +echo "Test with bad opcode detect on..." +export OPENCSD_ERR_ON_AA64_BAD_OPCODE=1 +env | grep OPENCSD +${BIN_DIR}trc_pkt_lister -ss_dir "${SNAPSHOT_DIR}/juno_r1_1" $@ -decode -logfilename "${OUT_DIR}/juno_r1_1_badopcode.ppl" +unset OPENCSD_ERR_ON_AA64_BAD_OPCODE +echo "Done : Return $?" +env | grep OPENCSD + + # === test a packet only example === echo "Testing init-short-addr..." ${BIN_DIR}trc_pkt_lister -ss_dir "${SNAPSHOT_DIR}/init-short-addr" $@ -pkt_mon -logfilename "${OUT_DIR}/init-short-addr.ppl" +echo "Done : Return $?" # === test the TPIU deformatter === echo "Testing a55-test-tpiu..." diff --git a/decoder/tests/snapshots-ete/s_9001/ETE_0_s1.ini b/decoder/tests/snapshots-ete/s_9001/ETE_0_s1.ini new file mode 100644 index 000000000000..23947f3904cc --- /dev/null +++ b/decoder/tests/snapshots-ete/s_9001/ETE_0_s1.ini @@ -0,0 +1,15 @@ +[device] +name=ETE_0_s1 +class=trace_source +type=ETE + + +[regs] +TRCCONFIGR=0x8001 +TRCTRACEIDR=0x1 +TRCDEVARCH=0x47735a13 +TRCIDR0=0x28c1cea1 +TRCIDR1=0x4100fff0 +TRCIDR2=0xd0001088 +TRCIDR8=0x0 + diff --git a/decoder/tests/snapshots-ete/s_9001/ETE_0_s2.ini b/decoder/tests/snapshots-ete/s_9001/ETE_0_s2.ini new file mode 100644 index 000000000000..063b076c90b4 --- /dev/null +++ b/decoder/tests/snapshots-ete/s_9001/ETE_0_s2.ini @@ -0,0 +1,15 @@ +[device] +name=ETE_0_s2 +class=trace_source +type=ETE + + +[regs] +TRCCONFIGR=0x8001 +TRCTRACEIDR=0x1 +TRCDEVARCH=0x47735a13 +TRCIDR0=0x28c1cea1 +TRCIDR1=0x4100fff0 +TRCIDR2=0xd0001088 +TRCIDR8=0x0 + diff --git a/decoder/tests/snapshots-ete/s_9001/bindir_64/OTHERS_exec b/decoder/tests/snapshots-ete/s_9001/bindir_64/OTHERS_exec Binary files differnew file mode 100644 index 000000000000..da5e23b5ab0c --- /dev/null +++ b/decoder/tests/snapshots-ete/s_9001/bindir_64/OTHERS_exec diff --git a/decoder/tests/snapshots-ete/s_9001/bindir_64/TEST_NON_DET_CODE_exec b/decoder/tests/snapshots-ete/s_9001/bindir_64/TEST_NON_DET_CODE_exec Binary files differnew file mode 100644 index 000000000000..d153249fbdc3 --- /dev/null +++ b/decoder/tests/snapshots-ete/s_9001/bindir_64/TEST_NON_DET_CODE_exec diff --git a/decoder/tests/snapshots-ete/s_9001/bindir_64/VAL_NON_DET_CODE_exec b/decoder/tests/snapshots-ete/s_9001/bindir_64/VAL_NON_DET_CODE_exec Binary files differnew file mode 100644 index 000000000000..a3cb14fd5802 --- /dev/null +++ b/decoder/tests/snapshots-ete/s_9001/bindir_64/VAL_NON_DET_CODE_exec diff --git a/decoder/tests/snapshots-ete/s_9001/bindir_64/VAL_TEST_CODE_exec b/decoder/tests/snapshots-ete/s_9001/bindir_64/VAL_TEST_CODE_exec Binary files differnew file mode 100644 index 000000000000..c7c3b3301fc8 --- /dev/null +++ b/decoder/tests/snapshots-ete/s_9001/bindir_64/VAL_TEST_CODE_exec diff --git a/decoder/tests/snapshots-ete/s_9001/cpu_0.ini b/decoder/tests/snapshots-ete/s_9001/cpu_0.ini new file mode 100644 index 000000000000..c14ad73f2ff0 --- /dev/null +++ b/decoder/tests/snapshots-ete/s_9001/cpu_0.ini @@ -0,0 +1,32 @@ +[device] +name=cpu_0 +class=core +type=ARM-AA64 + +[regs] +PC(size:64)=0x0 +SP(size:64)=0 +SCTLR_EL1=0x0 +CPSR=0x0 + + +[dump1] +file=bindir_64/OTHERS_exec +address=0x00060000 +length=0x22f80 + +[dump2] +file=bindir_64/VAL_TEST_CODE_exec +address=0x01000000 +length=0x3be80 + +[dump3] +file=bindir_64/VAL_NON_DET_CODE_exec +address=0x00010000 +length=0x2b498 + +[dump4] +file=bindir_64/TEST_NON_DET_CODE_exec +address=0x00050000 +length=0x234 + diff --git a/decoder/tests/snapshots-ete/s_9001/session1.bin b/decoder/tests/snapshots-ete/s_9001/session1.bin Binary files differnew file mode 100644 index 000000000000..679e1476acb5 --- /dev/null +++ b/decoder/tests/snapshots-ete/s_9001/session1.bin diff --git a/decoder/tests/snapshots-ete/s_9001/session2.bin b/decoder/tests/snapshots-ete/s_9001/session2.bin Binary files differnew file mode 100644 index 000000000000..30f9fd459c5b --- /dev/null +++ b/decoder/tests/snapshots-ete/s_9001/session2.bin diff --git a/decoder/tests/snapshots-ete/s_9001/snapshot.ini b/decoder/tests/snapshots-ete/s_9001/snapshot.ini new file mode 100644 index 000000000000..299b37631369 --- /dev/null +++ b/decoder/tests/snapshots-ete/s_9001/snapshot.ini @@ -0,0 +1,12 @@ +[snapshot] +version=1.0 +description=checker_metadata.ini + +[device_list] +device0=cpu_0.ini +device1=ETE_0_s1.ini +device2=ETE_0_s2.ini + +[trace] +metadata=trace.ini + diff --git a/decoder/tests/snapshots-ete/s_9001/trace.ini b/decoder/tests/snapshots-ete/s_9001/trace.ini new file mode 100644 index 000000000000..3a3192976a35 --- /dev/null +++ b/decoder/tests/snapshots-ete/s_9001/trace.ini @@ -0,0 +1,22 @@ +[trace_buffers] +buffers=buffer1,buffer2 + +[buffer1] +name=ETB_1 +file=session1.bin +format=source_data + +[buffer2] +name=ETB_2 +file=session2.bin +format=source_data + + +[source_buffers] +ETE_0_s1=ETB_1 +ETE_0_s2=ETB_2 + +[core_trace_sources] +cpu_0=ETE_0_s1 +cpu_0=ETE_0_s2 + |