diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-08-07 23:41:54 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-08-07 23:43:25 +0100 |
commit | dbbf2e9b24d1488402269a803a230f341791d39a (patch) | |
tree | 83b8a1b84231f458d96ca906f05ad56c4a8035eb /tools | |
parent | a285f03f56050b9a9cb02f232078b63b4a181ed2 (diff) |
intel_error_decode: First try /sys/drm/card0/error for the error-state
As the sysfs is almost always mounted and readable, we have a higher
success rate checking for our error state there than in debugfs.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/intel_error_decode.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/tools/intel_error_decode.c b/tools/intel_error_decode.c index b3d7efbd..39177379 100644 --- a/tools/intel_error_decode.c +++ b/tools/intel_error_decode.c @@ -504,17 +504,21 @@ main(int argc, char *argv[]) if (argc == 1) { if (isatty(0)) { - path = "/debug/dri"; + path = "/sys/class/drm/card0/error"; error = stat(path, &st); if (error != 0) { + path = "/debug/dri"; + error = stat(path, &st); + } + if (error != 0) { path = "/sys/kernel/debug/dri"; error = stat(path, &st); - if (error != 0) { - errx(1, - "Couldn't find i915 debugfs directory.\n\n" - "Is debugfs mounted? You might try mounting it with a command such as:\n\n" - "\tsudo mount -t debugfs debugfs /sys/kernel/debug\n"); - } + } + if (error != 0) { + errx(1, + "Couldn't find i915 debugfs directory.\n\n" + "Is debugfs mounted? You might try mounting it with a command such as:\n\n" + "\tsudo mount -t debugfs debugfs /sys/kernel/debug\n"); } } else { read_data_file(stdin); |