overlay: Auatomatically mount debugfs

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson
2013-08-19 18:15:04 +01:00
parent 34198b801e
commit 55b8c33ca5
8 changed files with 33 additions and 1 deletions
+2
View File
@@ -14,6 +14,8 @@ intel_gpu_overlay_SOURCES = \
chart.c \
cpu-top.h \
cpu-top.c \
debugfs.h \
debugfs.c \
gem-objects.h \
gem-objects.c \
gpu-top.h \
+21
View File
@@ -0,0 +1,21 @@
#include <sys/stat.h>
#include <sys/mount.h>
#include <errno.h>
#include "debugfs.h"
int debugfs_init(void)
{
struct stat st;
if (stat("/sys/kernel/debug/dri", &st) == 0)
return 0;
if (stat("/sys/kernel/debug", &st))
return errno;
if (mount("debug", "/sys/kernel/debug", "debugfs", 0, 0))
return errno;
return 0;
}
+1
View File
@@ -0,0 +1 @@
int debugfs_init(void);
+2
View File
@@ -517,6 +517,8 @@ int main(int argc, char **argv)
if (ctx.surface == NULL)
return ENOMEM;
debugfs_init();
init_gpu_top(&ctx, &ctx.gpu_top);
init_gpu_perf(&ctx, &ctx.gpu_perf);
init_gpu_freq(&ctx, &ctx.gpu_freq);