summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-10-27 11:32:47 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2016-11-07 11:20:28 +0000
commit721d8747e3a2ae78b4fad33d32e4b4796c90a2af (patch)
tree91564709e30c499efe4fea3ab6c824c19a09ab9e /lib
parent874a2072251d94f7e6c6565932cc36b7df2dfc6b (diff)
igt: Add a test for reordering execbufs
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'lib')
-rw-r--r--lib/igt_core.h2
-rw-r--r--lib/igt_debugfs.c14
-rw-r--r--lib/igt_debugfs.h1
3 files changed, 17 insertions, 0 deletions
diff --git a/lib/igt_core.h b/lib/igt_core.h
index 03be757c..dd7fc123 100644
--- a/lib/igt_core.h
+++ b/lib/igt_core.h
@@ -231,6 +231,7 @@ void __igt_subtest_group_restore(int);
#define igt_main \
static void igt_tokencat(__real_main, __LINE__)(void); \
int main(int argc, char **argv) { \
+ sync(); \
igt_subtest_init_parse_opts(&argc, argv, NULL, NULL, NULL, \
NULL, NULL); \
igt_tokencat(__real_main, __LINE__)(); \
@@ -271,6 +272,7 @@ void igt_simple_init_parse_opts(int *argc, char **argv,
#define igt_simple_main \
static void igt_tokencat(__real_main, __LINE__)(void); \
int main(int argc, char **argv) { \
+ sync(); \
igt_simple_init_parse_opts(&argc, argv, NULL, NULL, NULL, \
NULL, NULL); \
igt_tokencat(__real_main, __LINE__)(); \
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);
+}
diff --git a/lib/igt_debugfs.h b/lib/igt_debugfs.h
index 8289e9d0..fb189322 100644
--- a/lib/igt_debugfs.h
+++ b/lib/igt_debugfs.h
@@ -189,5 +189,6 @@ void igt_enable_prefault(void);
int igt_get_stable_obj_count(int driver);
int igt_debugfs_dir(int device);
+void igt_debugfs_dump(int device, const char *filename);
#endif /* __IGT_DEBUGFS_H__ */