From 856d25122f7a6e2b3125bfbf4fd7487fa496d93b Mon Sep 17 00:00:00 2001 From: Ahamad Shaik Date: Mon, 12 Oct 2026 19:10:07 +0530 Subject: [PATCH] DEBUG/TPDM-Enable-Disable/run.sh: Update TPDM validation to include ETR sinks Existing enables TPDM sources with ETF sinks, this changes enhances the test to enable TPDM sources with ETR sinks. Test fetches ETR path from sysfs nodes and enables ETR sinks before TPDM sources enable/Disable. Signed-off-by: Ahamad Shaik --- .../DEBUG/TPDM-Enable-Disable/README.md | 37 +++--- .../Kernel/DEBUG/TPDM-Enable-Disable/run.sh | 110 ++++++++++-------- 2 files changed, 86 insertions(+), 61 deletions(-) diff --git a/Runner/suites/Kernel/DEBUG/TPDM-Enable-Disable/README.md b/Runner/suites/Kernel/DEBUG/TPDM-Enable-Disable/README.md index ef870532..3e6ed092 100644 --- a/Runner/suites/Kernel/DEBUG/TPDM-Enable-Disable/README.md +++ b/Runner/suites/Kernel/DEBUG/TPDM-Enable-Disable/README.md @@ -7,7 +7,7 @@ This test acts as a stress test for the Coresight Trace Port Debug Module (TPDM) ## Test Goals - Validate the stability of the TPDM drivers under repeated enable/disable cycles. -- Ensure all TPDM sources can be successfully toggled without causing system hangs or crashes. +- Ensure all TPDM sources can be successfully toggled with ETF/ETR sinks enabled without causing system hangs or crashes. - Verify that sysfs states correctly reflect the enabled/disabled status across multiple rapid transitions. - Ensure 100% success rate across 50 iterations for pass criteria. @@ -50,18 +50,29 @@ Run the script directly via the framework: ## Example Output ``` -[INFO] 2026-03-23 05:42:18 - ----------------------------------------------------------------------------------------- -[INFO] 2026-03-23 05:42:18 - -------------------Starting TPDM-Enable-Disable Testcase---------------------------- -[INFO] 2026-03-23 05:42:18 - Iteration: 0 - PASS -[INFO] 2026-03-23 05:42:19 - Iteration: 1 - PASS -[INFO] 2026-03-23 05:42:19 - Iteration: 2 - PASS -[INFO] 2026-03-23 05:42:20 - Iteration: 3 - PASS -[INFO] 2026-03-23 05:42:20 - Iteration: 4 - PASS -..... -[INFO] 2026-03-23 05:42:38 - Iteration: 49 - PASS -[INFO] 2026-03-23 05:42:39 - Iteration: 50 - PASS -[PASS] 2026-03-23 05:42:39 - -------------enable/disable TPDMs Test PASS------------- -[INFO] 2026-03-23 05:42:39 - -------------------TPDM-Enable-Disable Testcase Finished---------------------------- +[INFO] 2025-06-03 20:49:13 - ----------------------------------------------------------------------------------------- +[INFO] 2025-06-03 20:49:13 - -------------------Starting TPDM-Enable-Disable Testcase---------------------------- +[INFO] 2025-06-03 20:49:13 - Running with ETF sink +[INFO] 2025-06-03 20:49:14 - Iteration: 0 - PASS +[INFO] 2025-06-03 20:49:15 - Iteration: 1 - PASS +[INFO] 2025-06-03 20:49:15 - Iteration: 2 - PASS +[INFO] 2025-06-03 20:49:16 - Iteration: 3 - PASS +[INFO] 2025-06-03 20:49:17 - Iteration: 4 - PASS + +[INFO] 2025-06-03 20:49:47 - Iteration: 49 - PASS +[INFO] 2025-06-03 20:49:48 - Iteration: 50 - PASS + +[INFO] 2025-06-03 20:49:48 - Running with ETR sink +[INFO] 2025-06-03 20:49:48 - Iteration: 0 - PASS +[INFO] 2025-06-03 20:49:49 - Iteration: 1 - PASS +[INFO] 2025-06-03 20:49:49 - Iteration: 2 - PASS +[INFO] 2025-06-03 20:49:50 - Iteration: 3 - PASS +[INFO] 2025-06-03 20:49:50 - Iteration: 4 - PASS + +[INFO] 2025-06-03 20:50:12 - Iteration: 49 - PASS +[INFO] 2025-06-03 20:50:12 - Iteration: 50 - PASS +[PASS] 2025-06-03 20:50:12 - -------------enable/disable TPDMs Test PASS------------- +[INFO] 2025-06-03 20:50:12 - -------------------TPDM-Enable-Disable Testcase Finished---------------------------- ``` ## Return Code diff --git a/Runner/suites/Kernel/DEBUG/TPDM-Enable-Disable/run.sh b/Runner/suites/Kernel/DEBUG/TPDM-Enable-Disable/run.sh index 54fbef0a..9cf5bf07 100755 --- a/Runner/suites/Kernel/DEBUG/TPDM-Enable-Disable/run.sh +++ b/Runner/suites/Kernel/DEBUG/TPDM-Enable-Disable/run.sh @@ -38,8 +38,9 @@ log_info "-------------------Starting $TESTNAME Testcase------------------------ cs_base="/sys/bus/coresight/devices" etf_path=$(find_path "tmc_etf0" "tmc_etf" "tmc_etf1" "coresight-tmc_etf" "coresight-tmc_etf0") -if [ -z "$etf_path" ]; then - log_fail "TMC-ETF sink not found. Cannot proceed." +etr_path=$(find_path "tmc_etr0" "tmc_etr" "tmc_etr1" "coresight-tmc_etr" "coresight-tmc_etr0") +if [ -z "$etf_path" ] || [ -z "$etr_path" ]; then + log_fail "TMC-ETF or TMC-ETR sink not found. Cannot proceed." echo "$TESTNAME FAIL" > "$res_file" exit 0 fi @@ -56,55 +57,68 @@ if [ "$tpdm_count" -eq 0 ]; then fi fail=0 -i=0 - -reset_devices - -[ -f "$etf_path/enable_sink" ] && echo 1 > "$etf_path/enable_sink" 2>/dev/null - -while [ "$i" -le 50 ]; do - iter_fail=0 - - for node_path in "$cs_base"/tpdm* "$cs_base"/coresight-tpdm*; do - [ ! -d "$node_path" ] && continue - - node_name=$(basename "$node_path") - - if echo "$node_name" | grep -q "tpdm-turing-llm"; then - continue - fi - - if [ ! -f "$node_path/enable_source" ]; then - continue - fi - - echo 1 > "$node_path/enable_source" 2>/dev/null - if [ "$(cat "$node_path/enable_source" 2>/dev/null)" != "1" ]; then - iter_fail=1 - log_fail "Iter $i: Failed to enable $node_name" - echo "$TESTNAME FAIL" > "$res_file" - fi - - echo 0 > "$node_path/enable_source" 2>/dev/null - if [ "$(cat "$node_path/enable_source" 2>/dev/null)" = "1" ]; then - iter_fail=1 - log_fail "Iter $i: Failed to disable $node_name" - echo "$TESTNAME FAIL" > "$res_file" - fi - done - - if [ "$iter_fail" -eq 0 ]; then - log_info "Iteration: $i - PASS" + +for sink_path in "$etf_path" "$etr_path"; do + if [ "$sink_path" = "$etf_path" ]; then + sink_name="ETF" else - log_fail "Iteration: $i - FAIL" - fail=1 + sink_name="ETR" fi - - i=$((i+1)) -done -[ -f "$etf_path/enable_sink" ] && echo 0 > "$etf_path/enable_sink" 2>/dev/null -reset_devices + log_info "Running with $sink_name sink" + + reset_devices + + [ -f "$sink_path/enable_sink" ] && echo 1 > "$sink_path/enable_sink" 2>/dev/null + + i=0 + + while [ "$i" -le 50 ]; do + iter_fail=0 + + for node_path in "$cs_base"/tpdm* "$cs_base"/coresight-tpdm*; do + [ ! -d "$node_path" ] && continue + + node_name=$(basename "$node_path") + + if echo "$node_name" | grep -q "tpdm-turing-llm"; then + continue + fi + + if [ ! -f "$node_path/enable_source" ]; then + continue + fi + + echo 1 > "$node_path/enable_source" 2>/dev/null + + if [ "$(cat "$node_path/enable_source" 2>/dev/null)" != "1" ]; then + iter_fail=1 + log_fail "Iter $i: Failed to enable $node_name with $sink_name sink" + echo "$TESTNAME FAIL" > "$res_file" + fi + + echo 0 > "$node_path/enable_source" 2>/dev/null + + if [ "$(cat "$node_path/enable_source" 2>/dev/null)" = "1" ]; then + iter_fail=1 + log_fail "Iter $i: Failed to disable $node_name with $sink_name sink" + echo "$TESTNAME FAIL" > "$res_file" + fi + done + + if [ "$iter_fail" -eq 0 ]; then + log_info "Iteration: $i - PASS" + else + log_fail "Iteration: $i - FAIL" + fail=1 + fi + + i=$((i + 1)) + done + + [ -f "$sink_path/enable_sink" ] && echo 0 > "$sink_path/enable_sink" 2>/dev/null + reset_devices +done if [ "$fail" -eq 0 ]; then log_pass "-------------enable/disable TPDMs Test PASS-------------"