[PATCH i-g-t v2 12/66] tests/xe_eudebug: Test open close events
Christoph Manszewski
christoph.manszewski at intel.com
Tue Jul 30 11:44:29 UTC 2024
From: Dominik Grzegorzek <dominik.grzegorzek at intel.com>
Introduce basic tests which validate client create/destroy events
sent on xe drm client open/close.
Signed-off-by: Mika Kuoppala <mika.kuoppala at linux.intel.com>
Signed-off-by: Dominik Grzegorzek <dominik.grzegorzek at intel.com>
Cc: Christoph Manszewski <christoph.manszewski at intel.com>
---
tests/intel/xe_eudebug.c | 49 +++++++++++++++++++++++++++++++++++++++-
1 file changed, 48 insertions(+), 1 deletion(-)
diff --git a/tests/intel/xe_eudebug.c b/tests/intel/xe_eudebug.c
index 44a491319..7ca0138a2 100644
--- a/tests/intel/xe_eudebug.c
+++ b/tests/intel/xe_eudebug.c
@@ -12,8 +12,16 @@
* Test category: functionality test
*/
-#include <xe_drm.h>
#include "igt.h"
+#include "xe/xe_eudebug.h"
+
+static void run_basic_client(struct xe_eudebug_client *c)
+{
+ int fd;
+
+ fd = xe_eudebug_client_open_driver(c);
+ xe_eudebug_client_close_driver(c, fd);
+}
static int __debug_connect(int fd, int *debugfd, struct drm_xe_eudebug_connect *param)
{
@@ -116,6 +124,39 @@ static void test_close(int fd)
close(debug_fd1);
}
+/**
+ * SUBTEST: basic-client
+ * Description:
+ * Attach the debugger to process which opens and closes xe drm client.
+ *
+ * SUBTEST: multiple-sessions
+ * Description:
+ * Simultaneously attach many debuggers to many processes.
+ * Each process opens and closes xe drm client.
+ */
+
+static void test_basic_sessions(int fd, unsigned int flags, int count)
+{
+ struct xe_eudebug_session **s;
+ int i;
+
+ s = calloc(count, sizeof(*s));
+
+ igt_assert(s);
+
+ for (i = 0; i < count; i++)
+ s[i] = xe_eudebug_session_create(fd, run_basic_client, flags, NULL);
+
+ for (i = 0; i < count; i++)
+ xe_eudebug_session_run(s[i]);
+
+ for (i = 0; i < count; i++)
+ xe_eudebug_session_check(s[i], true, 0);
+
+ for (i = 0; i < count; i++)
+ xe_eudebug_session_destroy(s[i]);
+}
+
igt_main
{
int fd;
@@ -130,6 +171,12 @@ igt_main
igt_subtest("basic-close")
test_close(fd);
+ igt_subtest("basic-client")
+ test_basic_sessions(fd, 0, 1);
+
+ igt_subtest("multiple-sessions")
+ test_basic_sessions(fd, 0, 4);
+
igt_fixture
drm_close_driver(fd);
}
--
2.34.1
More information about the igt-dev
mailing list