xref: /aosp_15_r20/external/igt-gpu-tools/runner/job_list.h (revision d83cc019efdc2edc6c4b16e9034a3ceb8d35d77c)
1 #ifndef RUNNER_JOB_LIST_H
2 #define RUNNER_JOB_LIST_H
3 
4 #include <stdbool.h>
5 
6 #include "settings.h"
7 
8 struct job_list_entry {
9 	char *binary;
10 	char **subtests;
11 	/*
12 	 * 0 = all, or test has no subtests.
13 	 *
14 	 * If the original job_list was to run all subtests of a
15 	 * binary and such a run was incomplete, resuming from the
16 	 * execution journal will fill the subtest array with already
17 	 * started subtests prepended with '!' so the test binary will
18 	 * not run them. subtest_count will still reflect the size of
19 	 * the above array.
20 	 */
21 	size_t subtest_count;
22 };
23 
24 struct job_list
25 {
26 	struct job_list_entry *entries;
27 	size_t size;
28 };
29 
30 void generate_piglit_name(const char *binary, const char *subtest,
31 			  char *namebuf, size_t namebuf_size);
32 
33 void init_job_list(struct job_list *job_list);
34 void free_job_list(struct job_list *job_list);
35 bool create_job_list(struct job_list *job_list, struct settings *settings);
36 
37 bool serialize_job_list(struct job_list *job_list, struct settings *settings);
38 bool read_job_list(struct job_list *job_list, int dirfd);
39 void list_all_tests(struct job_list *lst);
40 
41 #endif
42