From 5c7965f00f85fbe3af69029d3fd1e5e2e079f159 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sat, 9 Aug 2014 07:37:58 +0100 Subject: [PATCH] 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 --- src/intel_device.c | 8 ++++++++ 1 file changed, 8 insertions(+) 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 #include +#include #include #include #include @@ -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)