Repository navigation
DEBUG/TPDM-Enable-Disable/run.sh: Update TPDM validation to include ETR sinks #617
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
|
Comment on lines
+119
to
+120
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P2] Include ETR cleanup failures in the final result The new ETR phase ignores both the sink-clear status and the reset outcome. If source toggling succeeds but clearing ETR fails and reset does not recover it, Check the sink write and verify the final |
||
| done | ||
|
|
||
| if [ "$fail" -eq 0 ]; then | ||
| log_pass "-------------enable/disable TPDMs Test PASS-------------" | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P2] Preserve ETF-only coverage when adding ETR
This now requires both sink types before running any source checks. A configuration with usable TPDM/ETF devices but no registered ETR previously reached the ETF test and now immediately reports FAIL, even though its existing ETF path can still be tested. A focused comparison of the old and new discovery gates confirms that change.
Discover the sink types independently and run the available, reachable sink subcases. Report an unavailable optional ETR subcase as SKIP without dropping ETF coverage. If ETR is meant to be mandatory for a particular target, make that requirement explicit rather than imposing it on every invocation. Update the README applicability accordingly.