summaryrefslogtreecommitdiff
path: root/lib/igt_debugfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/igt_debugfs.c')
-rw-r--r--lib/igt_debugfs.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c
index fb13a88b..9142e3f7 100644
--- a/lib/igt_debugfs.c
+++ b/lib/igt_debugfs.c
@@ -38,6 +38,7 @@
#include "igt_aux.h"
#include "igt_kms.h"
#include "igt_debugfs.h"
+#include "igt_sysfs.h"
/**
* SECTION:igt_debugfs
@@ -815,3 +816,16 @@ int igt_debugfs_dir(int device)
igt_debug("Opening debugfs dir %s\n", path);
return open(path, O_RDONLY);
}
+
+void igt_debugfs_dump(int device, const char *filename)
+{
+ char *contents;
+ int dir;
+
+ dir = igt_debugfs_dir(device);
+ contents = igt_sysfs_get(dir, filename);
+ close(dir);
+
+ igt_debug("%s:\n%s\n", filename, contents);
+ free(contents);
+}