mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-27 01:36:17 +00:00
Test both debugfs and sysfs error_state interfaces. v2: sysfs error_state not mandatory Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com> [danvet: Update sysfs file name.] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
67 lines
1.3 KiB
Bash
Executable File
67 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
#
|
|
# Testcase: Simulate gpu hang
|
|
#
|
|
# This check uses the stop_rings facility to exercise the gpu hang code.
|
|
# by reading /sys/kernel/debug/dri/0/i915_emon_status too quickly
|
|
#
|
|
|
|
SOURCE_DIR="$( dirname "${BASH_SOURCE[0]}" )"
|
|
. $SOURCE_DIR/drm_lib.sh
|
|
|
|
oldpath=`pwd`
|
|
|
|
cd $i915_dfs_path
|
|
|
|
if [ ! -f i915_ring_stop ] ; then
|
|
echo "kernel doesn't support ring stopping"
|
|
exit 77
|
|
fi
|
|
|
|
function check_iface {
|
|
estate_fname=$1
|
|
mandatory=$2
|
|
|
|
echo checking ${estate_fname}
|
|
|
|
if [ ! -f $estate_fname ] ; then
|
|
if [ $mandatory != 0 ] ; then
|
|
echo "'${estate_fname}' not found";
|
|
exit 1;
|
|
else
|
|
echo "${estate_fname} not mandatory";
|
|
return;
|
|
fi
|
|
fi
|
|
|
|
if cat $estate_fname | grep -v "no error state collected" > /dev/null ; then
|
|
echo "gpu hang detected"
|
|
exit 2
|
|
fi
|
|
|
|
echo 0xf > i915_ring_stop
|
|
echo "rings stopped"
|
|
|
|
(cd $oldpath; $SOURCE_DIR/gem_exec_big) > /dev/null
|
|
|
|
if cat $estate_fname | grep -v "no error state collected" > /dev/null ; then
|
|
echo "gpu hang correctly detected"
|
|
else
|
|
echo "gpu hang not detected"
|
|
exit 3
|
|
fi
|
|
|
|
# clear error state
|
|
echo > $estate_fname
|
|
|
|
if cat $estate_fname | grep -v "no error state collected" > /dev/null ; then
|
|
echo "gpu hang still present"
|
|
exit 4
|
|
fi
|
|
}
|
|
|
|
check_iface $i915_dfs_path/i915_error_state 1
|
|
check_iface $i915_sfs_path/error 0
|
|
|
|
exit 0
|