Thread (50 messages) flat view 50 messages, 2 authors, 3d ago

Re: [PATCH v10 01/38] selftests/dyndbg: Add kselftest script to verify dynamic-debug

From: sashiko-bot@kernel.org
Date: 2026-09-16 15:41:36
Also in: dri-devel

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] selftests/dyndbg: dead write-only variable CUMULATIVE_DDCMDS
--

commit baf1eba97598bc14d4dc1aac7aa207aedefbdfac
Author: Jim Cromie [off-list ref]

selftests/dyndbg: Add kselftest script to verify dynamic-debug

This commit introduces a new kselftest script and helper library to verify
dynamic debug functionality. It uses spatial control-file slicing and
temporal syslog slicing to validate expected outcomes against an embedded
database of golden records.
quoted hunk ↗ jump to hunk
diff --git a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh
new file mode 100755
index 0000000000000..73c2a4b07bd32
--- /dev/null
+++ b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh
[ ... ]
+function ddcmd () {
+    # ddcmd <query_args> [range_pattern] [pass|fail|log]
+    local args="$1"
+    local range="$2"
+    local action="${3:-pass}"
+    local exp_exit=0
+
+    [ "$action" = "fail" ] && exp_exit=1
+    log_ddcmd "$args"
+
+    # Update cumulative state-machine lineage
+    if [[ "$args" == *"=_"* ]]; then
+        CUMULATIVE_DDCMDS="$args"
+    else
+        CUMULATIVE_DDCMDS="${CUMULATIVE_DDCMDS}; $args"
+    fi
[Severity: Low]
Is this variable used anywhere? It appears CUMULATIVE_DDCMDS is written to
here in ddcmd() but is never read or evaluated in this script or subsequent
patches in the series.
+
+    [ "$action" != "pass" ] && log_start
+    [ -n "$range" ] && capture_before "$range"
+
+    output=$( (echo "$args" > /proc/dynamic_debug/control) 2>&1 )
+    handle_exit_code $BASH_LINENO $FUNCNAME $? $exp_exit
+
+    [ "$action" != "pass" ] && log_stop
+    [ -n "$range" ] && verify_after_change
+}
-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260916-dd-cmap-part2-clean-v10-0-af4cf4767707@gmail.com?part=1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help