diff --git a/0001-hack-test.patch b/0001-hack-test.patch new file mode 100644 index 0000000..be8b526 --- /dev/null +++ b/0001-hack-test.patch @@ -0,0 +1,71 @@ +From 418d701244e7368a1a29f3c9006c5a65e24f5c19 Mon Sep 17 00:00:00 2001 +From: Jeremy Linton +Date: Tue, 27 Aug 2024 20:11:01 -0500 +Subject: [PATCH] hack test + +The opencsd tests have an option to test an installed +trc_pkt_lister for basic decoding, yet the comparison fails +because they shift off the parameter after checking it the +first time. Hack off the 'shift' and it works for our purposes. + +Signed-off-by: Jeremy Linton +--- + decoder/tests/run_pkt_decode_tests.bash | 14 +++----------- + 1 file changed, 3 insertions(+), 11 deletions(-) + +diff --git a/decoder/tests/run_pkt_decode_tests.bash b/decoder/tests/run_pkt_decode_tests.bash +index 9b660f2..1a6480e 100755 +--- a/decoder/tests/run_pkt_decode_tests.bash ++++ b/decoder/tests/run_pkt_decode_tests.bash +@@ -46,6 +46,8 @@ + # run_pkt_decode_tests.bash -bindir // + # + ++set -e ++ + OUT_DIR=./results + SNAPSHOT_DIR=./snapshots + BIN_DIR=./bin/linux64/rel/ +@@ -73,10 +75,7 @@ echo "Running trc_pkt_lister on snapshot directories." + + mkdir -p ${OUT_DIR} + +-if [ "$1" == "use-installed" ]; then +- BIN_DIR="" +- shift +-elif [ "$1" == "-bindir" ]; then ++if [ "$1" == "-bindir" ]; then + BIN_DIR=$2 + shift + shift +@@ -84,11 +83,6 @@ fi + + echo "Tests using BIN_DIR = ${BIN_DIR}" + +-if [ "${BIN_DIR}" != "" ]; then +- export LD_LIBRARY_PATH=${BIN_DIR}. +- echo "LD_LIBRARY_PATH set to ${BIN_DIR}" +-fi +- + # === test the decode set === + for test_dir in "${test_dirs_decode[@]}" + do +@@ -105,7 +99,6 @@ 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 +@@ -113,7 +106,6 @@ 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 === +-- +2.46.0 + diff --git a/opencsd.spec b/opencsd.spec index 1314ee0..c875db9 100644 --- a/opencsd.spec +++ b/opencsd.spec @@ -2,13 +2,15 @@ Name: opencsd Version: 1.5.3 -Release: 0%{?dist} +Release: 1%{?dist} Summary: An open source CoreSight(tm) Trace Decode library License: BSD-3-Clause URL: https://github.com/Linaro/OpenCSD Source0: https://github.com/Linaro/OpenCSD/archive/%{opencsd_tag}.tar.gz +Patch0: 0001-hack-test.patch + BuildRequires: patch BuildRequires: gcc BuildRequires: gcc-c++ @@ -28,6 +30,7 @@ to develop CoreSight(tm) trace decoders. %prep %setup -q -n OpenCSD-%{opencsd_tag} +%patch -P0 -p1 %build cd decoder/build/linux @@ -38,17 +41,18 @@ LIB_PATH=%{_lib} make %{?_smp_mflags} %install cd decoder/build/linux -PREFIX=%{buildroot}%{_prefix} LIB_PATH=%{_lib} make install DISABLE_STATIC=1 DEF_SO_PERM=755 +PREFIX=%{buildroot}%{_prefix} LIB_PATH=%{_lib} make install install_man DISABLE_STATIC=1 DEF_SO_PERM=755 %check -# no upstream unit tests yet +LD_LIBRARY_PATH=%{buildroot}%{_libdir} decoder/tests/run_pkt_decode_tests.bash -bindir %{buildroot}%{_bindir}/ use-installed %files %license LICENSE %doc HOWTO.md README.md %{_libdir}/*so\.* %{_bindir}/* +%{_mandir}/man1/trc_pkt_lister.1.gz %files devel %doc decoder/docs/prog_guide/* @@ -58,6 +62,10 @@ PREFIX=%{buildroot}%{_prefix} LIB_PATH=%{_lib} make install DISABLE_STATIC=1 DEF #------------------------------------------------------------------------------ %changelog +* Tue Aug 27 2024 Jeremy Linton - 1.5.3-1 +- Ship the (newish) trc_pkt_lister man page, which is helpful and makes lint happy +- Also, enable some basic decoding unit tests that ship with opencsd after we tweak them. + * Tue Aug 27 2024 Jeremy Linton - 1.5.3-0 - Update to upstream 1.5.3