mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2026-08-20 21:02:59 +00:00
lib/drmtest: extract igt_fork from gem_concurrent_blt
Making sure that we correctly collect the exit codes from all children is a bit a hassle. So add another magic igt codeblock for easy forking and joining. Note that children are (currently at least) not allowed to call igt_skip. Add an assert to enforce this. v2: - Properly propagate the exit code. - Fix the segfault. - Add a child int and num_children paramter to the magic codeblock as suggested by Chris Wilson. - Don't dump noise into stdout when a child thread fails, the parent will do that for us already. v3: Now with some docs. v4: Fixup igt_waitchildren to properly reset state so it can be used again. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
@@ -204,6 +204,20 @@ void __igt_fixture_end(void) __attribute__((noreturn));
|
||||
igt_tokencat(__tmpint,__LINE__) ++, \
|
||||
__igt_fixture_complete())
|
||||
|
||||
bool __igt_fork(void);
|
||||
/**
|
||||
* igt_fork - fork parallel test threads with fork()
|
||||
* @child: name of the int variable with the child number
|
||||
* @num_children: number of children to fork
|
||||
*
|
||||
* Joining all test threads should be done with igt_waitchildren to ensure that
|
||||
* the exit codes of all children are properly reflected in the test status.
|
||||
*/
|
||||
#define igt_fork(child, num_children) \
|
||||
for (int child = 0; child < (num_children); child++) \
|
||||
for (; __igt_fork(); exit(0))
|
||||
void igt_waitchildren(void);
|
||||
|
||||
/* check functions which auto-skip tests by calling igt_skip() */
|
||||
void gem_require_caching(int fd);
|
||||
static inline void gem_require_ring(int fd, int ring_id)
|
||||
|
||||
Reference in New Issue
Block a user