Chris Wilson 55b8c33ca5 overlay: Auatomatically mount debugfs
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-19 18:16:11 +01:00

22 lines
332 B
C

#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;
}