From 28e2031e3ac7f65e23003c634f3040eedbbd1f50 Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Wed, 17 May 2023 22:41:51 +0300 Subject: [PATCH] gitlab-ci: add capture for i915 error state Signed-off-by: Lionel Landwerlin Acked-by: David Heidelberg Reviewed-by: Emma Anholt Part-of: --- .gitlab-ci/common/capture-devcoredump.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.gitlab-ci/common/capture-devcoredump.sh b/.gitlab-ci/common/capture-devcoredump.sh index ae370538eae..f40b7482523 100755 --- a/.gitlab-ci/common/capture-devcoredump.sh +++ b/.gitlab-ci/common/capture-devcoredump.sh @@ -10,5 +10,23 @@ while true; do exit 0 fi done + i915_error_states=$(find /sys/devices/ -path */drm/card*/error) + for i in $i915_error_states; do + tmpfile=$(mktemp) + cp "$i" "$tmpfile" + filesize=$(stat --printf="%s" "$tmpfile") + # Does the file contain "No error state collected" ? + if [ "$filesize" = 25 ]; then + rm "$tmpfile" + else + echo "Found an i915 error state at $i size=$filesize." + if cp "$tmpfile" /results/first.i915_error_state; then + rm "$tmpfile" + echo 1 > "$i" + echo "Saved to the job artifacts at /first.i915_error_state" + exit 0 + fi + fi + done sleep 10 done