Commit c35ba1cf authored by winckel's avatar winckel

Use a bit mask with atomic or and and operations for VCD logging of ITTI...

Use a bit mask with atomic or and and operations for VCD logging of ITTI messages task IDs in messages handling functions to support correctly multi threading logging.
Separated eNB and UE frame and slot VCD logs.

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4556 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 945a6d6c
...@@ -156,6 +156,12 @@ typedef struct itti_desc_s { ...@@ -156,6 +156,12 @@ typedef struct itti_desc_s {
#ifdef RTAI #ifdef RTAI
pthread_t rt_relay_thread; pthread_t rt_relay_thread;
#endif #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; } itti_desc_t;
static itti_desc_t itti_desc; 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 ...@@ -293,7 +299,8 @@ int itti_send_msg_to_task(task_id_t destination_task_id, instance_t instance, Me
uint32_t message_id; uint32_t message_id;
#if defined(OAI_EMU) || defined(RTAI) #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 #endif
DevAssert(message != NULL); DevAssert(message != NULL);
...@@ -328,7 +335,7 @@ int itti_send_msg_to_task(task_id_t destination_task_id, instance_t instance, Me ...@@ -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 (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); vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_ITTI_ENQUEUE_MESSAGE, VCD_FUNCTION_IN);
#endif #endif
...@@ -348,7 +355,7 @@ int itti_send_msg_to_task(task_id_t destination_task_id, instance_t instance, Me ...@@ -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 */ /* Enqueue message in destination task queue */
lfds611_queue_enqueue(itti_desc.tasks[destination_task_id].message_queue, new); 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); vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_ITTI_ENQUEUE_MESSAGE, VCD_FUNCTION_OUT);
#endif #endif
...@@ -383,7 +390,8 @@ int itti_send_msg_to_task(task_id_t destination_task_id, instance_t instance, Me ...@@ -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) #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 #endif
return 0; return 0;
...@@ -526,12 +534,14 @@ static inline void itti_receive_msg_internal_event_fd(task_id_t task_id, uint8_t ...@@ -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) void itti_receive_msg(task_id_t task_id, MessageDef **received_msg)
{ {
#if defined(OAI_EMU) || defined(RTAI) #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 #endif
itti_receive_msg_internal_event_fd(task_id, 0, received_msg); itti_receive_msg_internal_event_fd(task_id, 0, received_msg);
#if defined(OAI_EMU) || defined(RTAI) #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 #endif
} }
...@@ -542,7 +552,8 @@ void itti_poll_msg(task_id_t task_id, MessageDef **received_msg) { ...@@ -542,7 +552,8 @@ void itti_poll_msg(task_id_t task_id, MessageDef **received_msg) {
*received_msg = NULL; *received_msg = NULL;
#if defined(OAI_EMU) || defined(RTAI) #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 #endif
{ {
...@@ -560,7 +571,8 @@ void itti_poll_msg(task_id_t task_id, MessageDef **received_msg) { ...@@ -560,7 +571,8 @@ void itti_poll_msg(task_id_t task_id, MessageDef **received_msg) {
} }
#if defined(OAI_EMU) || defined(RTAI) #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 #endif
} }
...@@ -779,6 +791,12 @@ int itti_init(task_id_t task_max, thread_id_t thread_max, MessagesIds messages_i ...@@ -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); DevAssert(pthread_create (&itti_desc.rt_relay_thread, NULL, itti_rt_relay_thread, NULL) >= 0);
#endif #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); itti_dump_init (messages_definition_xml, dump_file_name);
#ifndef RTAI #ifndef RTAI
......
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
#include "intertask_interface.h" #include "intertask_interface.h"
#include "intertask_interface_dump.h" #include "intertask_interface_dump.h"
#if defined(RTAI) #if defined(OAI_EMU) || defined(RTAI)
#include "vcd_signal_dumper.h" #include "vcd_signal_dumper.h"
#endif #endif
...@@ -264,7 +264,7 @@ static int itti_dump_enqueue_message(itti_dump_queue_item_t *new, uint32_t messa ...@@ -264,7 +264,7 @@ static int itti_dump_enqueue_message(itti_dump_queue_item_t *new, uint32_t messa
DevAssert(new != NULL); 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); vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_ITTI_DUMP_ENQUEUE_MESSAGE, VCD_FUNCTION_IN);
#endif #endif
...@@ -292,7 +292,7 @@ static int itti_dump_enqueue_message(itti_dump_queue_item_t *new, uint32_t messa ...@@ -292,7 +292,7 @@ static int itti_dump_enqueue_message(itti_dump_queue_item_t *new, uint32_t messa
} }
#endif #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); vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_ITTI_DUMP_ENQUEUE_MESSAGE, VCD_FUNCTION_OUT);
#endif #endif
......
...@@ -76,8 +76,10 @@ struct vcd_module_s { ...@@ -76,8 +76,10 @@ struct vcd_module_s {
} vcd_module_s; } vcd_module_s;
const char* eurecomVariablesNames[] = { const char* eurecomVariablesNames[] = {
"frame_number", "frame_number_eNB",
"slot_number", "slot_number_eNB",
"frame_number_UE",
"slot_number_UE",
"daq_mbox", "daq_mbox",
"diff2", "diff2",
"itti_send_msg", "itti_send_msg",
......
...@@ -45,8 +45,10 @@ ...@@ -45,8 +45,10 @@
/* WARNING: if you edit the enums below, update also string definitions in vcd_signal_dumper.c */ /* WARNING: if you edit the enums below, update also string definitions in vcd_signal_dumper.c */
typedef enum typedef enum
{ {
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER = 0, VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_ENB = 0,
VCD_SIGNAL_DUMPER_VARIABLES_SLOT_NUMBER, 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_DAQ_MBOX,
VCD_SIGNAL_DUMPER_VARIABLES_DIFF, VCD_SIGNAL_DUMPER_VARIABLES_DIFF,
VCD_SIGNAL_DUMPER_VARIABLE_ITTI_SEND_MSG, VCD_SIGNAL_DUMPER_VARIABLE_ITTI_SEND_MSG,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment