Skip to content
Snippets Groups Projects
Commit fff5bcbe authored by Vignesh Raman's avatar Vignesh Raman
Browse files

drm/ci: enable lockdep detection


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. Check this value, and if
lockdep is detected, exit with an error and configure it as a warning
in GitLab CI.

GitLab CI ignores exit codes other than 1 by default. Pass the correct
exit code with variable FF_USE_NEW_BASH_EVAL_STRATEGY set to true or
exit on failure.

Also update the documentation.

Signed-off-by: default avatarVignesh Raman <vignesh.raman@collabora.com>
parent 5270e2de
No related merge requests found
Pipeline #1366054 passed with warnings
...@@ -115,6 +115,10 @@ created (eg. https://gitlab.freedesktop.org/janedoe/linux/-/pipelines) ...@@ -115,6 +115,10 @@ created (eg. https://gitlab.freedesktop.org/janedoe/linux/-/pipelines)
5. The various jobs will be run and when the pipeline is finished, all jobs 5. The various jobs will be run and when the pipeline is finished, all jobs
should be green unless a regression has been found. should be green unless a regression has been found.
6. Warnings in the pipeline indicate that lockdep
(see Documentation/locking/lockdep-design.rst) issues have been detected
during the tests.
How to update test expectations How to update test expectations
=============================== ===============================
......
...@@ -85,5 +85,16 @@ deqp-runner junit \ ...@@ -85,5 +85,16 @@ deqp-runner junit \
--limit 50 \ --limit 50 \
--template "See $ARTIFACTS_BASE_URL/results/{{testcase}}.xml" --template "See $ARTIFACTS_BASE_URL/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 ] && [ "$ret" -eq 0 ]; then
echo "Warning: LOCKDEP issue detected. Please check dmesg logs for more information."
cat /proc/lockdep_stats
ret=101
fi
fi
cd $oldpath cd $oldpath
exit $ret exit $ret
.allow_failure_lockdep:
variables:
FF_USE_NEW_BASH_EVAL_STRATEGY: 'true'
allow_failure:
exit_codes:
- 101
.lava-test: .lava-test:
extends: extends:
- .container+build-rules - .container+build-rules
- .allow_failure_lockdep
timeout: "1h30m" timeout: "1h30m"
rules: rules:
- !reference [.scheduled_pipeline-rules, rules] - !reference [.scheduled_pipeline-rules, rules]
...@@ -69,6 +77,7 @@ ...@@ -69,6 +77,7 @@
extends: extends:
- .baremetal-test-arm64 - .baremetal-test-arm64
- .use-debian/baremetal_arm64_test - .use-debian/baremetal_arm64_test
- .allow_failure_lockdep
timeout: "1h30m" timeout: "1h30m"
rules: rules:
- !reference [.scheduled_pipeline-rules, rules] - !reference [.scheduled_pipeline-rules, rules]
...@@ -91,6 +100,8 @@ ...@@ -91,6 +100,8 @@
.software-driver: .software-driver:
stage: software-driver stage: software-driver
extends:
- .allow_failure_lockdep
timeout: "1h30m" timeout: "1h30m"
rules: rules:
- !reference [.scheduled_pipeline-rules, rules] - !reference [.scheduled_pipeline-rules, rules]
...@@ -153,7 +164,7 @@ msm:apq8016: ...@@ -153,7 +164,7 @@ msm:apq8016:
BM_KERNEL_EXTRA_ARGS: clk_ignore_unused BM_KERNEL_EXTRA_ARGS: clk_ignore_unused
RUNNER_TAG: google-freedreno-db410c RUNNER_TAG: google-freedreno-db410c
script: script:
- ./install/bare-metal/fastboot.sh - ./install/bare-metal/fastboot.sh || exit $?
msm:apq8096: msm:apq8096:
extends: extends:
...@@ -167,7 +178,7 @@ msm:apq8096: ...@@ -167,7 +178,7 @@ msm:apq8096:
GPU_VERSION: apq8096 GPU_VERSION: apq8096
RUNNER_TAG: google-freedreno-db820c RUNNER_TAG: google-freedreno-db820c
script: script:
- ./install/bare-metal/fastboot.sh - ./install/bare-metal/fastboot.sh || exit $?
msm:sdm845: msm:sdm845:
extends: extends:
...@@ -181,7 +192,7 @@ msm:sdm845: ...@@ -181,7 +192,7 @@ msm:sdm845:
GPU_VERSION: sdm845 GPU_VERSION: sdm845
RUNNER_TAG: google-freedreno-cheza RUNNER_TAG: google-freedreno-cheza
script: script:
- ./install/bare-metal/cros-servo.sh - ./install/bare-metal/cros-servo.sh || exit $?
msm:sm8350-hdk: msm:sm8350-hdk:
extends: extends:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment