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 {
#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
......
......@@ -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
......
......@@ -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",
......
......@@ -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,
......
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