diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-08-09 07:37:58 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2014-08-09 07:37:58 +0100 |
commit | 5c7965f00f85fbe3af69029d3fd1e5e2e079f159 (patch) | |
tree | 88097035a6cf3525dd5f911d6a5efe010e3b4d6e /src/intel_device.c | |
parent | dea65e8be73b79c50f7ee59c54c4c75cbcff67fb (diff) |
intel: If need be, try mounting debugfs
If we require debugging information from debugfs and we cannot find it,
silently mount it and dump the information we need.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/intel_device.c')
-rw-r--r-- | src/intel_device.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/intel_device.c b/src/intel_device.c index 11d95bec..27715c41 100644 --- a/src/intel_device.c +++ b/src/intel_device.c @@ -30,6 +30,7 @@ #include <sys/types.h> #include <sys/stat.h> +#include <sys/mount.h> #include <assert.h> #include <string.h> #include <unistd.h> @@ -141,6 +142,13 @@ static void dump_debugfs(ScrnInfoPtr scrn, int fd, const char *name) sprintf(path, "/debug/dri/%d/%s", minor, name); if (dump_file(scrn, path)) return; + + if (mount("X-debug", "/sys/kernel/debug", "debugfs", 0, 0) == 0) { + sprintf(path, "/sys/kernel/debug/dri/%d/%s", minor, name); + dump_file(scrn, path); + umount("X-debug"); + return; + } } static void dump_clients_info(ScrnInfoPtr scrn, int fd) |