From 0bdbd0892b445ca08f7867a6aa2996a8b9513229 Mon Sep 17 00:00:00 2001 From: winckel <winckel@eurecom.fr> Date: Mon, 16 Dec 2013 14:16:28 +0000 Subject: [PATCH] Added a VCD log point for ITTI relay thread. tuned ITTI relay thread polling delay to 200 micro-seconds to have no RT tasks reacting within the same slot most of the time. git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4740 818b1a75-f10b-46b9-bf7c-635c3b92a50f --- common/utils/itti/intertask_interface.c | 10 +++++++++- openair2/UTIL/LOG/vcd_signal_dumper.c | 6 ++++-- openair2/UTIL/LOG/vcd_signal_dumper.h | 1 + 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/common/utils/itti/intertask_interface.c b/common/utils/itti/intertask_interface.c index 530e6a9e7e..1545b62bee 100644 --- a/common/utils/itti/intertask_interface.c +++ b/common/utils/itti/intertask_interface.c @@ -764,7 +764,11 @@ static void *itti_rt_relay_thread(void *arg) while (itti_desc.running) { - usleep (100); + usleep (200); // Poll for messages a little more than 2 time by slot to get a small latency between RT and other tasks + +#if defined(OAI_EMU) || defined(RTAI) + vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_ITTI_RELAY_THREAD, VCD_FUNCTION_IN); +#endif /* Checks for all non real time tasks if they have pending messages */ for (thread_id = THREAD_FIRST; thread_id < itti_desc.thread_max; thread_id++) @@ -785,6 +789,10 @@ static void *itti_rt_relay_thread(void *arg) } } } + +#if defined(OAI_EMU) || defined(RTAI) + vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_ITTI_RELAY_THREAD, VCD_FUNCTION_OUT); +#endif } return NULL; } diff --git a/openair2/UTIL/LOG/vcd_signal_dumper.c b/openair2/UTIL/LOG/vcd_signal_dumper.c index f178cf822f..25916ec563 100644 --- a/openair2/UTIL/LOG/vcd_signal_dumper.c +++ b/openair2/UTIL/LOG/vcd_signal_dumper.c @@ -165,6 +165,7 @@ const char* eurecomFunctionsNames[] = { "itti_enqueue_message", "itti_dump_enqueue_message", "itti_dump_enqueue_message_malloc", + "itti_relay_thread", "test" }; @@ -285,8 +286,8 @@ inline static uint32_t vcd_get_write_index(void) /* Wrap index */ write_index &= VCD_FIFO_MASK; - /* Check FIFO overflow */ - DevCheck((read_index = vcd_fifo.read_index, ((write_index + 1) & VCD_FIFO_MASK) != read_index), write_index, read_index, 0); + /* Check FIFO overflow (increase VCD_FIFO_NB_ELEMENTS if this assert is triggered) */ + DevCheck((read_index = vcd_fifo.read_index, ((write_index + 1) & VCD_FIFO_MASK) != read_index), write_index, read_index, VCD_FIFO_NB_ELEMENTS); return write_index; } @@ -314,6 +315,7 @@ void *vcd_dumper_thread_rt(void *args) data_ready_wait = 0; while (data->module == VCD_SIGNAL_DUMPER_MODULE_FREE) { + /* Check wait delay (increase VCD_MAX_WAIT_DELAY if this assert is triggered and that no thread is locked) */ DevCheck(data_ready_wait < VCD_MAX_WAIT_DELAY, data_ready_wait, VCD_MAX_WAIT_DELAY, 0); /* data is not yet ready, wait for it to be completed */ diff --git a/openair2/UTIL/LOG/vcd_signal_dumper.h b/openair2/UTIL/LOG/vcd_signal_dumper.h index 94f7af0af0..800be262b2 100644 --- a/openair2/UTIL/LOG/vcd_signal_dumper.h +++ b/openair2/UTIL/LOG/vcd_signal_dumper.h @@ -139,6 +139,7 @@ typedef enum VCD_SIGNAL_DUMPER_FUNCTIONS_ITTI_ENQUEUE_MESSAGE, VCD_SIGNAL_DUMPER_FUNCTIONS_ITTI_DUMP_ENQUEUE_MESSAGE, VCD_SIGNAL_DUMPER_FUNCTIONS_ITTI_DUMP_ENQUEUE_MESSAGE_MALLOC, + VCD_SIGNAL_DUMPER_FUNCTIONS_ITTI_RELAY_THREAD, VCD_SIGNAL_DUMPER_FUNCTIONS_TEST, VCD_SIGNAL_DUMPER_FUNCTIONS_LAST, VCD_SIGNAL_DUMPER_FUNCTIONS_END = VCD_SIGNAL_DUMPER_FUNCTIONS_LAST, -- GitLab