tests: add test to read all debugfs files
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Sun, 30 Oct 2011 19:51:03 +0000 (20:51 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Sun, 30 Oct 2011 19:54:18 +0000 (20:54 +0100)
Catches a bunch of forcewake warnings on snb+

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
tests/Makefile.am
tests/debugfs_reader [new file with mode: 0755]

index 288baae..27ee014 100644 (file)
@@ -1,7 +1,7 @@
 if HAVE_DRM
 noinst_PROGRAMS = \
        gem_stress \
-       $(TESTS) \
+       $(TESTS_progs) \
        $(HANG) \
        $(NULL)
 
@@ -14,7 +14,8 @@ gem_stress_SOURCES = \
        gem_stress_gen6.c \
        $(NULL)
 
-TESTS = getversion \
+TESTS_progs = \
+       getversion \
        getclient \
        getstats \
        gem_basic \
@@ -55,13 +56,17 @@ TESTS = getversion \
        gem_unref_active_buffers \
        $(NULL)
 
+TESTS = $(TESTS_progs) \
+       debugfs_reader \
+       $(NULL)
+
 HANG = \
        gem_bad_batch \
        gem_hang \
        gem_bad_blit \
        $(NULL)
 
-EXTRA_PROGRAMS = $(TESTS) $(HANG)
+EXTRA_PROGRAMS = $(TESTS_progs) $(HANG)
 CLEANFILES = $(EXTRA_PROGRAMS)
 
 AM_CFLAGS = $(DRM_CFLAGS) $(WARN_CFLAGS) \
@@ -72,7 +77,7 @@ LDADD = ../lib/libintel_tools.la $(PCIACCESS_LIBS) $(DRM_LIBS)
 if HAVE_CAIRO
 if HAVE_LIBUDEV
 if HAVE_GLIB
-TESTS += testdisplay
+TESTS_progs += testdisplay
 LDADD += $(CAIRO_LIBS) $(LIBUDEV_LIBS) $(GLIB_LIBS)
 AM_CFLAGS += $(CAIRO_CFLAGS) $(LIBUDEV_CFLAGS) $(GLIB_CFLAGS)
 endif
diff --git a/tests/debugfs_reader b/tests/debugfs_reader
new file mode 100755 (executable)
index 0000000..8874185
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+if [ -d /debug/dri ] ; then
+       debugfs_path=/debug_dri
+fi
+
+if [ -d /sys/kernel/debug/dri ] ; then
+       debugfs_path=/sys/kernel/debug/dri
+fi
+
+i915_path=x
+for dir in `ls $debugfs_path` ; do
+       if [ -f $debugfs_path/$dir/i915_error_state ] ; then
+               i915_path=$debugfs_path/$dir
+               break
+       fi
+done
+
+if [ $i915_path = "x" ] ; then
+       echo i915 debugfs path not found.
+       exit 1
+fi
+
+# read everything we can
+cat $i915_path/* >& /dev/null
+
+exit 0