lib: Capture the error state on an unexpected hang

Dump debugfs/i915_error_state to the debug channel if we detect an ERROR
uevent. This poses a few problems, not least that it is the auxiliary
process doing the dumping (so the output may be interleaved with the
test, but considering a hang occurred it is likely the test is blocked)
and the average error state is around 60k, which may prove unwieldy!

On the other hand, it may prove invaluable in debugging those impossible
to reproduce bugs.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Petri Latvala <petri.latvala@intel.com>
1 file changed