From 721d8747e3a2ae78b4fad33d32e4b4796c90a2af Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 27 Oct 2016 11:32:47 +0100 Subject: igt: Add a test for reordering execbufs Signed-off-by: Chris Wilson --- lib/igt_core.h | 2 ++ lib/igt_debugfs.c | 14 ++++++++++++++ lib/igt_debugfs.h | 1 + 3 files changed, 17 insertions(+) (limited to 'lib') 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__ */ -- cgit v1.2.3