Lines Matching refs:msg

1017 static inline const char *str_msg(const struct msg *msg, char *buf)  in str_msg()  argument
1019 switch (msg->type) { in str_msg()
1021 sprintf(buf, "MSG_DO_TEST %d", msg->do_test.num); in str_msg()
1025 msg->test_done.num, in str_msg()
1026 msg->test_done.have_log); in str_msg()
1030 msg->subtest_done.num, in str_msg()
1031 msg->subtest_done.have_log); in str_msg()
1035 strlen(msg->test_log.log_buf), in str_msg()
1036 msg->test_log.is_last); in str_msg()
1049 static int send_message(int sock, const struct msg *msg) in send_message() argument
1054 fprintf(stderr, "Sending msg: %s\n", str_msg(msg, buf)); in send_message()
1055 return send(sock, msg, sizeof(*msg), 0); in send_message()
1058 static int recv_message(int sock, struct msg *msg) in recv_message() argument
1063 memset(msg, 0, sizeof(*msg)); in recv_message()
1064 ret = recv(sock, msg, sizeof(*msg), 0); in recv_message()
1067 fprintf(stderr, "Received msg: %s\n", str_msg(msg, buf)); in recv_message()
1111 static int read_prog_test_msg(int sock_fd, struct msg *msg, enum msg_type type) in read_prog_test_msg() argument
1113 if (recv_message(sock_fd, msg) < 0) in read_prog_test_msg()
1116 if (msg->type != type) { in read_prog_test_msg()
1117 printf("%s: unexpected message type %d. expected %d\n", __func__, msg->type, type); in read_prog_test_msg()
1134 struct msg msg; in dispatch_thread_read_log() local
1136 if (read_prog_test_msg(sock_fd, &msg, MSG_TEST_LOG)) { in dispatch_thread_read_log()
1141 fprintf(log_fp, "%s", msg.test_log.log_buf); in dispatch_thread_read_log()
1142 if (msg.test_log.is_last) in dispatch_thread_read_log()
1154 struct msg msg; in dispatch_thread_send_subtests() local
1165 if (read_prog_test_msg(sock_fd, &msg, MSG_SUBTEST_DONE)) in dispatch_thread_send_subtests()
1168 subtest_state->name = strdup(msg.subtest_done.name); in dispatch_thread_send_subtests()
1169 subtest_state->error_cnt = msg.subtest_done.error_cnt; in dispatch_thread_send_subtests()
1170 subtest_state->skipped = msg.subtest_done.skipped; in dispatch_thread_send_subtests()
1171 subtest_state->filtered = msg.subtest_done.filtered; in dispatch_thread_send_subtests()
1174 if (msg.subtest_done.have_log) in dispatch_thread_send_subtests()
1217 struct msg msg_do_test; in dispatch_thread()
1231 struct msg msg; in dispatch_thread() local
1233 if (read_prog_test_msg(sock_fd, &msg, MSG_TEST_DONE)) in dispatch_thread()
1235 if (test_to_run != msg.test_done.num) in dispatch_thread()
1240 state->error_cnt = msg.test_done.error_cnt; in dispatch_thread()
1241 state->skip_cnt = msg.test_done.skip_cnt; in dispatch_thread()
1242 state->sub_succ_cnt = msg.test_done.sub_succ_cnt; in dispatch_thread()
1243 state->subtest_num = msg.test_done.subtest_num; in dispatch_thread()
1246 if (msg.test_done.have_log) { in dispatch_thread()
1271 struct msg msg_exit; in dispatch_thread()
1445 struct msg msg_log; in worker_main_send_log()
1478 struct msg msg; in worker_main_send_subtests() local
1481 memset(&msg, 0, sizeof(msg)); in worker_main_send_subtests()
1482 msg.type = MSG_SUBTEST_DONE; in worker_main_send_subtests()
1487 msg.subtest_done.num = i; in worker_main_send_subtests()
1489 strncpy(msg.subtest_done.name, subtest_state->name, MAX_SUBTEST_NAME); in worker_main_send_subtests()
1491 msg.subtest_done.error_cnt = subtest_state->error_cnt; in worker_main_send_subtests()
1492 msg.subtest_done.skipped = subtest_state->skipped; in worker_main_send_subtests()
1493 msg.subtest_done.filtered = subtest_state->filtered; in worker_main_send_subtests()
1494 msg.subtest_done.have_log = false; in worker_main_send_subtests()
1498 msg.subtest_done.have_log = true; in worker_main_send_subtests()
1501 if (send_message(sock, &msg) < 0) { in worker_main_send_subtests()
1508 if (msg.subtest_done.have_log) in worker_main_send_subtests()
1528 struct msg msg; in worker_main() local
1530 if (recv_message(sock, &msg) < 0) in worker_main()
1533 switch (msg.type) { in worker_main()
1540 int test_to_run = msg.do_test.num; in worker_main()
1543 struct msg msg; in worker_main() local
1553 memset(&msg, 0, sizeof(msg)); in worker_main()
1554 msg.type = MSG_TEST_DONE; in worker_main()
1555 msg.test_done.num = test_to_run; in worker_main()
1556 msg.test_done.error_cnt = state->error_cnt; in worker_main()
1557 msg.test_done.skip_cnt = state->skip_cnt; in worker_main()
1558 msg.test_done.sub_succ_cnt = state->sub_succ_cnt; in worker_main()
1559 msg.test_done.subtest_num = state->subtest_num; in worker_main()
1560 msg.test_done.have_log = false; in worker_main()
1564 msg.test_done.have_log = true; in worker_main()
1566 if (send_message(sock, &msg) < 0) { in worker_main()
1572 if (msg.test_done.have_log) in worker_main()