Commit c22180ff authored by Cedric Roux's avatar Cedric Roux

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:
......
This diff is collapsed.
This diff is collapsed.
......@@ -750,6 +750,27 @@ ID = LEGACY_OSA_TRACE
GROUP = ALL:LEGACY_OSA:LEGACY_GROUP_TRACE:LEGACY
FORMAT = string,log
ID = LEGACY_ASN_INFO
DESC = ASN legacy logs - info level
GROUP = ALL:LEGACY_ASN:LEGACY_GROUP_INFO:LEGACY
FORMAT = string,log
ID = LEGACY_ASN_ERROR
DESC = ASN legacy logs - error level
GROUP = ALL:LEGACY_ASN:LEGACY_GROUP_ERROR:LEGACY
FORMAT = string,log
ID = LEGACY_ASN_WARNING
DESC = ASN legacy logs - warning level
GROUP = ALL:LEGACY_ASN:LEGACY_GROUP_WARNING:LEGACY
FORMAT = string,log
ID = LEGACY_ASN_DEBUG
DESC = ASN legacy logs - debug level
GROUP = ALL:LEGACY_ASN:LEGACY_GROUP_DEBUG:LEGACY
FORMAT = string,log
ID = LEGACY_ASN_TRACE
DESC = ASN legacy logs - trace level
GROUP = ALL:LEGACY_ASN:LEGACY_GROUP_TRACE:LEGACY
FORMAT = string,log
ID = LEGACY_SIM_INFO
DESC = SIM legacy logs - info level
GROUP = ALL:LEGACY_SIM:LEGACY_GROUP_INFO:LEGACY
......
......@@ -39,7 +39,7 @@
#include "assertions.h"
#include "signals.h"
#include "log.h"
#include "common/utils/LOG/log.h"
#if defined (LOG_D) && defined (LOG_E)
# define SIG_DEBUG(x, args...) LOG_D(RRC, x, ##args)
......
......@@ -32,7 +32,7 @@
#include "assertions.h"
#include "intertask_interface.h"
#include "timer.h"
#include "log.h"
#include "common/utils/LOG/log.h"
#include "queue.h"
#if defined (LOG_D) && defined (LOG_E)
......
......@@ -70,8 +70,8 @@ char *tmpstr;
char *shlibpath =NULL;
char *shlibversion=NULL;
char *cfgprefix;
paramdef_t LoaderParams[] ={{"shlibpath", NULL, 0, strptr:&shlibpath, defstrval:NULL, TYPE_STRING, 0},
{"shlibversion", NULL, 0, strptr:&shlibversion, defstrval:"", TYPE_STRING, 0}};
paramdef_t LoaderParams[] ={{"shlibpath", NULL, 0, strptr:&shlibpath, defstrval:NULL, TYPE_STRING, 0, NULL},
{"shlibversion", NULL, 0, strptr:&shlibversion, defstrval:"", TYPE_STRING, 0, NULL}};
int ret;
......@@ -118,7 +118,7 @@ int ret;
return tmpstr;
}
int load_module_shlib(char *modname,loader_shlibfunc_t *farray, int numf)
int load_module_shlib(char *modname,loader_shlibfunc_t *farray, int numf, void *autoinit_arg)
{
void *lib_handle;
initfunc_t fpi;
......@@ -155,7 +155,7 @@ int load_module_shlib(char *modname,loader_shlibfunc_t *farray, int numf)
fpi = dlsym(lib_handle,afname);
if (fpi != NULL ) {
fpi();
fpi(autoinit_arg);
}
if (farray != NULL) {
......
......@@ -59,7 +59,8 @@ typedef struct {
/* function type of functions which may be implemented by a module */
/* 1: init function, called when loading, if found in the shared lib */
typedef int(*initfunc_t)(void);
typedef int(*initfunc_t)(void *);
/* 2: version checking function, called when loading, if it returns -1, trigger main exec abort */
typedef int(*checkverfunc_t)(char * mainexec_version, char ** shlib_version);
/* 3: get function array function, called when loading when a module doesn't provide */
......@@ -72,18 +73,18 @@ typedef int(*getfarrayfunc_t)(loader_shlibfunc_t **funcarray);
#define DEFAULT_MAXSHLIBS 10
loader_data_t loader_data;
/*------------------------------------------------------------------------------------------------------------------------------------------------*/
/* LOADER parameters */
/* optname helpstr paramflags XXXptr defXXXval type numelt */
/*------------------------------------------------------------------------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------------------------------------------------------------------------------*/
/* LOADER parameters */
/* optname helpstr paramflags XXXptr defXXXval type numelt check func*/
/*----------------------------------------------------------------------------------------------------------------------------------------------------------*/
#define LOADER_PARAMS_DESC { \
{"shlibpath", NULL, PARAMFLAG_NOFREE, strptr:(char **)&(loader_data.shlibpath), defstrval:DEFAULT_PATH, TYPE_STRING, 0}, \
{"maxshlibs", NULL, 0, uptr:&(loader_data.maxshlibs), defintval:DEFAULT_MAXSHLIBS, TYPE_UINT32, 0}, \
{"shlibpath", NULL, PARAMFLAG_NOFREE, strptr:(char **)&(loader_data.shlibpath), defstrval:DEFAULT_PATH, TYPE_STRING, 0, NULL},\
{"maxshlibs", NULL, 0, uptr:&(loader_data.maxshlibs), defintval:DEFAULT_MAXSHLIBS, TYPE_UINT32, 0, NULL}\
}
/*-------------------------------------------------------------------------------------------------------------*/
#else /* LOAD_MODULE_SHLIB_MAIN */
extern int load_module_shlib(char *modname, loader_shlibfunc_t *farray, int numf);
extern int load_module_shlib(char *modname, loader_shlibfunc_t *farray, int numf, void *initfunc_arg);
extern void * get_shlibmodule_fptr(char *modname, char *fname);
extern loader_data_t loader_data;
#endif /* LOAD_MODULE_SHLIB_MAIN */
......
......@@ -32,11 +32,15 @@
#include <stdint.h>
#include <inttypes.h>
#define MSC_LIBRARY
#include "msc.h"
#include "liblfds611.h"
#include "intertask_interface.h"
#include "timer.h"
#include "msc.h"
#include "assertions.h"
//-------------------------------
......@@ -67,8 +71,8 @@ void *msc_task(void *args_p)
//------------------------------------------------------------------------------
{
MessageDef *received_message_p = NULL;
const char *msg_name = NULL;
instance_t instance = 0;
// const char *msg_name = NULL;
// instance_t instance = 0;
long timer_id;
itti_mark_task_ready(TASK_MSC);
......@@ -88,9 +92,9 @@ void *msc_task(void *args_p)
itti_receive_msg(TASK_MSC, &received_message_p);
if (received_message_p != NULL) {
msg_name = ITTI_MSG_NAME (received_message_p);
instance = ITTI_MSG_INSTANCE (received_message_p);
// msg_name = ITTI_MSG_NAME (received_message_p);
// instance = ITTI_MSG_INSTANCE (received_message_p);
switch (ITTI_MSG_ID(received_message_p)) {
case TIMER_HAS_EXPIRED: {
......@@ -571,4 +575,17 @@ error_event:
free(new_item_p);
}
//------------------------------------------------------------------------------
// function called when oai loader loads the msc shared lib
int msc_autoinit(msc_interface_t *msc_interface)
//------------------------------------------------------------------------------
{
msc_interface->msc_init = msc_init;
msc_interface->msc_start_use = msc_start_use;
msc_interface->msc_end = msc_end;
msc_interface->msc_log_event = msc_log_event;
msc_interface->msc_log_message = msc_log_message;
msc_interface->msc_loaded = 1;
return 0;
}
......@@ -73,7 +73,23 @@ typedef enum {
#define MSC_AS_TIME_ARGS(CTXT_Pp) \
(CTXT_Pp)->frame, \
(CTXT_Pp)->subframe
#if defined(MESSAGE_CHART_GENERATOR)
typedef int(*msc_init_t)(const msc_env_t, const int );
typedef void(*msc_start_use_t)(void );
typedef void(*msc_end_t)(void);
typedef void(*msc_log_event_t)(const msc_proto_t,char *, ...);
typedef void(*msc_log_message_t)(const char * const, const msc_proto_t, const msc_proto_t,
const uint8_t* const, const unsigned int, char * , ...);
typedef struct msc_interface {
int msc_loaded;
msc_init_t msc_init;
msc_start_use_t msc_start_use;
msc_end_t msc_end;
msc_log_event_t msc_log_event;
msc_log_message_t msc_log_message;
} msc_interface_t;
#ifdef MSC_LIBRARY
int msc_init(const msc_env_t envP, const int max_threadsP);
void msc_start_use(void);
void msc_flush_messages(void);
......@@ -88,22 +104,17 @@ void msc_log_message(
const unsigned int num_bytes,
char *format, ...);
#define MSC_INIT(arg1,arg2) msc_init(arg1,arg2)
#define MSC_START_USE msc_start_use
#define MSC_END msc_end
#define MSC_LOG_EVENT(mScPaRaMs, fORMAT, aRGS...) msc_log_event(mScPaRaMs, fORMAT, ##aRGS)
#define MSC_LOG_RX_MESSAGE(rECEIVER, sENDER, bYTES, nUMbYTES, fORMAT, aRGS...) msc_log_message("<-",rECEIVER, sENDER, bYTES, nUMbYTES, fORMAT, ##aRGS)
#define MSC_LOG_RX_DISCARDED_MESSAGE(rECEIVER, sENDER, bYTES, nUMbYTES, fORMAT, aRGS...) msc_log_message("x-",rECEIVER, sENDER, bYTES, nUMbYTES, fORMAT, ##aRGS)
#define MSC_LOG_TX_MESSAGE(sENDER, rECEIVER, bYTES, nUMbYTES, fORMAT, aRGS...) msc_log_message("->",sENDER, rECEIVER, bYTES, nUMbYTES, fORMAT, ##aRGS)
#define MSC_LOG_TX_MESSAGE_FAILED(sENDER, rECEIVER, bYTES, nUMbYTES, fORMAT, aRGS...) msc_log_message("-x",sENDER, rECEIVER, bYTES, nUMbYTES, fORMAT, ##aRGS)
#else
#define MSC_INIT(arg1,arg2)
#define MSC_START_USE(mScPaRaMs)
#define MSC_END(mScPaRaMs)
#define MSC_LOG_EVENT(mScPaRaMs, fORMAT, aRGS...)
#define MSC_LOG_RX_MESSAGE(mScPaRaMs, fORMAT, aRGS...)
#define MSC_LOG_RX_DISCARDED_MESSAGE(mScPaRaMs, fORMAT, aRGS...)
#define MSC_LOG_TX_MESSAGE(mScPaRaMs, fORMAT, aRGS...)
#define MSC_LOG_TX_MESSAGE_FAILED(mScPaRaMs, fORMAT, aRGS...)
#endif
msc_interface_t msc_interface;
#define MSC_INIT(arg1,arg2) if(msc_interface.msc_loaded) msc_interface.msc_init(arg1,arg2)
#define MSC_START_USE if(msc_interface.msc_loaded) msc_interface.msc_start_use
#define MSC_END if(msc_interface.msc_loaded) msc_interface.msc_end
#define MSC_LOG_EVENT(mScPaRaMs, fORMAT, aRGS...) if(msc_interface.msc_loaded) msc_interface.msc_log_event(mScPaRaMs, fORMAT, ##aRGS)
#define MSC_LOG_RX_MESSAGE(rECEIVER, sENDER, bYTES, nUMbYTES, fORMAT, aRGS...) if(msc_interface.msc_loaded) msc_interface.msc_log_message("<-",rECEIVER, sENDER, (const uint8_t *)bYTES, nUMbYTES, fORMAT, ##aRGS)
#define MSC_LOG_RX_DISCARDED_MESSAGE(rECEIVER, sENDER, bYTES, nUMbYTES, fORMAT, aRGS...) if(msc_interface.msc_loaded) msc_interface.msc_log_message("x-",rECEIVER, sENDER, (const uint8_t *)bYTES, nUMbYTES, fORMAT, ##aRGS)
#define MSC_LOG_TX_MESSAGE(sENDER, rECEIVER, bYTES, nUMbYTES, fORMAT, aRGS...) if(msc_interface.msc_loaded) msc_interface.msc_log_message("->",sENDER, rECEIVER, (const uint8_t *)bYTES, nUMbYTES, fORMAT, ##aRGS)
#define MSC_LOG_TX_MESSAGE_FAILED(sENDER, rECEIVER, bYTES, nUMbYTES, fORMAT, aRGS...) if(msc_interface.msc_loaded) msc_interface.msc_log_message("-x",sENDER, rECEIVER, (const uint8_t *)bYTES, nUMbYTES, fORMAT, ##aRGS)
#endif
#endif
......@@ -199,28 +199,29 @@ int proccmd_show(char *buf, int debug, telnet_printfunc_t prnt)
print_threads(buf,debug,prnt);
}
if (strcasestr(buf,"loglvl") != NULL) {
prnt(" component level enabled\n");
prnt("\n component level enabled output\n");
for (int i=MIN_LOG_COMPONENTS; i < MAX_LOG_COMPONENTS; i++) {
if (g_log->log_component[i].name != NULL) {
prnt("%02i %17.17s:%10.10s %s\n",i ,g_log->log_component[i].name,
map_int_to_str(log_level_names,g_log->log_component[i].level),
((g_log->log_component[i].interval>0)?"Y":"N") );
prnt("%02i %17.17s:%10.10s %s %s\n",i ,g_log->log_component[i].name,
map_int_to_str(log_level_names,(g_log->log_component[i].level>=0)?g_log->log_component[i].level:g_log->log_component[i].savedlevel),
((g_log->log_component[i].level>=0)?"Y":"N"),
((g_log->log_component[i].filelog>0)?g_log->log_component[i].filelog_name:"stdout"));
}
}
}
if (strcasestr(buf,"logopt") != NULL) {
prnt(" option enabled\n");
prnt("\n option enabled\n");
for (int i=0; log_options[i].name != NULL; i++) {
prnt("%02i %17.17s %10.10s \n",i ,log_options[i].name,
((g_log->flag & log_options[i].value)?"Y":"N") );
}
}
if (strcasestr(buf,"dbgopt") != NULL) {
prnt(" option debug matlab\n");
prnt("\n module debug dumpfile\n");
for (int i=0; log_maskmap[i].name != NULL ; i++) {
prnt("%02i %17.17s %5.5s %5.5s\n",i ,log_maskmap[i].name,
prnt("%02i %17.17s %5.5s %5.5s\n",i ,log_maskmap[i].name,
((g_log->debug_mask & log_maskmap[i].value)?"Y":"N"),
((g_log->matlab_mask & log_maskmap[i].value)?"Y":"N") );
((g_log->dump_mask & log_maskmap[i].value)?"Y":"N") );
}
}
if (strcasestr(buf,"config") != NULL) {
......@@ -337,15 +338,15 @@ int s = sscanf(buf,"%ms %i-%i\n",&logsubcmd, &idx1,&idx2);
prnt("Available log levels: \n ");
for (int i=0; log_level_names[i].name != NULL; i++)
prnt("%s ",log_level_names[i].name);
prnt("\n");
prnt("\n\n");
prnt("Available display options: \n ");
for (int i=0; log_options[i].name != NULL; i++)
prnt("%s ",log_options[i].name);
prnt("\n");
prnt("Available debug or matlab options: \n ");
prnt("\n\n");
prnt("Available debug and dump options: \n ");
for (int i=0; log_maskmap[i].name != NULL; i++)
prnt("%s ",log_maskmap[i].name);
prnt("\n");
prnt("\n\n");
proccmd_show("loglvl",debug,prnt);
proccmd_show("logopt",debug,prnt);
proccmd_show("dbgopt",debug,prnt);
......@@ -377,7 +378,7 @@ int s = sscanf(buf,"%ms %i-%i\n",&logsubcmd, &idx1,&idx2);
else if (l == 2 && strcmp(logparam,"debug") == 0){
optbit=map_str_to_int(log_maskmap,opt);
if (optbit < 0) {
prnt("debug flag %s unknown\n",opt);
prnt("module %s unknown\n",opt);
} else {
if (idx1 > 0)
SET_LOG_DEBUG(optbit);
......@@ -386,42 +387,51 @@ int s = sscanf(buf,"%ms %i-%i\n",&logsubcmd, &idx1,&idx2);
proccmd_show("dbgopt",debug,prnt);
}
}
else if (l == 2 && strcmp(logparam,"matlab") == 0){
else if (l == 2 && strcmp(logparam,"dump") == 0){
optbit=map_str_to_int(log_maskmap,opt);
if (optbit < 0) {
prnt("matlab flag %s unknown\n",opt);
prnt("module %s unknown\n",opt);
} else {
if (idx1 > 0)
SET_LOG_MATLAB(optbit);
SET_LOG_DUMP(optbit);
else
CLEAR_LOG_MATLAB(optbit);
CLEAR_LOG_DUMP(optbit);
proccmd_show("dbgopt",debug,prnt);
}
}
if (logparam != NULL) free(logparam);
if (opt != NULL) free(opt);
} else if ( s == 3 && logsubcmd != NULL) {
int level, interval;
int level, enable,filelog;
char *tmpstr=NULL;
char *logparam=NULL;
int l;
level = interval = -1;
level = OAILOG_DISABLE - 1;
filelog = -1;
enable=-1;
l=sscanf(logsubcmd,"%m[^'_']_%m[^'_']",&logparam,&tmpstr);
if (debug > 0)
prnt("l=%i, %s %s\n",l,((logparam==NULL)?"\"\"":logparam), ((tmpstr==NULL)?"\"\"":tmpstr));
if (l ==2 ) {
if (strcmp(logparam,"level") == 0) {
level=map_str_to_int(log_level_names,tmpstr);
if (level < 0) prnt("level %s unknown\n",tmpstr);
if (level < 0) {
prnt("level %s unknown\n",tmpstr);
level=OAILOG_DISABLE - 1;
}
} else {
prnt("%s%s unknown log sub command \n",logparam, tmpstr);
}
} else if (l ==1 ) {
if (strcmp(logparam,"enable") == 0) {
interval = 1;
enable=1;
} else if (strcmp(logparam,"disable") == 0) {
interval = 0;
level=OAILOG_DISABLE;
} else if (strcmp(logparam,"file") == 0) {
filelog = 1 ;
} else if (strcmp(logparam,"nofile") == 0) {
filelog = 0 ;
} else {
prnt("%s%s unknown log sub command \n",logparam, tmpstr);
}
......@@ -431,20 +441,18 @@ int s = sscanf(buf,"%ms %i-%i\n",&logsubcmd, &idx1,&idx2);
if (logparam != NULL) free(logparam);
if (tmpstr != NULL) free(tmpstr);
for (int i=idx1; i<=idx2 ; i++) {
if (level < 0) {
level=g_log->log_component[i].level;
}
if (interval < 0) {
interval=g_log->log_component[i].interval;
}
set_log(i, level, interval);
prnt("log level comp %i %s set to %s (%s)\n",
i,((g_log->log_component[i].name==NULL)?"":g_log->log_component[i].name),
map_int_to_str(log_level_names,g_log->log_component[i].level),
((g_log->log_component[i].interval>0)?"enabled":"disabled"));
}
if (level >= OAILOG_DISABLE)
set_log(i, level);
else if ( enable == 1)
set_log(i,g_log->log_component[i].savedlevel);
else if ( filelog == 1 ) {
set_component_filelog(i);
} else if ( filelog == 0 ) {
close_component_filelog(i);
}
}
proccmd_show("loglvl",debug,prnt);
} else {
prnt("%s: wrong log command...\n",buf);
}
......
......@@ -48,13 +48,15 @@ telnetshell_vardef_t proc_vardef[] = {
show: display current log configuration \n\
online, noonline: enable or disable console logs \n\
enable, disable id1-id2: enable or disable logs for components index id1 to id2 \n\
file, nofile id1-id2: enable or disable redirecting logs to file for components index id1 to id2 \n\
logfile name depends on component name and is printed in the show command \n\
level_<level> id1-id2: set log level to <level> for components index id1 to id2 \n\
use the show command to get the authorized values for <level> and the list of component \
indexes that can be used for id1 and id2 \n\
use the show command to get the authorized values for \n\
<level> and the list of component indexes that can be used for id1 and id2 \n\
print_<opt> <0|1> disable or enable the \"opt\" log option, use the show command to get \
the available options\n\
matlab_<opt> debug_<func> disable or enable the debug code or matlab file generation \
for \"func\" function. use the show command to get the available options\n"
the available options\n\
dump_<mod> debug_<mod > disable or enable the debug file generation or debug code\
for \"mod\" module. use the show command to get the available modules\n"
#define PROCCMD_THREAD_HELP_STRING " thread sub commands: \n\
<thread id> aff <core> : set affinity of thread <thread id> to core <core> \n\
......
......@@ -130,7 +130,7 @@ int load_codinglib(void) {
shlib_fdesc[ENCODE_SSE_FPTRIDX].fname= "threegpplte_turbo_encoder_sse";
shlib_fdesc[ENCODE_C_FPTRIDX].fname= "threegpplte_turbo_encoder";
shlib_fdesc[ENCODE_INIT_SSE_FPTRIDX].fname= "init_encoder_sse";
ret=load_module_shlib("coding",shlib_fdesc,DECODE_NUM_FPTR);
ret=load_module_shlib("coding",shlib_fdesc,DECODE_NUM_FPTR,NULL);
if (ret < 0) exit_fun("Error loading coding library");
/* execute encoder/decoder init functions */
......
......@@ -20,7 +20,7 @@
*/
#include "phy_init.h"
#include "log.h"
#include "common/utils/LOG/log.h"
uint16_t dl_S_table_normal[10]={3,9,10,11,12,3,9,10,11,6};
uint16_t dl_S_table_extended[10]={3,8,9,10,3,8,9,5,0,0};
......
......@@ -274,11 +274,11 @@ int lte_sync_time_init(LTE_DL_FRAME_PARMS *frame_parms ) // LTE_UE_COMMON *com
LOG_M_BEGIN(DEBUG_LTEESTIM);
LOG_M("primary_sync0.m","psync0",primary_synch0_time,frame_parms->ofdm_symbol_size,1,1);
LOG_M("primary_sync1.m","psync1",primary_synch1_time,frame_parms->ofdm_symbol_size,1,1);
LOG_M("primary_sync2.m","psync2",primary_synch2_time,frame_parms->ofdm_symbol_size,1,1);
LOG_M_END
if ( LOG_DUMPFLAG(DEBUG_LTEESTIM)){
LOG_M("primary_sync0.m","psync0",primary_synch0_time,frame_parms->ofdm_symbol_size,1,1);
LOG_M("primary_sync1.m","psync1",primary_synch1_time,frame_parms->ofdm_symbol_size,1,1);
LOG_M("primary_sync2.m","psync2",primary_synch2_time,frame_parms->ofdm_symbol_size,1,1);
}
return (1);
}
......@@ -460,18 +460,18 @@ int lte_sync_time(int **rxdata, ///rx data in time domain
LOG_I(PHY,"[UE] lte_sync_time: Sync source = %d, Peak found at pos %d, val = %d (%d dB)\n",sync_source,peak_pos,peak_val,dB_fixed(peak_val)/2);
LOG_M_BEGIN(DEBUG_LTEESTIM)
static int debug_cnt;
if (debug_cnt == 0) {
LOG_M("sync_corr0_ue.m","synccorr0",sync_corr_ue0,2*length,1,2);
LOG_M("sync_corr1_ue.m","synccorr1",sync_corr_ue1,2*length,1,2);
LOG_M("sync_corr2_ue.m","synccorr2",sync_corr_ue2,2*length,1,2);
LOG_M("rxdata0.m","rxd0",rxdata[0],length<<1,1,1);
// exit(-1);
} else {
if ( LOG_DUMPFLAG(DEBUG_LTEESTIM)){
static int debug_cnt;
if (debug_cnt == 0) {
LOG_M("sync_corr0_ue.m","synccorr0",sync_corr_ue0,2*length,1,2);
LOG_M("sync_corr1_ue.m","synccorr1",sync_corr_ue1,2*length,1,2);
LOG_M("sync_corr2_ue.m","synccorr2",sync_corr_ue2,2*length,1,2);
LOG_M("rxdata0.m","rxd0",rxdata[0],length<<1,1,1);
// exit(-1);
} else {
debug_cnt++;
}
LOG_M_END
}
return(peak_pos);
......
......@@ -23,7 +23,7 @@
#include "PHY/defs_UE.h"
#include "PHY/phy_extern_ue.h"
#include "log.h"
#include "common/utils/LOG/log.h"
#include "PHY/sse_intrin.h"
//#define k1 1000
......
......@@ -25,9 +25,9 @@
#include "PHY/defs_eNB.h"
#include "PHY/defs_UE.h"
#include "PHY/impl_defs_top.h"
#include "common/utils/LOG/log.h"
//extern unsigned int lte_gold_table[3][20][2][14];
//#define DEBUG_DL_CELL_SPEC
......@@ -64,7 +64,7 @@ int lte_dl_cell_spec_SS(PHY_VARS_eNB *eNB,
else if ((p==1) && (l>0))
nu = 0;
else {
printf("lte_dl_cell_spec: p %d, l %d -> ERROR\n",p,l);
LOG_E(PHY,"lte_dl_cell_spec: p %d, l %d -> ERROR\n",p,l);
return(-1);
}
......@@ -85,19 +85,19 @@ int lte_dl_cell_spec_SS(PHY_VARS_eNB *eNB,
// this is r_mprime from 3GPP 36-211 6.10.1.2
output[k] = qpsk[(eNB->lte_gold_table[Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3];
//output[k] = (lte_gold_table[eNB_offset][Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3;
#ifdef DEBUG_DL_CELL_SPEC
printf("Ns %d, l %d, m %d,mprime_dword %d, mprime_qpsk_symbol %d\n",
Ns,l,m,mprime_dword,mprime_qpsk_symb);
printf("index = %d (k %d)\n",(eNB->lte_gold_table[Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3,k);
#endif
if (LOG_DEBUGFLAG(DEBUG_DLCELLSPEC)) {
LOG_I(PHY,"Ns %d, l %d, m %d,mprime_dword %d, mprime_qpsk_symbol %d\n",
Ns,l,m,mprime_dword,mprime_qpsk_symb);
LOG_I(PHY,"index = %d (k %d)\n",(eNB->lte_gold_table[Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3,k);
}
mprime++;
#ifdef DEBUG_DL_CELL_SPEC
if (LOG_DEBUGFLAG(DEBUG_DLCELLSPEC)) {
if (m<4)
printf("Ns %d, l %d output[%d] = (%d,%d)\n",Ns,l,k,((short *)&output[k])[0],((short *)&output[k])[1]);
LOG_I(PHY,"Ns %d, l %d output[%d] = (%d,%d)\n",Ns,l,k,((short *)&output[k])[0],((short *)&output[k])[1]);
#endif
}
k+=6;//b
if (k >= eNB->frame_parms.ofdm_symbol_size) {
......@@ -105,7 +105,7 @@ int lte_dl_cell_spec_SS(PHY_VARS_eNB *eNB,
k-=eNB->frame_parms.ofdm_symbol_size;
}
// printf("** k %d\n",k);
// LOG_I(PHY,"** k %d\n",k);
}
return(0);
......@@ -143,7 +143,7 @@ int lte_dl_cell_spec(PHY_VARS_eNB *eNB,
else if ((p==1) && (l>0))
nu = 0;