diff --git a/common/utils/itti/intertask_interface.c b/common/utils/itti/intertask_interface.c index b4690ad1b5116bd930919325c2787afd6d01cbeb..a221f30929fb98f0282ed21ff855c338245b09a8 100644 --- a/common/utils/itti/intertask_interface.c +++ b/common/utils/itti/intertask_interface.c @@ -156,6 +156,12 @@ typedef struct itti_desc_s { #ifdef RTAI pthread_t rt_relay_thread; #endif + +#if defined(OAI_EMU) || defined(RTAI) + uint64_t vcd_poll_msg; + uint64_t vcd_receive_msg; + uint64_t vcd_send_msg; +#endif } itti_desc_t; static itti_desc_t itti_desc; @@ -293,7 +299,8 @@ int itti_send_msg_to_task(task_id_t destination_task_id, instance_t instance, Me uint32_t message_id; #if defined(OAI_EMU) || defined(RTAI) - vcd_signal_dumper_dump_variable_by_name(VCD_SIGNAL_DUMPER_VARIABLE_ITTI_SEND_MSG, 1L << destination_task_id); + vcd_signal_dumper_dump_variable_by_name(VCD_SIGNAL_DUMPER_VARIABLE_ITTI_SEND_MSG, + __sync_or_and_fetch (&itti_desc.vcd_send_msg, 1L << destination_task_id)); #endif DevAssert(message != NULL); @@ -328,7 +335,7 @@ int itti_send_msg_to_task(task_id_t destination_task_id, instance_t instance, Me if (destination_task_id != TASK_UNKNOWN) { -#if defined(RTAI) +#if defined(OAI_EMU) || defined(RTAI) vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_ITTI_ENQUEUE_MESSAGE, VCD_FUNCTION_IN); #endif @@ -348,7 +355,7 @@ int itti_send_msg_to_task(task_id_t destination_task_id, instance_t instance, Me /* Enqueue message in destination task queue */ lfds611_queue_enqueue(itti_desc.tasks[destination_task_id].message_queue, new); -#if defined(RTAI) +#if defined(OAI_EMU) || defined(RTAI) vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_ITTI_ENQUEUE_MESSAGE, VCD_FUNCTION_OUT); #endif @@ -383,7 +390,8 @@ int itti_send_msg_to_task(task_id_t destination_task_id, instance_t instance, Me } #if defined(OAI_EMU) || defined(RTAI) - vcd_signal_dumper_dump_variable_by_name(VCD_SIGNAL_DUMPER_VARIABLE_ITTI_SEND_MSG, 0); + vcd_signal_dumper_dump_variable_by_name(VCD_SIGNAL_DUMPER_VARIABLE_ITTI_SEND_MSG, + __sync_and_and_fetch (&itti_desc.vcd_send_msg, ~(1L << destination_task_id))); #endif return 0; @@ -526,12 +534,14 @@ static inline void itti_receive_msg_internal_event_fd(task_id_t task_id, uint8_t void itti_receive_msg(task_id_t task_id, MessageDef **received_msg) { #if defined(OAI_EMU) || defined(RTAI) - vcd_signal_dumper_dump_variable_by_name(VCD_SIGNAL_DUMPER_VARIABLE_ITTI_RECV_MSG, 0); + vcd_signal_dumper_dump_variable_by_name(VCD_SIGNAL_DUMPER_VARIABLE_ITTI_RECV_MSG, + __sync_and_and_fetch (&itti_desc.vcd_receive_msg, ~(1L << task_id))); #endif itti_receive_msg_internal_event_fd(task_id, 0, received_msg); #if defined(OAI_EMU) || defined(RTAI) - vcd_signal_dumper_dump_variable_by_name(VCD_SIGNAL_DUMPER_VARIABLE_ITTI_RECV_MSG, 1L << task_id); + vcd_signal_dumper_dump_variable_by_name(VCD_SIGNAL_DUMPER_VARIABLE_ITTI_RECV_MSG, + __sync_or_and_fetch (&itti_desc.vcd_receive_msg, 1L << task_id)); #endif } @@ -542,7 +552,8 @@ void itti_poll_msg(task_id_t task_id, MessageDef **received_msg) { *received_msg = NULL; #if defined(OAI_EMU) || defined(RTAI) - vcd_signal_dumper_dump_variable_by_name(VCD_SIGNAL_DUMPER_VARIABLE_ITTI_POLL_MSG, 1L << task_id); + vcd_signal_dumper_dump_variable_by_name(VCD_SIGNAL_DUMPER_VARIABLE_ITTI_POLL_MSG, + __sync_or_and_fetch (&itti_desc.vcd_poll_msg, 1L << task_id)); #endif { @@ -560,7 +571,8 @@ void itti_poll_msg(task_id_t task_id, MessageDef **received_msg) { } #if defined(OAI_EMU) || defined(RTAI) - vcd_signal_dumper_dump_variable_by_name(VCD_SIGNAL_DUMPER_VARIABLE_ITTI_POLL_MSG, 0); + vcd_signal_dumper_dump_variable_by_name(VCD_SIGNAL_DUMPER_VARIABLE_ITTI_POLL_MSG, + __sync_and_and_fetch (&itti_desc.vcd_poll_msg, ~(1L << task_id))); #endif } @@ -779,6 +791,12 @@ int itti_init(task_id_t task_max, thread_id_t thread_max, MessagesIds messages_i DevAssert(pthread_create (&itti_desc.rt_relay_thread, NULL, itti_rt_relay_thread, NULL) >= 0); #endif +#if defined(OAI_EMU) || defined(RTAI) + itti_desc.vcd_poll_msg = 0; + itti_desc.vcd_receive_msg = 0; + itti_desc.vcd_send_msg = 0; +#endif + itti_dump_init (messages_definition_xml, dump_file_name); #ifndef RTAI diff --git a/common/utils/itti/intertask_interface_dump.c b/common/utils/itti/intertask_interface_dump.c index e90a5cb542439639d831d161ed18123bc3433276..9ee159d2a843aa44890c1ef5713655edb5dc6967 100644 --- a/common/utils/itti/intertask_interface_dump.c +++ b/common/utils/itti/intertask_interface_dump.c @@ -58,7 +58,7 @@ #include "intertask_interface.h" #include "intertask_interface_dump.h" -#if defined(RTAI) +#if defined(OAI_EMU) || defined(RTAI) #include "vcd_signal_dumper.h" #endif @@ -264,7 +264,7 @@ static int itti_dump_enqueue_message(itti_dump_queue_item_t *new, uint32_t messa DevAssert(new != NULL); -#if defined(RTAI) +#if defined(OAI_EMU) || defined(RTAI) vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_ITTI_DUMP_ENQUEUE_MESSAGE, VCD_FUNCTION_IN); #endif @@ -292,7 +292,7 @@ static int itti_dump_enqueue_message(itti_dump_queue_item_t *new, uint32_t messa } #endif -#if defined(RTAI) +#if defined(OAI_EMU) || defined(RTAI) vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_ITTI_DUMP_ENQUEUE_MESSAGE, VCD_FUNCTION_OUT); #endif diff --git a/openair2/UTIL/LOG/vcd_signal_dumper.c b/openair2/UTIL/LOG/vcd_signal_dumper.c index a4628167096c78182447817d31479a06bf81e21b..5ed1aa1d17fcf75f7fabac2cb2289356c419058c 100644 --- a/openair2/UTIL/LOG/vcd_signal_dumper.c +++ b/openair2/UTIL/LOG/vcd_signal_dumper.c @@ -76,8 +76,10 @@ struct vcd_module_s { } vcd_module_s; const char* eurecomVariablesNames[] = { - "frame_number", - "slot_number", + "frame_number_eNB", + "slot_number_eNB", + "frame_number_UE", + "slot_number_UE", "daq_mbox", "diff2", "itti_send_msg", diff --git a/openair2/UTIL/LOG/vcd_signal_dumper.h b/openair2/UTIL/LOG/vcd_signal_dumper.h index 98042f2fe7743daf834e5ee0c8c76e7e05f5aad2..e8bca4a20bac95b9970ea74f42bbf4f07e546bf2 100644 --- a/openair2/UTIL/LOG/vcd_signal_dumper.h +++ b/openair2/UTIL/LOG/vcd_signal_dumper.h @@ -45,8 +45,10 @@ /* WARNING: if you edit the enums below, update also string definitions in vcd_signal_dumper.c */ typedef enum { - VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER = 0, - VCD_SIGNAL_DUMPER_VARIABLES_SLOT_NUMBER, + VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_ENB = 0, + VCD_SIGNAL_DUMPER_VARIABLES_SLOT_NUMBER_ENB, + VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_UE, + VCD_SIGNAL_DUMPER_VARIABLES_SLOT_NUMBER_UE, VCD_SIGNAL_DUMPER_VARIABLES_DAQ_MBOX, VCD_SIGNAL_DUMPER_VARIABLES_DIFF, VCD_SIGNAL_DUMPER_VARIABLE_ITTI_SEND_MSG,