[PATCH i-g-t 6/7] HAX: debug messages
Dominik Karol Piatkowski
dominik.karol.piatkowski at intel.com
Wed May 24 10:30:30 UTC 2023
---
lib/igt_ktap.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 46 insertions(+)
diff --git a/lib/igt_ktap.c b/lib/igt_ktap.c
index 11f4a607..ee112d81 100644
--- a/lib/igt_ktap.c
+++ b/lib/igt_ktap.c
@@ -336,6 +336,8 @@ void *igt_ktap_parser(void *unused)
char record[BUF_LEN + 1];
bool is_builtin = ktap_args.is_builtin;
+ int debug_counter = 0;
+
struct ktap_test_results_element *r, *temp;
struct timespec last_kmsg, current;
@@ -370,27 +372,41 @@ igt_ktap_parser_start:
igt_warn("kmsg truncated: too many messages. You may want to increase log_buf_len in kmcdline\n");
continue;
}
+ fprintf(stdout, "[DEBUG] read successful; results.still_running: %d\n", READ_ONCE(results.still_running));
+ fflush(stdout);
}
clock_gettime(CLOCK_MONOTONIC, &last_kmsg);
while (sublevel >= 0) {
+
+ fprintf(stdout, "[DEBUG] sublevel: %d\n", sublevel);
+ fflush(stdout);
+
switch (find_next_tap_subtest(fp, record, is_builtin)) {
case -2:
/* no more data to read */
+ fprintf(stdout, "[DEBUG] find_next_tap_subtest: -2\n");
+ fflush(stdout);
goto igt_ktap_parser_start;
case -1:
/* no test found, so we keep parsing */
+ fprintf(stdout, "[DEBUG] find_next_tap_subtest: -1\n");
+ fflush(stdout);
break;
case 0:
/*
* tests found, but they're missing info, so we might
* have read into test output
*/
+ fprintf(stdout, "[DEBUG] find_next_tap_subtest: 0\n");
+ fflush(stdout);
found_tests = true;
sublevel++;
break;
default:
+ fprintf(stdout, "[DEBUG] find_next_tap_subtest: default\n");
+ fflush(stdout);
while (read(fp_fd, record, BUF_LEN) < 0) {
if (errno == EINTR)
continue;
@@ -416,8 +432,12 @@ igt_ktap_parser_start:
switch (parse_kmsg_for_tap(fp, record, test_name)) {
case -2:
+ fprintf(stdout, "[DEBUG] parse_kmsg_for_tap: -2\n");
+ fflush(stdout);
goto igt_ktap_parser_start;
case -1:
+ fprintf(stdout, "[DEBUG] parse_kmsg_for_tap: -1\n");
+ fflush(stdout);
sublevel--;
failed_tests = true;
@@ -443,18 +463,44 @@ igt_ktap_parser_start:
test_name[0] = '\0';
break;
case 0: /* fallthrough */
+ fprintf(stdout, "[DEBUG] parse_kmsg_for_tap: 0\n");
+ fflush(stdout);
igt_subtest(test_name)
igt_success();
test_name[0] = '\0';
default:
+ fprintf(stdout, "[DEBUG] parse_kmsg_for_tap: default\n");
+ fflush(stdout);
+ break;
+ }
+
+ //DEBUG
+ if (elapsed(&last_kmsg, ¤t) > 0.5) {
+ results.still_running = false;
+ ktap_args.is_running = false;
+ break;
+ }
+
+ if (++debug_counter > 100) {
+ results.still_running = false;
+ ktap_args.is_running = false;
break;
}
+
}
+ fprintf(stdout, "[DEBUG] sublevel_after: %d\n", sublevel);
+ fflush(stdout);
+
if (sublevel < 0)
ktap_args.is_running = false;
+
+
}
+ fprintf(stdout, "[DEBUG] outside main loop\n");
+ fflush(stdout);
+
if (failed_tests || !found_tests)
ktap_args.ret = IGT_EXIT_FAILURE;
else
--
2.34.1
More information about the Intel-gfx-trybot
mailing list