Commit c22180ff authored by Cedric Roux's avatar Cedric Roux
Browse files

Merge remote-tracking branch 'origin/issue326_LOGreview' into develop_integration_2018_w35

Conflicts:
	cmake_targets/CMakeLists.txt
	openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c
	openair1/SCHED_UE/phy_procedures_lte_ue.c
	openair2/LAYER2/MAC/eNB_scheduler_phytest.c
parents 7654f8a2 9399dd97
......@@ -892,12 +892,9 @@ add_library(HASHTABLE
)
include_directories(${OPENAIR_DIR}/common/utils/hashtable)
if (MESSAGE_CHART_GENERATOR)
add_library(MSC
${OPENAIR_DIR}/common/utils/msc/msc.c
)
set(MSC_LIB MSC)
endif()
add_library(msc MODULE ${OPENAIR_DIR}/common/utils/msc/msc.c )
target_link_libraries (msc LFDS)
include_directories(${OPENAIR_DIR}/common/utils/msc)
set(UTIL_SRC
......@@ -1392,7 +1389,6 @@ include_directories(${NFAPI_USER_DIR})
add_library(CN_UTILS
${OPENAIR3_DIR}/UTILS/conversions.c
${OPENAIR3_DIR}/UTILS/enum_string.c
${OPENAIR3_DIR}/UTILS/log.c
${OPENAIR3_DIR}/UTILS/mcc_mnc_itu.c
)
......@@ -1567,7 +1563,6 @@ set(libnas_ies_OBJS
set (libnas_utils_OBJS
${NAS_SRC}COMMON/UTIL/device.c
${NAS_SRC}COMMON/UTIL/memory.c
${NAS_SRC}COMMON/UTIL/nas_log.c
${NAS_SRC}COMMON/UTIL/nas_timer.c
${NAS_SRC}COMMON/UTIL/socket.c
${NAS_SRC}COMMON/UTIL/stty.c
......@@ -1984,7 +1979,7 @@ add_executable(lte-softmodem-nos1
)
target_link_libraries (lte-softmodem-nos1
-Wl,--start-group
RRC_LIB SECU_CN SECU_OSA UTIL HASHTABLE SCHED_LIB SCHED_RU_LIB PHY_COMMON PHY PHY_RU LFDS L2 ${MSC_LIB} ${RAL_LIB} ${ITTI_LIB}
RRC_LIB SECU_CN SECU_OSA UTIL HASHTABLE SCHED_LIB SCHED_RU_LIB PHY_COMMON PHY PHY_RU LFDS L2 ${RAL_LIB} ${ITTI_LIB}
${MIH_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
-Wl,--end-group z dl )
......@@ -2062,7 +2057,7 @@ add_executable(lte-uesoftmodem-nos1
target_link_libraries (lte-uesoftmodem-nos1
-Wl,--start-group
RRC_LIB SECU_CN SECU_OSA UTIL HASHTABLE SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_UE PHY_RU LFDS L2_UE SIMU ${MSC_LIB} ${RAL_LIB} ${ITTI_LIB}
RRC_LIB SECU_CN SECU_OSA UTIL HASHTABLE SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_UE PHY_RU LFDS L2_UE SIMU ${RAL_LIB} ${ITTI_LIB}
${MIH_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES}
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
-Wl,--end-group z dl )
......@@ -2140,7 +2135,7 @@ add_executable(test_epc_generate_scenario
${OPENAIR3_DIR}/S1AP/s1ap_eNB_defs.h
)
target_link_libraries (test_epc_generate_scenario
-Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS ${ITTI_LIB} ${MSC_LIB} L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIBRARIES}
-Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS ${ITTI_LIB} L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIBRARIES}
)
add_executable(test_epc_play_scenario
......
......@@ -40,7 +40,7 @@ set_openair_env
gen_nvram_path=$OPENAIR_DIR/targets/bin
conf_nvram_path=$OPENAIR_DIR/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf
MSC_GEN="False"
MSC_GEN=0
XFORMS="True"
UE_EXPANSION="False"
PRINT_STATS="False"
......@@ -155,6 +155,10 @@ Options
Disable all LOG_* macros
--build-eclipse
Build eclipse project files. Paths are auto corrected by fixprj.sh
--build-telnet
Build telnet server, specify --telnetsrv on command line to start it (eNB only)
--build-msc
Build MSC tracing utility, specify --msc on command line to start it (eNB and UE)
--usrp-recplay
Build for I/Q record-playback modes
--ue-nas-use-tun
......@@ -345,6 +349,10 @@ function main() {
--build-telnetsrv)
BUILD_TELNETSRV=1
echo_info "Build embedded telnet server"
shift ;;
--build-msc)
MSC_GEN=1
echo_info "Build MSC tracing utility"
shift ;;
--usrp-recplay)
USRP_REC_PLAY="True"
......@@ -690,6 +698,15 @@ function main() {
$build_dir telnetsrv \
libtelnetsrv.so $dbin/libtelnetsrv.so
fi
# Telnet server compilation
#####################
if [ "$MSC_GEN" = "1" ] ; then
build_dir=$lte_build_dir
compilations \
$build_dir msc \
libmsc.so $dbin/libmsc.so
fi
# build RF device and transport protocol libraries
#####################################
......
......@@ -27,7 +27,6 @@ set(CONF2UEDATA_LIB_SRC
${OPENAIR_DIR}/openair3/NAS/UE/API/USIM/usim_api.c
${OPENAIR_DIR}/openair3/NAS/UE/API/USIM/aka_functions.c
${OPENAIR_DIR}/openair3/NAS/COMMON/UTIL/memory.c
${OPENAIR_DIR}/openair3/NAS/COMMON/UTIL/nas_log.c
${OPENAIR_DIR}/openair3/NAS/COMMON/UTIL/OctetString.c
${OPENAIR_DIR}/openair3/NAS/COMMON/UTIL/TLVEncoder.c
${OPENAIR_DIR}/common/utils/utils.c
......
......@@ -38,7 +38,7 @@
#include "config_userapi.h"
void parse_stringlist(paramdef_t *cfgoptions, char *val)
int parse_stringlist(paramdef_t *cfgoptions, char *val)
{
char *atoken;
char *tokctx;
......@@ -63,7 +63,7 @@ int numelt=0;
printf_params("[LIBCONFIG] %s[%i]: %s\n", cfgoptions->optname,i,cfgoptions->strlistptr[i]);
atoken=strtok_r(NULL, ",",&tokctx);
}
cfgoptions->numelt=numelt;
return (cfgoptions->numelt > 0);
}
int processoption(paramdef_t *cfgoptions, char *value)
......@@ -95,7 +95,7 @@ char defbool[2]="1";
break;
case TYPE_STRINGLIST:
parse_stringlist(cfgoptions,tmpval);
optisset=parse_stringlist(cfgoptions,tmpval);
break;
case TYPE_UINT32:
case TYPE_INT32:
......
......@@ -54,7 +54,6 @@
mapping log_level_names[] = {
{"error", OAILOG_ERR},
{"file", OAILOG_FILE},
{"warn", OAILOG_WARNING},
{"info", OAILOG_INFO},
{"debug", OAILOG_DEBUG},
......@@ -70,18 +69,10 @@ mapping log_options[] = {
};
mapping log_maskmap[] = {
{"prach", DEBUG_PRACH},
{"RU", DEBUG_RU},
{"LTEESTIM", DEBUG_LTEESTIM},
{"ctrlsocket", DEBUG_CTRLSOCKET},
{"UE_PHYPROC", DEBUG_UE_PHYPROC},
{"UE_TIMING", UE_TIMING},
{NULL,-1}
};
mapping log_maskmap[] = LOG_MASKMAP_INIT;
char *log_level_highlight_start[] = {LOG_RED, LOG_GREEN, LOG_ORANGE, "", LOG_BLUE, LOG_CYBL}; /*!< \brief Optional start-format strings for highlighting */
char *log_level_highlight_end[] = {LOG_RESET,LOG_RESET,LOG_RESET,LOG_RESET, LOG_RESET,LOG_RESET}; /*!< \brief Optional end-format strings for highlighting */
char *log_level_highlight_start[] = {LOG_RED, LOG_ORANGE, "", LOG_BLUE, LOG_CYBL}; /*!< \brief Optional start-format strings for highlighting */
char *log_level_highlight_end[] = {LOG_RESET,LOG_RESET,LOG_RESET, LOG_RESET,LOG_RESET}; /*!< \brief Optional end-format strings for highlighting */
int write_file_matlab(const char *fname,const char *vname,void *data,int length,int dec,char format)
......@@ -243,14 +234,14 @@ int write_file_matlab(const char *fname,const char *vname,void *data,int length,
/* get log parameters from configuration file */
void log_getconfig(log_t *g_log) {
char *gloglevel = NULL;
int level;
int consolelog ;
paramdef_t logparams_defaults[] = LOG_GLOBALPARAMS_DESC;
paramdef_t logparams_level[MAX_LOG_PREDEF_COMPONENTS];
paramdef_t logparams_logfile[MAX_LOG_PREDEF_COMPONENTS];
paramdef_t logparams_debug[sizeof(log_maskmap)/sizeof(mapping)];
paramdef_t logparams_matlab[sizeof(log_maskmap)/sizeof(mapping)];
paramdef_t logparams_dump[sizeof(log_maskmap)/sizeof(mapping)];
int ret = config_get( logparams_defaults,sizeof(logparams_defaults)/sizeof(paramdef_t),CONFIG_STRING_LOG_PREFIX);
if (ret <0) {
......@@ -258,6 +249,7 @@ void log_getconfig(log_t *g_log) {
return;
}
/* set LOG display options (enable/disable color, thread name, level ) */
for(int i=0; i<logparams_defaults[LOG_OPTIONS_IDX].numelt ; i++) {
for(int j=0; log_options[j].name != NULL ; j++) {
if (strcmp(logparams_defaults[LOG_OPTIONS_IDX].strlistptr[i],log_options[j].name) == 0) {
......@@ -303,38 +295,40 @@ void log_getconfig(log_t *g_log) {
config_get( logparams_logfile, MAX_LOG_PREDEF_COMPONENTS,CONFIG_STRING_LOG_PREFIX);
/* now set the log levels and infile option, according to what we read */
for (int i=MIN_LOG_COMPONENTS; i < MAX_LOG_PREDEF_COMPONENTS; i++) {
level = map_str_to_int(log_level_names, *(logparams_level[i].strptr));
set_log(i, level,1);
g_log->log_component[i].level = map_str_to_int(log_level_names, *(logparams_level[i].strptr));
set_log(i, g_log->log_component[i].level);
if (*(logparams_logfile[i].uptr) == 1)
set_component_filelog(i);
}
/* build then read the debug and matlab parameter array */
/* build then read the debug and dump parameter array */
for (int i=0;log_maskmap[i].name != NULL ; i++) {
sprintf(logparams_debug[i].optname, LOG_CONFIG_DEBUG_FORMAT, log_maskmap[i].name);
sprintf(logparams_matlab[i].optname, LOG_CONFIG_MATLAB_FORMAT, log_maskmap[i].name);
sprintf(logparams_debug[i].optname, LOG_CONFIG_DEBUG_FORMAT, log_maskmap[i].name);
sprintf(logparams_dump[i].optname, LOG_CONFIG_DUMP_FORMAT, log_maskmap[i].name);
logparams_debug[i].defuintval = 0;
logparams_debug[i].type = TYPE_UINT;
logparams_debug[i].paramflags = PARAMFLAG_BOOL;
logparams_debug[i].uptr = NULL;
logparams_debug[i].chkPptr = NULL;
logparams_debug[i].numelt = 0;
logparams_matlab[i].defuintval = 0;
logparams_matlab[i].type = TYPE_UINT;
logparams_matlab[i].paramflags = PARAMFLAG_BOOL;
logparams_matlab[i].uptr = NULL;
logparams_matlab[i].chkPptr = NULL;
logparams_matlab[i].numelt = 0;
logparams_dump[i].defuintval = 0;
logparams_dump[i].type = TYPE_UINT;
logparams_dump[i].paramflags = PARAMFLAG_BOOL;
logparams_dump[i].uptr = NULL;
logparams_dump[i].chkPptr = NULL;
logparams_dump[i].numelt = 0;
}
config_get( logparams_debug,(sizeof(log_maskmap)/sizeof(mapping)) - 1 ,CONFIG_STRING_LOG_PREFIX);
config_get( logparams_matlab,(sizeof(log_maskmap)/sizeof(mapping)) - 1 ,CONFIG_STRING_LOG_PREFIX);
config_get( logparams_dump,(sizeof(log_maskmap)/sizeof(mapping)) - 1 ,CONFIG_STRING_LOG_PREFIX);
/* set the debug mask according to the debug parameters values */
for (int i=0; log_maskmap[i].name != NULL ; i++) {
if (*(logparams_debug[i].uptr) )
g_log->debug_mask = g_log->debug_mask | log_maskmap[i].value;
if (*(logparams_matlab[i].uptr) )
g_log->matlab_mask = g_log->matlab_mask | log_maskmap[i].value;
if (*(logparams_dump[i].uptr) )
g_log->dump_mask = g_log->dump_mask | log_maskmap[i].value;
}
/* log globally enabled/disabled */
set_glog_onlinelog(consolelog);
}
int register_log_component(char *name, char *fext, int compidx)
......@@ -354,11 +348,9 @@ int computed_compidx=compidx;
}
if (computed_compidx >= 0 && computed_compidx <MAX_LOG_COMPONENTS) {
g_log->log_component[computed_compidx].name = strdup(name);
g_log->log_component[computed_compidx].level = LOG_ERR;
g_log->log_component[computed_compidx].interval = 1;
g_log->log_component[computed_compidx].stream = NULL;
g_log->log_component[computed_compidx].stream = stdout;
g_log->log_component[computed_compidx].filelog = 0;
g_log->log_component[computed_compidx].filelog_name = malloc(strlen(name)+16);/* /tmp/<name>.%s rounded to ^2 */
g_log->log_component[computed_compidx].filelog_name = malloc(strlen(name)+16);/* /tmp/<name>.%s */
sprintf(g_log->log_component[computed_compidx].filelog_name,"/tmp/%s.%s",name,fext);
} else {
fprintf(stderr,"{LOG} %s %d Couldn't register componemt %s\n",__FILE__,__LINE__,name);
......@@ -421,23 +413,16 @@ int logInit (void)
register_log_component("SCTP","",SCTP);
register_log_component("RRH","",RRH);
register_log_component("X2AP","",X2AP);
register_log_component("LOADER","log",LOADER);
register_log_component("ASN","log",ASN);
for (int i=0 ; log_level_names[i].name != NULL ; i++)
g_log->level2string[i] = toupper(log_level_names[i].name[0]); // uppercased first letter of level name
g_log->level2string[OAILOG_ERR] = "E"; // ERROR
g_log->level2string[OAILOG_WARNING] = "W"; // WARNING
g_log->level2string[OAILOG_INFO] = "I"; //INFO
g_log->level2string[OAILOG_DEBUG] = "D"; // DEBUG
g_log->level2string[OAILOG_FILE] = "F"; // file
g_log->level2string[OAILOG_TRACE] = "T"; // TRACE
g_log->onlinelog = 1; //online log file
g_log->filelog = 0;
......@@ -446,19 +431,6 @@ int logInit (void)
log_getconfig(g_log);
// could put a loop here to check for all comps
for (i=MIN_LOG_COMPONENTS; i < MAX_LOG_COMPONENTS; i++) {
if (g_log->log_component[i].filelog == 1 ) {
g_log->log_component[i].stream = fopen(g_log->log_component[i].filelog_name,"w");
g_log->log_component[i].fwrite = vfprintf;
} else if (g_log->log_component[i].filelog == 1 ) {
g_log->log_component[i].stream = fopen(g_log->filelog_name,"w");
g_log->log_component[i].fwrite = vfprintf;
} else if (g_log->onlinelog == 1 ) {
g_log->log_component[i].stream = stdout;
g_log->log_component[i].fwrite = vfprintf;
}
}
// set all unused component items to 0, they are for non predefined components
for (i=MAX_LOG_PREDEF_COMPONENTS; i < MAX_LOG_COMPONENTS; i++) {
......@@ -470,8 +442,6 @@ int logInit (void)
}
char *log_getthreadname(char *threadname, int bufsize) {
int rt = pthread_getname_np(pthread_self(), threadname,bufsize) ;
......@@ -483,11 +453,20 @@ int rt = pthread_getname_np(pthread_self(), threadname,bufsize) ;
}
}
int inline log_header(char *log_buffer, int buffsize, int comp, int level,const char *format) {
char threadname[PR_SET_NAME];
return snprintf(log_buffer, buffsize , "%s%s[%s]%c %s %s%s",
log_level_highlight_end[level],
( (g_log->flag & FLAG_NOCOLOR)?"":log_level_highlight_start[level]),
g_log->log_component[comp].name,
( (g_log->flag & FLAG_LEVEL)?g_log->level2string[level]:' '),
( (g_log->flag & FLAG_THREAD)?log_getthreadname(threadname,PR_SET_NAME+1):""),
format,
log_level_highlight_end[level]);
}
void logRecord_mt(const char *file, const char *func, int line, int comp, int level, const char* format, ... )
{
char threadname[PR_SET_NAME];
char log_buffer[MAX_LOG_TOTAL];
va_list args;
......@@ -496,38 +475,63 @@ void logRecord_mt(const char *file, const char *func, int line, int comp, int le
snprintf(log_buffer, MAX_LOG_TOTAL , "%s%s[%s]%s %s %s",
log_level_highlight_end[level],
( (g_log->flag & FLAG_NOCOLOR)?"":log_level_highlight_start[level]),
g_log->log_component[comp].name,
( (g_log->flag & FLAG_LEVEL)?g_log->level2string[level]:""),
( (g_log->flag & FLAG_THREAD)?log_getthreadname(threadname,PR_SET_NAME+1):""),
format);
g_log->log_component[comp].fwrite(g_log->log_component[comp].stream,log_buffer, args);
log_header(log_buffer,MAX_LOG_TOTAL ,comp, level,format);
g_log->log_component[comp].vprint(g_log->log_component[comp].stream,log_buffer, args);
va_end(args);
}
void log_dump(int component, void *buffer, int buffsize,int datatype, const char* format, ... ) {
va_list args;
char *wbuf;
switch(datatype) {
case LOG_DUMP_DOUBLE:
wbuf=malloc((buffsize * 10) + 64 + MAX_LOG_TOTAL);
break;
case LOG_DUMP_CHAR:
default:
wbuf=malloc((buffsize * 3 ) + 64 + MAX_LOG_TOTAL);
break;
}
if (wbuf != NULL) {
va_start(args, format);
int pos=log_header(wbuf,MAX_LOG_TOTAL ,component, OAILOG_INFO,"");
int pos2=vsprintf(wbuf+pos,format, args);
pos=pos+pos2;
va_end(args);
for (int i=0; i<buffsize; i++) {
switch(datatype) {
case LOG_DUMP_DOUBLE:
pos = pos + sprintf(wbuf+pos,"%04.4lf ", (double)((double *)buffer)[i]);
break;
case LOG_DUMP_CHAR:
default:
pos = pos + sprintf(wbuf+pos,"%02x ", (unsigned char)((unsigned char *)buffer)[i]);
break;
}
}
sprintf(wbuf+pos,"\n");
g_log->log_component[component].print(g_log->log_component[component].stream,wbuf);
free(wbuf);
}
}
int set_log(int component, int level, int interval)
int set_log(int component, int level)
{
/* Checking parameters */
DevCheck((component >= MIN_LOG_COMPONENTS) && (component < MAX_LOG_COMPONENTS),
component, MIN_LOG_COMPONENTS, MAX_LOG_COMPONENTS);
DevCheck((level < NUM_LOG_LEVEL) && (level >= OAILOG_ERR), level, NUM_LOG_LEVEL,
DevCheck((level < NUM_LOG_LEVEL) && (level >= OAILOG_DISABLE), level, NUM_LOG_LEVEL,
OAILOG_ERR);
DevCheck((interval >= 0) && (interval <= 0xFF), interval, 0, 0xFF);
if ( g_log->log_component[component].level != OAILOG_DISABLE )
g_log->log_component[component].savedlevel = g_log->log_component[component].level;
g_log->log_component[component].level = level;
g_log->log_component[component].interval = interval;
return 0;
}
......@@ -536,32 +540,67 @@ int set_log(int component, int level, int interval)
void set_glog(int level)
{
for (int c=0; c< MAX_LOG_COMPONENTS; c++ ) {
g_log->log_component[c].level = level;
set_log(c, level);
}
}
void set_glog_onlinelog(int enable)
{
g_log->onlinelog = enable;
for (int c=0; c< MAX_LOG_COMPONENTS; c++ ) {
if ( enable ) {
g_log->log_component[c].level = g_log->log_component[c].savedlevel;
g_log->log_component[c].vprint = vfprintf;
g_log->log_component[c].print = fprintf;
g_log->log_component[c].stream = stdout;
} else {
g_log->log_component[c].level = OAILOG_DISABLE;
}
}
}
void set_glog_filelog(int enable)
{
g_log->filelog = enable;
static FILE *fptr;
if ( enable ) {
fptr = fopen(g_log->filelog_name,"w");
for (int c=0; c< MAX_LOG_COMPONENTS; c++ ) {
close_component_filelog(c);
g_log->log_component[c].stream = fptr;
g_log->log_component[c].filelog = 1;
}
} else {
for (int c=0; c< MAX_LOG_COMPONENTS; c++ ) {
g_log->log_component[c].filelog = 0;
if (fptr != NULL) {
fclose(fptr);
}
g_log->log_component[c].stream = stdout;
}
}
}
void set_component_filelog(int comp)
{
if (g_log->log_component[comp].filelog == 0) {
g_log->log_component[comp].filelog = 1;
if (g_log->log_component[comp].stream == NULL) {
if (g_log->log_component[comp].stream == NULL || g_log->log_component[comp].stream == stdout) {
g_log->log_component[comp].stream = fopen(g_log->log_component[comp].filelog_name,"w");
}
}
g_log->log_component[comp].vprint = vfprintf;
g_log->log_component[comp].print = fprintf;
g_log->log_component[comp].filelog = 1;
}
void close_component_filelog(int comp)
{
g_log->log_component[comp].filelog = 0;
if (g_log->log_component[comp].stream != NULL && g_log->log_component[comp].stream != stdout ) {
fclose(g_log->log_component[comp].stream);
g_log->log_component[comp].stream = stdout;
}
g_log->log_component[comp].vprint = vfprintf;
g_log->log_component[comp].print = fprintf;
}
/*
* for the two functions below, the passed array must have a final entry
......@@ -616,15 +655,13 @@ int is_newline( char *str, int size)
void logClean (void)
{
int i;
LOG_I(PHY,"\n");
LOG_UI(PHY,"\n");
for (i=MIN_LOG_COMPONENTS; i < MAX_LOG_COMPONENTS; i++) {
if (g_log->log_component[i].stream != NULL) {
fclose(g_log->log_component[i].stream);
}
close_component_filelog(i);
}
}
......@@ -650,8 +687,8 @@ int test_log(void)
LOG_D(MAC, "1 debug MAC \n");
LOG_W(MAC, "1 warning MAC \n");
set_log(EMU, OAILOG_INFO, FLAG_ONLINE);
set_log(MAC, OAILOG_WARNING, 0);
set_log(EMU, OAILOG_INFO);
set_log(MAC, OAILOG_WARNING);
LOG_I(EMU, "2 Starting OAI logs version %s Build date: %s on %s\n",
BUILD_VERSION, BUILD_DATE, BUILD_HOST);
......@@ -661,7 +698,7 @@ int test_log(void)
LOG_I(MAC, "2 info MAC \n");
set_log(MAC, OAILOG_NOTICE, 1);
set_log(MAC, OAILOG_NOTICE);
LOG_ENTER(MAC);
LOG_I(EMU, "3 Starting OAI logs version %s Build date: %s on %s\n",
......@@ -670,8 +707,8 @@ int test_log(void)
LOG_W(MAC, "3 warning MAC \n");
LOG_I(MAC, "3 info MAC \n");
set_log(MAC, LOG_DEBUG,1);
set_log(EMU, LOG_DEBUG,1);
set_log(MAC, LOG_DEBUG);
set_log(EMU, LOG_DEBUG);
LOG_ENTER(MAC);
LOG_I(EMU, "4 Starting OAI logs version %s Build date: %s on %s\n",
......@@ -681,8 +718,8 @@ int test_log(void)
LOG_I(MAC, "4 info MAC \n");
set_log(MAC, LOG_DEBUG,0);
set_log(EMU, LOG_DEBUG,0);
set_log(MAC, LOG_DEBUG);
set_log(EMU, LOG_DEBUG);
LOG_I(LOG, "5 Starting OAI logs version %s Build date: %s on %s\n",
BUILD_VERSION, BUILD_DATE, BUILD_HOST);
......@@ -691,8 +728,8 @@ int test_log(void)
LOG_I(MAC, "5 info MAC \n");
set_log(MAC, LOG_TRACE,0X07F);
set_log(EMU, LOG_TRACE,0X07F);
set_log(MAC, LOG_TRACE);
set_log(EMU, LOG_TRACE);
LOG_ENTER(MAC);
LOG_I(LOG, "6 Starting OAI logs version %s Build date: %s on %s\n",
......
......@@ -81,15 +81,14 @@ extern "C" {
* @ingroup _macro
* @brief LOG defines 9 levels of messages for users. Importance of these levels decrease gradually from 0 to 8
* @{*/
# define OAILOG_ERR 0 /*!< \brief critical error conditions, impact on "must have" fuctinalities */
# define OAILOG_FILE 1 /*!< \brief important informational messages, but everything OK */
# define OAILOG_WARNING 2 /*!< \brief warning conditions, shouldn't happen but doesn't impact "must have" functionalities */
# define OAILOG_INFO 3 /*!< \brief informational messages most people don't need, shouldn't impact real-time behavior */
# define OAILOG_DEBUG 4 /*!< \brief first level debug-level messages, for developers , may impact real-time behavior */
# define OAILOG_TRACE 5 /*!< \brief second level debug-level messages, for developers ,likely impact real-time behavior*/
#define NUM_LOG_LEVEL 6 /*!< \brief the number of message levels users have with LOG */
# define OAILOG_DISABLE -1 /*!< \brief disable all LOG messages, cannot be used in LOG macros, use only in LOG module */
# define OAILOG_ERR 0 /*!< \brief critical error conditions, impact on "must have" fuctinalities */
# define OAILOG_WARNING 1 /*!< \brief warning conditions, shouldn't happen but doesn't impact "must have" functionalities */
# define OAILOG_INFO 2 /*!< \brief informational messages most people don't need, shouldn't impact real-time behavior */
# define OAILOG_DEBUG 3 /*!< \brief first level debug-level messages, for developers , may impact real-time behavior */
# define OAILOG_TRACE 4 /*!< \brief second level debug-level messages, for developers ,likely impact real-time behavior*/
#define NUM_LOG_LEVEL 5 /*!< \brief the number of message levels users have with LOG (OAILOG_DISABLE is not available to user as a level, so it is not included)*/
/* @}*/
......@@ -128,21 +127,53 @@ extern "C" {
/** @defgroup macros to identify a debug entity
* @ingroup each macro is a bit mask where the unique bit set identifies an entity to be debugged
* it allows to dynamically activate or not blocks of code
* it allows to dynamically activate or not blocks of code. The LOG_MASKMAP_INIT macro
* is used to map a character string name to each debug bit, it allows to set or clear
* the corresponding bit via the defined name, from the configuration or from the telnet
* server.
* @brief
* @{*/
#define DEBUG_PRACH (1<<0)
#define DEBUG_RU (1<<1)
#define DEBUG_UE_PHYPROC (1<<2)
#define DEBUG_LTEESTIM (1<<3)
#define DEBUG_DLCELLSPEC (1<<4)
#define DEBUG_ULSCH (1<<5)
#define DEBUG_RRC (1<<6)
#define DEBUG_PDCP (1<<7)
#define DEBUG_DFT (1<<8)
#define DEBUG_ASN1 (1<<9)
#define DEBUG_CTRLSOCKET (1<<10)
#define DEBUG_SECURITY (1<<11)
#