From 4ebd09e6c6563e31a55b21589b7c8b9b1e26c292 Mon Sep 17 00:00:00 2001 From: Byeonggil Jun Date: Tue, 23 Apr 2024 10:07:26 -0700 Subject: [PATCH] Fix a trace point for DNET --- core/federated/RTI/rti_remote.c | 9 +++++++++ util/tracing/trace_util.c | 2 ++ 2 files changed, 11 insertions(+) diff --git a/core/federated/RTI/rti_remote.c b/core/federated/RTI/rti_remote.c index 9fbb440b7..8c9fd69e1 100644 --- a/core/federated/RTI/rti_remote.c +++ b/core/federated/RTI/rti_remote.c @@ -273,6 +273,15 @@ void notify_provisional_tag_advance_grant(scheduling_node_t* e, tag_t tag) { } void send_downstream_next_event_tag(scheduling_node_t* e, tag_t tag) { + if (e->state == NOT_CONNECTED) { + return; + } + // Need to make sure that the destination federate's thread has already + // sent the starting MSG_TYPE_TIMESTAMP message. + while (e->state == PENDING) { + // Need to wait here. + lf_cond_wait(&sent_start_time); + } size_t message_length = 1 + sizeof(int64_t) + sizeof(uint32_t); unsigned char buffer[message_length]; buffer[0] = MSG_TYPE_DOWNSTREAM_NEXT_EVENT_TAG; diff --git a/util/tracing/trace_util.c b/util/tracing/trace_util.c index ffe0c6b8f..9c1a77592 100644 --- a/util/tracing/trace_util.c +++ b/util/tracing/trace_util.c @@ -96,6 +96,7 @@ const char* trace_event_names[] = { "Sending P2P_MSG", "Sending ADR_AD", "Sending ADR_QR", + "Sending DNET", // Receiving messages "Receiving ACK", "Receiving FAILED", @@ -118,6 +119,7 @@ const char* trace_event_names[] = { "Receiving P2P_MSG", "Receiving ADR_AD", "Receiving ADR_QR", + "Receiving DNET", "Receiving UNIDENTIFIED", };