[PATCH v1] drm/ci: enable lockdep detection

Vignesh Raman vignesh.raman at collabora.com
Mon Aug 12 11:20:28 UTC 2024


We have enabled PROVE_LOCKING (which enables LOCKDEP) in drm-ci.
This will output warnings when kernel locking errors are encountered
and will continue executing tests. To detect if lockdep has been
triggered, check the debug_locks value in /proc/lockdep_stats after
the tests have run. When debug_locks is 0, it indicates that lockdep
has detected issues and turned itself off. So check this value and
exit with an error if lockdep is detected.

Signed-off-by: Vignesh Raman <vignesh.raman at collabora.com>
---

v1:
  - Pipeline link to show lockdep_stats before and after tests,
    https://gitlab.freedesktop.org/vigneshraman/linux/-/pipelines/1246721
  
---
 drivers/gpu/drm/ci/igt_runner.sh | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/gpu/drm/ci/igt_runner.sh b/drivers/gpu/drm/ci/igt_runner.sh
index f38836ec837c..d2c043cd8c6a 100755
--- a/drivers/gpu/drm/ci/igt_runner.sh
+++ b/drivers/gpu/drm/ci/igt_runner.sh
@@ -85,6 +85,17 @@ deqp-runner junit \
    --limit 50 \
    --template "See https://$CI_PROJECT_ROOT_NAMESPACE.pages.freedesktop.org/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/results/{{testcase}}.xml"
 
+# Check if /proc/lockdep_stats exists
+if [ -f /proc/lockdep_stats ]; then
+    # If debug_locks is 0, it indicates lockdep is detected and it turns itself off.
+    debug_locks=$(grep 'debug_locks:' /proc/lockdep_stats | awk '{print $2}')
+    if [ "$debug_locks" -eq 0 ]; then
+        echo "LOCKDEP issue detected. Please check dmesg logs for more information."
+        cat /proc/lockdep_stats
+        ret=1
+    fi
+fi
+
 # Store the results also in the simpler format used by the runner in ChromeOS CI
 #sed -r 's/(dmesg-warn|pass)/success/g' /results/results.txt > /results/results_simple.txt
 
-- 
2.43.0



More information about the dri-devel mailing list