tests/debugfs_test: Fix testcases to pass

emon_crash should skip if the debugfs file could not be opened the first
time, and debugfs_test.read_all_entries should skip files that could not
be opened, instead of returning an error.

This is because in a typical IGT run there may be more debugfs files
registered than can be opened.

This is an example on f2-pnv-d510:
$ grep -r . /sys/kernel/debug/dri/0 >/dev/null
grep: /sys/kernel/debug/dri/0/i915_sseu_status: No such device
grep: /sys/kernel/debug/dri/0/i915_energy_uJ: No such device
grep: /sys/kernel/debug/dri/0/i915_sink_crc_eDP1: No such device
grep: /sys/kernel/debug/dri/0/i915_emon_status: No such device
grep: /sys/kernel/debug/dri/0/i915_guc_log_control: Invalid argument
grep: /sys/kernel/debug/dri/0/i915_fbc_false_color: No such device
grep: /sys/kernel/debug/dri/0/i915_cur_wm_latency: No such device
grep: /sys/kernel/debug/dri/0/i915_spr_wm_latency: No such device
grep: /sys/kernel/debug/dri/0/i915_pri_wm_latency: No such device
grep: /sys/kernel/debug/dri/0/i915_next_seqno: Permission denied
grep: /sys/kernel/debug/dri/0/i915_cache_sharing: No such device
grep: /sys/kernel/debug/dri/0/i915_min_freq: No such device
grep: /sys/kernel/debug/dri/0/i915_max_freq: No such device
grep: /sys/kernel/debug/dri/0/i915_pipe_C_crc: No such device
grep: /sys/kernel/debug/dri/0/i915_forcewake_user: Invalid argument
grep: /sys/kernel/debug/dri/0/crtc-1/crc/data: Input/output error

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Reviewed by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
1 file changed