diff --git a/common/utils/itti/timer.c b/common/utils/itti/timer.c index 009a47c188563a18bd1c8c5ccdbbe0b1d9d7dfa6..faee3908fcb85fa4bda73fb1c1b0ab047984afd7 100644 --- a/common/utils/itti/timer.c +++ b/common/utils/itti/timer.c @@ -41,14 +41,19 @@ #include "assertions.h" #include "intertask_interface.h" #include "timer.h" - +#include "log.h" #include "queue.h" +#if defined (LOG_D) && defined (LOG_E) +# define TMR_DEBUG(x, args...) LOG_D(TMR, x, ##args) +# define TMR_ERROR(x, args...) LOG_E(TMR, x, ##args) +#endif + #ifndef TMR_DEBUG -# define TMR_DEBUG(x, args...) do { fprintf(stdout, "[TMR][D]"x, ##args); } while(0) +# define TMR_DEBUG(x, args...) do { fprintf(stdout, "[TMR][D]"x, ##args); } while(0) #endif #ifndef TMR_ERROR -# define TMR_ERROR(x, args...) do { fprintf(stdout, "[TMR][E]"x, ##args); } while(0) +# define TMR_ERROR(x, args...) do { fprintf(stdout, "[TMR][E]"x, ##args); } while(0) #endif int timer_handle_signal(siginfo_t *info); @@ -204,6 +209,8 @@ int timer_setup( pthread_mutex_lock(&timer_desc.timer_list_mutex); STAILQ_INSERT_TAIL(&timer_desc.timer_queue, timer_p, entries); pthread_mutex_unlock(&timer_desc.timer_list_mutex); +#else + return -1; #endif return 0; diff --git a/targets/SIMU/USER/oaisim.c b/targets/SIMU/USER/oaisim.c index 0bc456bfe9b11bfa93ae596d2e370297513a9953..8da76d5052dd9c0af02ac47a130fd1d19174190f 100644 --- a/targets/SIMU/USER/oaisim.c +++ b/targets/SIMU/USER/oaisim.c @@ -74,7 +74,7 @@ char smbv_ip[16]; #include "enb_app.h" #if defined(ENABLE_ITTI) -# include "intertask_interface_init.h" +# include "intertask_interface.h" # include "timer.h" # if defined(ENABLE_USE_MME) # include "s1ap_eNB.h" @@ -963,10 +963,6 @@ int main(int argc, char **argv) { // get command-line options get_simulation_options (argc, argv); //Command-line options -#if defined(ENABLE_ITTI) - itti_init(TASK_MAX, THREAD_MAX, MESSAGES_ID_MAX, tasks_info, messages_info, messages_definition_xml, oai_emulation.info.itti_dump_file); -#endif - // Initialize VCD LOG module vcd_signal_dumper_init ("openair_dump.vcd"); diff --git a/targets/SIMU/USER/oaisim_config.c b/targets/SIMU/USER/oaisim_config.c index 005f9ef1e48f4b00b7adb961e8f98e7eab04a96a..eafabf0875a895704d3b6f69beca184dfc8ff7ff 100644 --- a/targets/SIMU/USER/oaisim_config.c +++ b/targets/SIMU/USER/oaisim_config.c @@ -14,6 +14,10 @@ #include "UTIL/OTG/otg_vars.h" #include "oml.h" +#if defined(ENABLE_ITTI) +# include "intertask_interface_init.h" +#endif + mapping log_level_names[] = { {"emerg", LOG_EMERG}, @@ -381,6 +385,10 @@ void oaisim_config() { //initialize the log generator logInit(); +#if defined(ENABLE_ITTI) + itti_init(TASK_MAX, THREAD_MAX, MESSAGES_ID_MAX, tasks_info, messages_info, messages_definition_xml, oai_emulation.info.itti_dump_file); +#endif + // init ocg if enabled, otherwise take the params form the init_oai_emulation() // and command line options given by the user if (oai_emulation.info.ocg_enabled == 1){ // activate OCG: xml-based scenario parser @@ -1007,9 +1015,12 @@ int ocg_config_emu(){ if (oai_emulation.emulation_config.emulation_time_ms != 0) { oai_emulation.info.n_frames = (int) oai_emulation.emulation_config.emulation_time_ms / 10; // configure the number of frame oai_emulation.info.n_frames_flag = 1; + } + if (oai_emulation.info.n_frames_flag) { LOG_I(OCG, "number of frames in emulation is set to %d\n", oai_emulation.info.n_frames); - } else + } else { LOG_I(OCG, "number of frames in emulation is set to infinity\n"); + } oai_emulation.info.seed = (oai_emulation.emulation_config.seed.value == 0) ? oai_emulation.info.seed : oai_emulation.emulation_config.seed.value; LOG_I (OCG,"The seed value is set to %d \n", oai_emulation.info.seed );