mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2026-08-21 13:23:02 +00:00
overlay: Auatomatically mount debugfs
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
@@ -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 \
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
int debugfs_init(void);
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user