Commit 536b5d87 authored by Laurent THOMAS's avatar Laurent THOMAS Committed by Robert Schmidt

Clean up logging module debug flags

cleanup debug/dump flags by avoiding repetitions in the source code and
enable compiler checks. Add a help text if we set a wrong debug trace
option.
parent ca37e0c1
...@@ -120,28 +120,6 @@ mapping * log_option_names_ptr(void) ...@@ -120,28 +120,6 @@ mapping * log_option_names_ptr(void)
return log_options; return log_options;
} }
static mapping log_maskmap[] = {{"PRACH", DEBUG_PRACH},
{"RU", DEBUG_RU},
{"UE_PHYPROC", DEBUG_UE_PHYPROC},
{"LTEESTIM", DEBUG_LTEESTIM},
{"DLCELLSPEC", DEBUG_DLCELLSPEC},
{"ULSCH", DEBUG_ULSCH},
{"RRC", DEBUG_RRC},
{"PDCP", DEBUG_PDCP},
{"DFT", DEBUG_DFT},
{"ASN1", DEBUG_ASN1},
{"CTRLSOCKET", DEBUG_CTRLSOCKET},
{"SECURITY", DEBUG_SECURITY},
{"NAS", DEBUG_NAS},
{"RLC", DEBUG_RLC},
{"DLSCH_DECOD", DEBUG_DLSCH_DECOD},
{"UE_TIMING", UE_TIMING},
{NULL, -1}};
mapping * log_maskmap_ptr(void)
{
return log_maskmap;
}
/* .log_format = 0x13 uncolored standard messages /* .log_format = 0x13 uncolored standard messages
* .log_format = 0x93 colored standard messages */ * .log_format = 0x93 colored standard messages */
/* keep white space in first position; switching it to 0 allows colors to be disabled*/ /* keep white space in first position; switching it to 0 allows colors to be disabled*/
...@@ -327,6 +305,9 @@ int write_file_matlab(const char *fname, const char *vname, void *data, int leng ...@@ -327,6 +305,9 @@ int write_file_matlab(const char *fname, const char *vname, void *data, int leng
return 0; return 0;
} }
#define FLAG_SETDEBUG(flag) g_log->debug_mask.DEBUG_##flag = *logparams_debug[i++].uptr;
#define FLAG_SETDUMP(flag) g_log->dump_mask.DEBUG_##flag = *logparams_dump[i++].uptr;
/* get log parameters from configuration file */ /* get log parameters from configuration file */
void log_getconfig(log_t *g_log) void log_getconfig(log_t *g_log)
{ {
...@@ -335,8 +316,6 @@ void log_getconfig(log_t *g_log) ...@@ -335,8 +316,6 @@ void log_getconfig(log_t *g_log)
paramdef_t logparams_defaults[] = LOG_GLOBALPARAMS_DESC; paramdef_t logparams_defaults[] = LOG_GLOBALPARAMS_DESC;
paramdef_t logparams_level[MAX_LOG_PREDEF_COMPONENTS]; paramdef_t logparams_level[MAX_LOG_PREDEF_COMPONENTS];
paramdef_t logparams_logfile[MAX_LOG_PREDEF_COMPONENTS]; paramdef_t logparams_logfile[MAX_LOG_PREDEF_COMPONENTS];
paramdef_t logparams_debug[sizeofArray(log_maskmap)];
paramdef_t logparams_dump[sizeofArray(log_maskmap)];
int ret = config_get(config_get_if(), logparams_defaults, sizeofArray(logparams_defaults), CONFIG_STRING_LOG_PREFIX); int ret = config_get(config_get_if(), logparams_defaults, sizeofArray(logparams_defaults), CONFIG_STRING_LOG_PREFIX);
if (ret <0) { if (ret <0) {
...@@ -404,37 +383,45 @@ void log_getconfig(log_t *g_log) ...@@ -404,37 +383,45 @@ void log_getconfig(log_t *g_log)
} }
/* build then read the debug and dump parameter array */ /* build then read the debug and dump parameter array */
for (int i=0; log_maskmap[i].name != NULL ; i++) { int sz = 0;
sprintf(logparams_debug[i].optname, LOG_CONFIG_DEBUG_FORMAT, log_maskmap[i].name); for (const char *const *ptr = flag_name; strlen(*ptr) > 1; ptr++)
sprintf(logparams_dump[i].optname, LOG_CONFIG_DUMP_FORMAT, log_maskmap[i].name); sz++;
logparams_debug[i].defuintval = 0; paramdef_t logparams_debug[sz];
logparams_debug[i].type = TYPE_UINT; paramdef_t logparams_dump[sz];
logparams_debug[i].paramflags = PARAMFLAG_BOOL; for (int i = 0; i < sz; i++) {
logparams_debug[i].uptr = NULL; logparams_debug[i] = (paramdef_t){
logparams_debug[i].chkPptr = NULL; .type = TYPE_UINT,
logparams_debug[i].numelt = 0; .paramflags = PARAMFLAG_BOOL,
logparams_dump[i].defuintval = 0; };
logparams_dump[i].type = TYPE_UINT; sprintf(logparams_debug[i].optname, LOG_CONFIG_DEBUG_FORMAT, flag_name[i]);
logparams_dump[i].paramflags = PARAMFLAG_BOOL; logparams_dump[i] = (paramdef_t){.type = TYPE_UINT, .paramflags = PARAMFLAG_BOOL};
logparams_dump[i].uptr = NULL; sprintf(logparams_dump[i].optname, LOG_CONFIG_DUMP_FORMAT, flag_name[i]);
logparams_dump[i].chkPptr = NULL;
logparams_dump[i].numelt = 0;
} }
config_get(config_get_if(), logparams_debug, sizeofArray(log_maskmap) - 1, CONFIG_STRING_LOG_PREFIX); config_get(config_get_if(), logparams_debug, sz, CONFIG_STRING_LOG_PREFIX);
config_get(config_get_if(), logparams_dump, sizeofArray(log_maskmap) - 1, CONFIG_STRING_LOG_PREFIX); config_get(config_get_if(), logparams_dump, sz, CONFIG_STRING_LOG_PREFIX);
if (config_check_unknown_cmdlineopt(config_get_if(), CONFIG_STRING_LOG_PREFIX) > 0) bool old = CONFIG_ISFLAGSET(CONFIG_NOABORTONCHKF);
CONFIG_SETRTFLAG(CONFIG_NOABORTONCHKF);
if (config_check_unknown_cmdlineopt(config_get_if(), CONFIG_STRING_LOG_PREFIX) > 0) {
printf("Existing log_config options:\n");
printf(" Boolean options:\n");
for (int i = 0; i < sz; i++)
printf(" %s, \t%s\n", logparams_debug[i].optname, logparams_dump[i].optname);
printf(" Log level per module (");
for (int i = 0; log_level_names[i].name != NULL; i++)
printf("%s ", log_level_names[i].name);
printf(")\n");
for (int i = 0; i < MAX_LOG_PREDEF_COMPONENTS; i++)
printf(" %s\n", logparams_level[i].optname);
exit(1); exit(1);
/* 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_dump[i].uptr) )
g_log->dump_mask = g_log->dump_mask | log_maskmap[i].value;
} }
if (!old)
CONFIG_CLEARRTFLAG(CONFIG_NOABORTONCHKF);
int i = 0;
FOREACH_FLAG(FLAG_SETDEBUG);
i = 0;
FOREACH_FLAG(FLAG_SETDUMP);
/* log globally enabled/disabled */ /* log globally enabled/disabled */
set_glog_onlinelog(consolelog); set_glog_onlinelog(consolelog);
......
...@@ -88,7 +88,7 @@ extern "C" { ...@@ -88,7 +88,7 @@ extern "C" {
#define NUM_LOG_LEVEL 6 /*!< \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)*/ #define NUM_LOG_LEVEL 6 /*!< \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)*/
/** @}*/ /** @}*/
#define SET_LOG_OPTION(O) g_log->flag = (g_log->flag | O) #define SET_LOG_OPTION(O) g_log->flag = (g_log->flag | O)
#define CLEAR_LOG_OPTION(O) g_log->flag = (g_log->flag & (~O)) #define CLEAR_LOG_OPTION(O) g_log->flag = (g_log->flag & (~O))
/** @defgroup macros to identify a debug entity /** @defgroup macros to identify a debug entity
...@@ -99,28 +99,37 @@ extern "C" { ...@@ -99,28 +99,37 @@ extern "C" {
* server. * server.
* @brief * @brief
* @{*/ * @{*/
#define DEBUG_PRACH (1<<0)
#define DEBUG_RU (1<<1) #define FOREACH_FLAG(FLAG_DEF) \
#define DEBUG_UE_PHYPROC (1<<2) FLAG_DEF(PRACH) \
#define DEBUG_LTEESTIM (1<<3) FLAG_DEF(UE_PHYPROC) \
#define DEBUG_DLCELLSPEC (1<<4) FLAG_DEF(LTEESTIM) \
#define DEBUG_ULSCH (1<<5) FLAG_DEF(DLCELLSPEC) \
#define DEBUG_RRC (1<<6) FLAG_DEF(ULSCH) \
#define DEBUG_PDCP (1<<7) FLAG_DEF(RRC) \
#define DEBUG_DFT (1<<8) FLAG_DEF(PDCP) \
#define DEBUG_ASN1 (1<<9) FLAG_DEF(DFT) \
#define DEBUG_CTRLSOCKET (1<<10) FLAG_DEF(ASN1) \
#define DEBUG_SECURITY (1<<11) FLAG_DEF(CTRLSOCKET) \
#define DEBUG_NAS (1<<12) FLAG_DEF(SECURITY) \
#define DEBUG_RLC (1<<13) FLAG_DEF(NAS) \
#define DEBUG_DLSCH_DECOD (1<<14) FLAG_DEF(DLSCH_DECOD) \
#define UE_TIMING (1<<20) FLAG_DEF(UE_TIMING) \
FLAG_DEF(F1AP)
#define SET_LOG_DEBUG(B) g_log->debug_mask = (g_log->debug_mask | B)
#define CLEAR_LOG_DEBUG(B) g_log->debug_mask = (g_log->debug_mask & (~B)) #define FLAG_BITF(flag) uint64_t DEBUG_##flag: 1;
typedef struct {
#define SET_LOG_DUMP(B) g_log->dump_mask = (g_log->dump_mask | B) FOREACH_FLAG(FLAG_BITF)
#define CLEAR_LOG_DUMP(B) g_log->dump_mask = (g_log->dump_mask & (~B)) } debug_flags_t;
#define FLAG_TEXT(flag) #flag,
static const char *const flag_name[] = {FOREACH_FLAG(FLAG_TEXT) ""};
#define SET_LOG_DEBUG(B) g_log->debug_mask.B = true
#define CLEAR_LOG_DEBUG(B) g_log->debug_mask.B = false
#define SET_LOG_DUMP(B) g_log->dump_mask.B = true
#define CLEAR_LOG_DUMP(B) g_log->dump_mask.B = false
#define FOREACH_COMP(COMP_DEF) \ #define FOREACH_COMP(COMP_DEF) \
COMP_DEF(PHY, log) \ COMP_DEF(PHY, log) \
...@@ -215,8 +224,8 @@ typedef struct { ...@@ -215,8 +224,8 @@ typedef struct {
char level2string[NUM_LOG_LEVEL]; char level2string[NUM_LOG_LEVEL];
int flag; int flag;
char *filelog_name; char *filelog_name;
uint64_t debug_mask; debug_flags_t debug_mask;
uint64_t dump_mask; debug_flags_t dump_mask;
} log_t; } log_t;
#ifdef LOG_MAIN #ifdef LOG_MAIN
...@@ -230,7 +239,28 @@ extern "C" { ...@@ -230,7 +239,28 @@ extern "C" {
} }
#endif #endif
#endif #endif
#define FLAG_DEBUG_SET(flag) \
if (strcmp(name, #flag) == 0) { \
g_log->debug_mask.DEBUG_##flag = val; \
return true; \
};
static inline bool set_log_debug(char *name, bool val)
{
FOREACH_FLAG(FLAG_DEBUG_SET);
printf("Error: setting log debug of %s option, not existing\n", name);
return false;
}
#define FLAG_DUMP_SET(flag) \
if (strcmp(name, #flag) == 0) { \
g_log->dump_mask.DEBUG_##flag = val; \
return true; \
};
static inline bool set_log_dump(char *name, bool val)
{
FOREACH_FLAG(FLAG_DUMP_SET);
printf("Error: setting log dump of %s option, not existing\n", name);
return false;
}
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
int logInit (void); int logInit (void);
void logTerm (void); void logTerm (void);
...@@ -418,15 +448,15 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int ...@@ -418,15 +448,15 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int
/* macro used to dump a buffer or a message as in openair2/RRC/LTE/RRC_eNB.c, replaces LOG_F macro */ /* macro used to dump a buffer or a message as in openair2/RRC/LTE/RRC_eNB.c, replaces LOG_F macro */
#define LOG_DUMPMSG(c, f, b, s, x...) \ #define LOG_DUMPMSG(c, f, b, s, x...) \
do { \ do { \
if (g_log->dump_mask & f) \ if (g_log->dump_mask.f) \
log_dump(c, b, s, LOG_DUMP_CHAR, x); \ log_dump(c, b, s, LOG_DUMP_CHAR, x); \
} while (0) } while (0)
/* bitmask dependent macros, to isolate debugging code */ /* bitmask dependent macros, to isolate debugging code */
#define LOG_DEBUGFLAG(D) (g_log->debug_mask & D) #define LOG_DEBUGFLAG(D) (g_log->debug_mask.D)
/* bitmask dependent macros, to generate debug file such as matlab file or message dump */ /* bitmask dependent macros, to generate debug file such as matlab file or message dump */
#define LOG_DUMPFLAG(D) (g_log->dump_mask & D) #define LOG_DUMPFLAG(D) (g_log->dump_mask.D)
#define LOG_M(file, vector, data, len, dec, format) \ #define LOG_M(file, vector, data, len, dec, format) \
do { \ do { \
...@@ -529,11 +559,11 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int ...@@ -529,11 +559,11 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int
} while (0) } while (0)
#define nfapi_log(FILE, FNC, LN, COMP, LVL, FMT...) #define nfapi_log(FILE, FNC, LN, COMP, LVL, FMT...)
#define LOG_DEBUGFLAG(D) (g_log->debug_mask & D) #define LOG_DEBUGFLAG(D) (g_log->debug_mask.D)
#define LOG_DUMPFLAG(D) (g_log->dump_mask & D) #define LOG_DUMPFLAG(D) (g_log->dump_mask.D)
#define LOG_DUMPMSG(c, f, b, s, x...) \ #define LOG_DUMPMSG(c, f, b, s, x...) \
do { \ do { \
if (g_log->dump_mask & f) \ if (g_log->dump_mask.f) \
log_dump(c, b, s, LOG_DUMP_CHAR, x); \ log_dump(c, b, s, LOG_DUMP_CHAR, x); \
} while (0) /* */ } while (0) /* */
......
...@@ -251,12 +251,17 @@ void print_threads(char *buf, int debug, telnet_printfunc_t prnt) ...@@ -251,12 +251,17 @@ void print_threads(char *buf, int debug, telnet_printfunc_t prnt)
proccmd_get_threaddata(buf, debug, prnt, NULL); proccmd_get_threaddata(buf, debug, prnt, NULL);
} }
#define FLAG_PRINT_DEBUG_DUMP(flag) \
logsdata->lines[i].val[0] = (char *)flag_name[i]; \
logsdata->lines[i].val[1] = g_log->debug_mask.DEBUG_##flag ? "true" : "false"; \
logsdata->lines[i].val[1] = g_log->dump_mask.DEBUG_##flag ? "true" : "false"; \
i++;
int proccmd_websrv_getdata(char *cmdbuff, int debug, void *data, telnet_printfunc_t prnt) int proccmd_websrv_getdata(char *cmdbuff, int debug, void *data, telnet_printfunc_t prnt)
{ {
webdatadef_t *logsdata = (webdatadef_t *)data; webdatadef_t *logsdata = (webdatadef_t *)data;
const mapping *const log_level_names = log_level_names_ptr(); const mapping *const log_level_names = log_level_names_ptr();
const mapping *const log_options = log_option_names_ptr(); const mapping *const log_options = log_option_names_ptr();
const mapping *log_maskmap = log_maskmap_ptr();
if (strncmp(cmdbuff, "set", 3) == 0) { if (strncmp(cmdbuff, "set", 3) == 0) {
telnet_printfunc_t printfunc = (prnt != NULL) ? prnt : (telnet_printfunc_t)printf; telnet_printfunc_t printfunc = (prnt != NULL) ? prnt : (telnet_printfunc_t)printf;
if (strcasestr(cmdbuff, "loglvl") != NULL) { if (strcasestr(cmdbuff, "loglvl") != NULL) {
...@@ -291,23 +296,16 @@ int proccmd_websrv_getdata(char *cmdbuff, int debug, void *data, telnet_printfun ...@@ -291,23 +296,16 @@ int proccmd_websrv_getdata(char *cmdbuff, int debug, void *data, telnet_printfun
} }
} }
if (strcasestr(cmdbuff, "dbgopt") != NULL) { if (strcasestr(cmdbuff, "dbgopt") != NULL) {
int optbit = map_str_to_int(log_maskmap, logsdata->lines[0].val[0]); if (strcmp(logsdata->lines[0].val[1], "true") == 0)
if (optbit < 0) { if (!set_log_debug(logsdata->lines[0].val[0], strcmp(logsdata->lines[0].val[2], "true") == 0))
printfunc("debug option %s unknown\n", logsdata->lines[0].val[0]); printfunc("debug option %s unknown\n", logsdata->lines[0].val[0]);
} else { if (strcmp(logsdata->lines[0].val[2], "true") == 0)
if (strcmp(logsdata->lines[0].val[1], "true") == 0) if (!set_log_dump(logsdata->lines[0].val[0], strcmp(logsdata->lines[0].val[2], "true") == 0))
SET_LOG_DEBUG(optbit); printfunc("debug option %s unknown\n", logsdata->lines[0].val[0]);
else printfunc("%s debug %s dump %s\n",
CLEAR_LOG_DEBUG(optbit); logsdata->lines[0].val[0],
if (strcmp(logsdata->lines[0].val[2], "true") == 0) (strcmp(logsdata->lines[0].val[1], "true") == 0) ? "enabled" : "disabled",
SET_LOG_DUMP(optbit); (strcmp(logsdata->lines[0].val[2], "true") == 0) ? "enabled" : "disabled");
else
CLEAR_LOG_DUMP(optbit);
printfunc("%s debug %s dump %s\n",
logsdata->lines[0].val[0],
(strcmp(logsdata->lines[0].val[1], "true") == 0) ? "enabled" : "disabled",
(strcmp(logsdata->lines[0].val[2], "true") == 0) ? "enabled" : "disabled");
}
} }
if (strcasestr(cmdbuff, "threadsched") != NULL) { if (strcasestr(cmdbuff, "threadsched") != NULL) {
unsigned int tid = strtoll(logsdata->lines[0].val[0], NULL, 0); unsigned int tid = strtoll(logsdata->lines[0].val[0], NULL, 0);
...@@ -354,12 +352,9 @@ int proccmd_websrv_getdata(char *cmdbuff, int debug, void *data, telnet_printfun ...@@ -354,12 +352,9 @@ int proccmd_websrv_getdata(char *cmdbuff, int debug, void *data, telnet_printfun
snprintf(logsdata->columns[2].coltitle, TELNET_CMD_MAXSIZE, "dump"); snprintf(logsdata->columns[2].coltitle, TELNET_CMD_MAXSIZE, "dump");
logsdata->columns[2].coltype = TELNET_CHECKVAL_BOOL; logsdata->columns[2].coltype = TELNET_CHECKVAL_BOOL;
for (int i = 0; log_maskmap[i].name != NULL; i++) { int i = 0;
logsdata->numlines++; FOREACH_FLAG(FLAG_PRINT_DEBUG_DUMP);
logsdata->lines[i].val[0] = (char *)log_maskmap[i].name; logsdata->numlines += i;
logsdata->lines[i].val[1] = (g_log->debug_mask & log_maskmap[i].value) ? "true" : "false";
logsdata->lines[i].val[2] = (g_log->dump_mask & log_maskmap[i].value) ? "true" : "false";
}
} }
if (strcasestr(cmdbuff, "logopt") != NULL) { if (strcasestr(cmdbuff, "logopt") != NULL) {
...@@ -385,6 +380,14 @@ int proccmd_websrv_getdata(char *cmdbuff, int debug, void *data, telnet_printfun ...@@ -385,6 +380,14 @@ int proccmd_websrv_getdata(char *cmdbuff, int debug, void *data, telnet_printfun
return 0; return 0;
} }
#define FLAG_PRINT2_DEBUG_DUMP(flag) \
prnt("%02i %17.17s %5.5s %5.5s\n", \
i, \
flag_name[i], \
g_log->debug_mask.DEBUG_##flag ? "Y" : "N", \
g_log->dump_mask.DEBUG_##flag ? "Y" : "N"); \
i++;
int proccmd_show(char *buf, int debug, telnet_printfunc_t prnt) int proccmd_show(char *buf, int debug, telnet_printfunc_t prnt)
{ {
if (buf == NULL) { if (buf == NULL) {
...@@ -422,12 +425,8 @@ int proccmd_show(char *buf, int debug, telnet_printfunc_t prnt) ...@@ -422,12 +425,8 @@ int proccmd_show(char *buf, int debug, telnet_printfunc_t prnt)
} }
if (strcasestr(buf,"dbgopt") != NULL) { if (strcasestr(buf,"dbgopt") != NULL) {
prnt("\n module debug dumpfile\n"); prnt("\n module debug dumpfile\n");
const mapping *log_maskmap = log_maskmap_ptr(); int i = 0;
for (int i=0; log_maskmap[i].name != NULL ; i++) { FOREACH_FLAG(FLAG_PRINT2_DEBUG_DUMP);
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->dump_mask & log_maskmap[i].value)?"Y":"N") );
}
} }
if (strcasestr(buf,"config") != NULL) { if (strcasestr(buf,"config") != NULL) {
prnt("Command line arguments:\n"); prnt("Command line arguments:\n");
...@@ -593,28 +592,16 @@ int s = sscanf(buf,"%ms %i-%i\n",&logsubcmd, &idx1,&idx2); ...@@ -593,28 +592,16 @@ int s = sscanf(buf,"%ms %i-%i\n",&logsubcmd, &idx1,&idx2);
} }
} }
else if (l == 2 && strcmp(logparam,"debug") == 0){ else if (l == 2 && strcmp(logparam,"debug") == 0){
optbit = map_str_to_int(log_maskmap, opt); int ret = set_log_debug(opt, idx1 > 0);
if (optbit < 0) { if (!ret)
prnt("module %s unknown\n", opt); prnt("module %s unknown\n", opt);
} else { proccmd_show("dbgopt", debug, prnt);
if (idx1 > 0)
SET_LOG_DEBUG(optbit);
else
CLEAR_LOG_DEBUG(optbit);
proccmd_show("dbgopt", debug, prnt);
}
} }
else if (l == 2 && strcmp(logparam,"dump") == 0){ else if (l == 2 && strcmp(logparam,"dump") == 0){
optbit = map_str_to_int(log_maskmap, opt); int ret = set_log_dump(opt, idx1 > 0);
if (optbit < 0) { if (!ret)
prnt("module %s unknown\n", opt); prnt("module %s unknown\n", opt);
} else { proccmd_show("dump", debug, prnt);
if (idx1 > 0)
SET_LOG_DUMP(optbit);
else
CLEAR_LOG_DUMP(optbit);
proccmd_show("dump", debug, prnt);
}
} }
if (logparam != NULL) free(logparam); if (logparam != NULL) free(logparam);
if (opt != NULL) free(opt); if (opt != NULL) free(opt);
......
...@@ -132,7 +132,7 @@ void rx_prach0(PHY_VARS_eNB *eNB, ...@@ -132,7 +132,7 @@ void rx_prach0(PHY_VARS_eNB *eNB,
prach_ifftp = eNB->prach_vars_br.prach_ifft[ce_level]; prach_ifftp = eNB->prach_vars_br.prach_ifft[ce_level];
rxsigF = eNB->prach_vars_br.rxsigF[ce_level]; rxsigF = eNB->prach_vars_br.rxsigF[ce_level];
if (LOG_DEBUGFLAG(PRACH)) { if (LOG_DEBUGFLAG(DEBUG_PRACH)) {
if (((frame_prach)&1023) < 20) LOG_D(PHY, if (((frame_prach)&1023) < 20) LOG_D(PHY,
"PRACH (eNB) : running rx_prach (br_flag %d, ce_level %d) for frame %d subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d, rootSequenceIndex %d, repetition number %d,numRepetitionsPrePreambleAttempt %d\n", "PRACH (eNB) : running rx_prach (br_flag %d, ce_level %d) for frame %d subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d, rootSequenceIndex %d, repetition number %d,numRepetitionsPrePreambleAttempt %d\n",
br_flag,ce_level,frame_prach,subframe, br_flag,ce_level,frame_prach,subframe,
...@@ -145,23 +145,26 @@ void rx_prach0(PHY_VARS_eNB *eNB, ...@@ -145,23 +145,26 @@ void rx_prach0(PHY_VARS_eNB *eNB,
prach_ifftp = eNB->prach_vars.prach_ifft[0]; prach_ifftp = eNB->prach_vars.prach_ifft[0];
rxsigF = eNB->prach_vars.rxsigF[0]; rxsigF = eNB->prach_vars.rxsigF[0];
//if (LOG_DEBUGFLAG(PRACH)) { if (((frame_prach) & 1023) < 20)
if (((frame_prach)&1023) < 20) LOG_D(PHY,"PRACH (eNB) : running rx_prach for subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d , rootSequenceIndex %d\n", subframe, LOG_D(PHY,
fp->prach_config_common.prach_ConfigInfo.prach_FreqOffset,prach_ConfigIndex,rootSequenceIndex); "PRACH (eNB) : running rx_prach for subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d , rootSequenceIndex %d\n",
//} subframe,
fp->prach_config_common.prach_ConfigInfo.prach_FreqOffset,
prach_ConfigIndex,
rootSequenceIndex);
} }
} else { } else {
if (br_flag == 1) { if (br_flag == 1) {
rxsigF = ru->prach_rxsigF_br[ce_level]; rxsigF = ru->prach_rxsigF_br[ce_level];
if (LOG_DEBUGFLAG(PRACH)) { if (LOG_DEBUGFLAG(DEBUG_PRACH)) {
if (((frame_prach)&1023) < 20) LOG_D(PHY,"PRACH (RU) : running rx_prach (br_flag %d, ce_level %d) for frame %d subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d\n", if (((frame_prach)&1023) < 20) LOG_D(PHY,"PRACH (RU) : running rx_prach (br_flag %d, ce_level %d) for frame %d subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d\n",
br_flag,ce_level,frame_prach,subframe,fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[ce_level],prach_ConfigIndex); br_flag,ce_level,frame_prach,subframe,fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[ce_level],prach_ConfigIndex);
} }
} else { } else {
rxsigF = ru->prach_rxsigF[0]; rxsigF = ru->prach_rxsigF[0];
if (LOG_DEBUGFLAG(PRACH)) { if (LOG_DEBUGFLAG(DEBUG_PRACH)) {
if (((frame_prach)&1023) < 20) LOG_D(PHY,"PRACH (RU) : running rx_prach for subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d\n", if (((frame_prach)&1023) < 20) LOG_D(PHY,"PRACH (RU) : running rx_prach for subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d\n",
subframe,fp->prach_config_common.prach_ConfigInfo.prach_FreqOffset,prach_ConfigIndex); subframe,fp->prach_config_common.prach_ConfigInfo.prach_FreqOffset,prach_ConfigIndex);
} }
...@@ -178,7 +181,7 @@ void rx_prach0(PHY_VARS_eNB *eNB, ...@@ -178,7 +181,7 @@ void rx_prach0(PHY_VARS_eNB *eNB,
// DJP - indexing below in subframe zero takes us off the beginning of the array??? // DJP - indexing below in subframe zero takes us off the beginning of the array???
prach[aa] = (int16_t *)&ru->common.rxdata[aa][(subframe*fp->samples_per_tti)-ru->N_TA_offset]; prach[aa] = (int16_t *)&ru->common.rxdata[aa][(subframe*fp->samples_per_tti)-ru->N_TA_offset];
if (LOG_DUMPFLAG(PRACH)) { if (LOG_DUMPFLAG(DEBUG_PRACH)) {
int32_t en0=signal_energy((int32_t *)prach[aa],fp->samples_per_tti); int32_t en0=signal_energy((int32_t *)prach[aa],fp->samples_per_tti);
dBEn0 = dB_fixed(en0); dBEn0 = dB_fixed(en0);
int8_t rach_dBm = dBEn0 - ru->rx_total_gain_dB; int8_t rach_dBm = dBEn0 - ru->rx_total_gain_dB;
...@@ -281,7 +284,7 @@ void rx_prach0(PHY_VARS_eNB *eNB, ...@@ -281,7 +284,7 @@ void rx_prach0(PHY_VARS_eNB *eNB,
if (((eNB!=NULL) && (ru->function != NGFI_RAU_IF4p5))|| if (((eNB!=NULL) && (ru->function != NGFI_RAU_IF4p5))||
((eNB==NULL) && (ru->function == NGFI_RRU_IF4p5))) { // compute the DFTs of the PRACH temporal resources ((eNB==NULL) && (ru->function == NGFI_RRU_IF4p5))) { // compute the DFTs of the PRACH temporal resources
// Do forward transform // Do forward transform
if (LOG_DEBUGFLAG(PRACH)) { if (LOG_DEBUGFLAG(DEBUG_PRACH)) {
LOG_D(PHY,"rx_prach: Doing FFT for N_RB_UL %d nb_rx:%d Ncp:%d\n",fp->N_RB_UL, nb_rx, Ncp); LOG_D(PHY,"rx_prach: Doing FFT for N_RB_UL %d nb_rx:%d Ncp:%d\n",fp->N_RB_UL, nb_rx, Ncp);
} }
...@@ -353,7 +356,7 @@ void rx_prach0(PHY_VARS_eNB *eNB, ...@@ -353,7 +356,7 @@ void rx_prach0(PHY_VARS_eNB *eNB,
return; return;
} else if (eNB!=NULL) { } else if (eNB!=NULL) {
if ( LOG_DEBUGFLAG(PRACH)) { if (LOG_DEBUGFLAG(DEBUG_PRACH)) {
int en = dB_fixed(signal_energy((int32_t *)&rxsigF[0][0],840)); int en = dB_fixed(signal_energy((int32_t *)&rxsigF[0][0],840));
if ((en > 10)&&(br_flag==1)) LOG_I(PHY,"PRACH (br_flag %d,ce_level %d, n_ra_prb %d, k %d): Frame %d, Subframe %d => %d dB\n",br_flag,ce_level,n_ra_prb,k,frame_prach,subframe,en); if ((en > 10)&&(br_flag==1)) LOG_I(PHY,"PRACH (br_flag %d,ce_level %d, n_ra_prb %d, k %d): Frame %d, Subframe %d => %d dB\n",br_flag,ce_level,n_ra_prb,k,frame_prach,subframe,en);
...@@ -394,8 +397,8 @@ void rx_prach0(PHY_VARS_eNB *eNB, ...@@ -394,8 +397,8 @@ void rx_prach0(PHY_VARS_eNB *eNB,
uint64_t avg_en=0; uint64_t avg_en=0;
for (preamble_index=0 ; preamble_index<64 ; preamble_index++) { for (preamble_index=0 ; preamble_index<64 ; preamble_index++) {
if (LOG_DEBUGFLAG(PRACH)) { if (LOG_DEBUGFLAG(DEBUG_PRACH)) {
// int en = dB_fixed(signal_energy((int32_t *)&rxsigF[0][0],840)); // int en = dB_fixed(signal_energy((int32_t *)&rxsigF[0][0],840));
if (dBEn0>30) LOG_I(PHY,"frame %d, subframe %d : Trying preamble %d (br_flag %d)\n",frame_prach,subframe,preamble_index,br_flag); if (dBEn0>30) LOG_I(PHY,"frame %d, subframe %d : Trying preamble %d (br_flag %d)\n",frame_prach,subframe,preamble_index,br_flag);
} }
...@@ -479,7 +482,7 @@ void rx_prach0(PHY_VARS_eNB *eNB, ...@@ -479,7 +482,7 @@ void rx_prach0(PHY_VARS_eNB *eNB,
} }
// Compute DFT of RX signal (conjugate input, results in conjugate output) for each new rootSequenceIndex // Compute DFT of RX signal (conjugate input, results in conjugate output) for each new rootSequenceIndex
if (LOG_DEBUGFLAG(PRACH)) { if (LOG_DEBUGFLAG(DEBUG_PRACH)) {
//en = dB_fixed(signal_energy((int32_t *)&rxsigF[0][0],840)); //en = dB_fixed(signal_energy((int32_t *)&rxsigF[0][0],840));
if (dBEn0>30) LOG_I(PHY,"frame %d, subframe %d : preamble index %d: offset %d, preamble shift %d (br_flag %d, en %d)\n", if (dBEn0>30) LOG_I(PHY,"frame %d, subframe %d : preamble index %d: offset %d, preamble shift %d (br_flag %d, en %d)\n",
...@@ -502,8 +505,8 @@ void rx_prach0(PHY_VARS_eNB *eNB, ...@@ -502,8 +505,8 @@ void rx_prach0(PHY_VARS_eNB *eNB,
memset(prach_ifft,0,((N_ZC==839) ? 2048 : 256)*sizeof(int32_t)); memset(prach_ifft,0,((N_ZC==839) ? 2048 : 256)*sizeof(int32_t));
} }
c16_t prachF[1024] __attribute__((aligned(32)))={0}; c16_t prachF[1024] __attribute__((aligned(32)))={0};
if (LOG_DUMPFLAG(PRACH)) if (LOG_DUMPFLAG(DEBUG_PRACH))
for (int z=0; z<nb_rx; z++) for (int z=0; z<nb_rx; z++)
if( prach[z] ) { if( prach[z] ) {
char tmp[128]; char tmp[128];
...@@ -543,7 +546,7 @@ void rx_prach0(PHY_VARS_eNB *eNB, ...@@ -543,7 +546,7 @@ void rx_prach0(PHY_VARS_eNB *eNB,
prach_ifft[i] += (prach_ifft_tmp[i<<1]*prach_ifft_tmp[(i<<1)] + prach_ifft_tmp[1+(i<<1)]*prach_ifft_tmp[1+(i<<1)])>>9; prach_ifft[i] += (prach_ifft_tmp[i<<1]*prach_ifft_tmp[(i<<1)] + prach_ifft_tmp[1+(i<<1)]*prach_ifft_tmp[1+(i<<1)])>>9;
} }
if (LOG_DUMPFLAG(PRACH)) { if (LOG_DUMPFLAG(DEBUG_PRACH)) {
if (aa==0) LOG_M("prach_rxF_comp0.m","prach_rxF_comp0",prachF,1024,1,1); if (aa==0) LOG_M("prach_rxF_comp0.m","prach_rxF_comp0",prachF,1024,1,1);
if (aa==1) LOG_M("prach_rxF_comp1.m","prach_rxF_comp1",prachF,1024,1,1); if (aa==1) LOG_M("prach_rxF_comp1.m","prach_rxF_comp1",prachF,1024,1,1);
...@@ -555,7 +558,7 @@ void rx_prach0(PHY_VARS_eNB *eNB, ...@@ -555,7 +558,7 @@ void rx_prach0(PHY_VARS_eNB *eNB,
if ((br_flag==0) || if ((br_flag==0) ||
(eNB->prach_vars_br.repetition_number[ce_level]== (eNB->prach_vars_br.repetition_number[ce_level]==
eNB->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[ce_level])) { eNB->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[ce_level])) {
if (LOG_DEBUGFLAG(PRACH)) { if (LOG_DEBUGFLAG(DEBUG_PRACH)) {
int en = dB_fixed(signal_energy((int32_t *)&rxsigF[0][0],840)); int en = dB_fixed(signal_energy((int32_t *)&rxsigF[0][0],840));
if (en>60) LOG_I(PHY,"frame %d, subframe %d: Checking for peak in time-domain (br_flag %d, en %d)\n",frame_prach,subframe,br_flag,en); if (en>60) LOG_I(PHY,"frame %d, subframe %d: Checking for peak in time-domain (br_flag %d, en %d)\n",frame_prach,subframe,br_flag,en);
...@@ -573,8 +576,8 @@ void rx_prach0(PHY_VARS_eNB *eNB, ...@@ -573,8 +576,8 @@ void rx_prach0(PHY_VARS_eNB *eNB,
*max_preamble_delay = ((i*fft_size)>>log2_ifft_size)*update_TA/update_TA2; *max_preamble_delay = ((i*fft_size)>>log2_ifft_size)*update_TA/update_TA2;
*max_preamble = preamble_index; *max_preamble = preamble_index;
if (LOG_DEBUGFLAG(PRACH)) { if (LOG_DEBUGFLAG(DEBUG_PRACH)) {
// int en = dB_fixed(signal_energy((int32_t *)&rxsigF[0][0],840)); // int en = dB_fixed(signal_energy((int32_t *)&rxsigF[0][0],840));
if (dBEn0>30) if (dBEn0>30)
LOG_D(PHY,"frame %d, subframe %d : max_preamble_energy %d, max_preamble_delay %d, max_preamble %d (br_flag %d,ce_level %d, levdB %d, lev %d)\n", LOG_D(PHY,"frame %d, subframe %d : max_preamble_energy %d, max_preamble_delay %d, max_preamble %d (br_flag %d,ce_level %d, levdB %d, lev %d)\n",
...@@ -613,7 +616,7 @@ void rx_prach0(PHY_VARS_eNB *eNB, ...@@ -613,7 +616,7 @@ void rx_prach0(PHY_VARS_eNB *eNB,
LOG_M("prach_ifft0_br.m","prach_t0_br",prach_ifft,1024,1,1); LOG_M("prach_ifft0_br.m","prach_t0_br",prach_ifft,1024,1,1);
} }
} }
} /* LOG_DUMPFLAG(PRACH) */ }
if (eNB) stop_meas(&eNB->rx_prach); if (eNB) stop_meas(&eNB->rx_prach);
AssertFatal(exit_flag==0,"exiting\n"); AssertFatal(exit_flag==0,"exiting\n");
......
...@@ -383,11 +383,10 @@ void rx_nr_prach_ru(RU_t *ru, int prachFormat, int numRA, int prachStartSymbol, ...@@ -383,11 +383,10 @@ void rx_nr_prach_ru(RU_t *ru, int prachFormat, int numRA, int prachStartSymbol,
const dft_size_idx_t dftsize = get_dft(dftlen); const dft_size_idx_t dftsize = get_dft(dftlen);
// Do forward transform // Do forward transform
if (LOG_DEBUGFLAG(PRACH)) { if (LOG_DEBUGFLAG(DEBUG_PRACH)) {
LOG_D(PHY, "rx_prach: Doing PRACH FFT for nb_rx:%d Ncp:%d dftlen:%d\n", ru->nb_rx, Ncp, dftlen); LOG_D(PHY, "rx_prach: Doing PRACH FFT for nb_rx:%d Ncp:%d dftlen:%d\n", ru->nb_rx, Ncp, dftlen);
} }
// Note: Assumes PUSCH SCS @ 30 kHz, take values for formats 0-2 and adjust for others below // Note: Assumes PUSCH SCS @ 30 kHz, take values for formats 0-2 and adjust for others below
int kbar = 1; int kbar = 1;
int K = 24; int K = 24;
...@@ -497,7 +496,7 @@ void rx_nr_prach(PHY_VARS_gNB *gNB, ...@@ -497,7 +496,7 @@ void rx_nr_prach(PHY_VARS_gNB *gNB,
LOG_D(PHY,"L1 PRACH RX: rooSequenceIndex %d, numRootSeqeuences %d, NCS %d, N_ZC %d, format %d \n",rootSequenceIndex,numrootSequenceIndex,NCS,N_ZC,prach_fmt); LOG_D(PHY,"L1 PRACH RX: rooSequenceIndex %d, numRootSeqeuences %d, NCS %d, N_ZC %d, format %d \n",rootSequenceIndex,numrootSequenceIndex,NCS,N_ZC,prach_fmt);
prach_ifft = gNB->prach_vars.prach_ifft; prach_ifft = gNB->prach_vars.prach_ifft;
if (LOG_DEBUGFLAG(PRACH)){ if (LOG_DEBUGFLAG(DEBUG_PRACH)) {
if ((frame&1023) < 20) LOG_D(PHY,"PRACH (gNB) : running rx_prach for slot %d, msg1_frequencystart %d, rootSequenceIndex %d\n", slot, msg1_frequencystart, rootSequenceIndex); if ((frame&1023) < 20) LOG_D(PHY,"PRACH (gNB) : running rx_prach for slot %d, msg1_frequencystart %d, rootSequenceIndex %d\n", slot, msg1_frequencystart, rootSequenceIndex);
} }
...@@ -520,8 +519,7 @@ void rx_nr_prach(PHY_VARS_gNB *gNB, ...@@ -520,8 +519,7 @@ void rx_nr_prach(PHY_VARS_gNB *gNB,
*max_preamble = 0; *max_preamble = 0;
int16_t prachF[2 * 1024]; int16_t prachF[2 * 1024];
for (preamble_index=0 ; preamble_index<64 ; preamble_index++) { for (preamble_index=0 ; preamble_index<64 ; preamble_index++) {
if (LOG_DEBUGFLAG(DEBUG_PRACH)) {
if (LOG_DEBUGFLAG(PRACH)){
int en = dB_fixed(signal_energy((int32_t*)&rxsigF[0][0],(N_ZC==839) ? 840: 140)); int en = dB_fixed(signal_energy((int32_t*)&rxsigF[0][0],(N_ZC==839) ? 840: 140));
if (en>60) LOG_D(PHY,"frame %d, slot %d : Trying preamble %d \n",frame,slot,preamble_index); if (en>60) LOG_D(PHY,"frame %d, slot %d : Trying preamble %d \n",frame,slot,preamble_index);
} }
...@@ -599,7 +597,7 @@ void rx_nr_prach(PHY_VARS_gNB *gNB, ...@@ -599,7 +597,7 @@ void rx_nr_prach(PHY_VARS_gNB *gNB,
} }
// Compute DFT of RX signal (conjugate input, results in conjugate output) for each new rootSequenceIndex // Compute DFT of RX signal (conjugate input, results in conjugate output) for each new rootSequenceIndex
if (LOG_DEBUGFLAG(PRACH)) { if (LOG_DEBUGFLAG(DEBUG_PRACH)) {
int en = dB_fixed(signal_energy((int32_t*)&rxsigF[0][0],840)); int en = dB_fixed(signal_energy((int32_t*)&rxsigF[0][0],840));
if (en>60) if (en>60)
LOG_D(PHY, LOG_D(PHY,
...@@ -626,11 +624,11 @@ void rx_nr_prach(PHY_VARS_gNB *gNB, ...@@ -626,11 +624,11 @@ void rx_nr_prach(PHY_VARS_gNB *gNB,
memset(prach_ifft,0,((N_ZC==839) ? 2048 : 256)*sizeof(int32_t)); memset(prach_ifft,0,((N_ZC==839) ? 2048 : 256)*sizeof(int32_t));
memset(prachF, 0, sizeof(int16_t) * 2 * 1024); memset(prachF, 0, sizeof(int16_t) * 2 * 1024);
if (LOG_DUMPFLAG(PRACH)) { if (LOG_DUMPFLAG(DEBUG_PRACH)) {
LOG_M("prach_rxF0.m","prach_rxF0",rxsigF[0],N_ZC,1,1); LOG_M("prach_rxF0.m","prach_rxF0",rxsigF[0],N_ZC,1,1);
LOG_M("prach_rxF1.m","prach_rxF1",rxsigF[1],6144,1,1); LOG_M("prach_rxF1.m","prach_rxF1",rxsigF[1],6144,1,1);
} }
for (int aa = 0; aa < nb_rx; aa++) { for (int aa = 0; aa < nb_rx; aa++) {
// Do componentwise product with Xu* on each antenna // Do componentwise product with Xu* on each antenna
...@@ -653,7 +651,7 @@ void rx_nr_prach(PHY_VARS_gNB *gNB, ...@@ -653,7 +651,7 @@ void rx_nr_prach(PHY_VARS_gNB *gNB,
prach_ifft[i] += (int32_t)prach_ifft_tmp[i<<1]*(int32_t)prach_ifft_tmp[(i<<1)] + (int32_t)prach_ifft_tmp[1+(i<<1)]*(int32_t)prach_ifft_tmp[1+(i<<1)]; prach_ifft[i] += (int32_t)prach_ifft_tmp[i<<1]*(int32_t)prach_ifft_tmp[(i<<1)] + (int32_t)prach_ifft_tmp[1+(i<<1)]*(int32_t)prach_ifft_tmp[1+(i<<1)];
} }
if (LOG_DUMPFLAG(PRACH)) { if (LOG_DUMPFLAG(DEBUG_PRACH)) {
if (aa == 0) if (aa == 0)
LOG_M("prach_rxF_comp0.m","prach_rxF_comp0", prachF, 1024, 1, 1); LOG_M("prach_rxF_comp0.m","prach_rxF_comp0", prachF, 1024, 1, 1);
if (aa == 1) if (aa == 1)
...@@ -717,8 +715,7 @@ void rx_nr_prach(PHY_VARS_gNB *gNB, ...@@ -717,8 +715,7 @@ void rx_nr_prach(PHY_VARS_gNB *gNB,
} }
else *TA = *TA/2; else *TA = *TA/2;
if (LOG_DUMPFLAG(DEBUG_PRACH)) {
if (LOG_DUMPFLAG(PRACH)) {
//int en = dB_fixed(signal_energy((int32_t*)&rxsigF[0][0],840)); //int en = dB_fixed(signal_energy((int32_t*)&rxsigF[0][0],840));
// if (en>60) { // if (en>60) {
int k = (12 * n_ra_prb) - 6 * fp->N_RB_UL; int k = (12 * n_ra_prb) - 6 * fp->N_RB_UL;
...@@ -734,7 +731,7 @@ void rx_nr_prach(PHY_VARS_gNB *gNB, ...@@ -734,7 +731,7 @@ void rx_nr_prach(PHY_VARS_gNB *gNB,
LOG_M("Xu.m","xu", Xu, N_ZC, 1, 1); LOG_M("Xu.m","xu", Xu, N_ZC, 1, 1);
LOG_M("prach_ifft0.m","prach_t0", prach_ifft, 1024, 1, 1); LOG_M("prach_ifft0.m","prach_t0", prach_ifft, 1024, 1, 1);
// } // }
} /* LOG_DUMPFLAG(PRACH) */ }
stop_meas(&gNB->rx_prach); stop_meas(&gNB->rx_prach);
} }
......
This diff is collapsed.
...@@ -892,7 +892,7 @@ int main(int argc, char **argv) { ...@@ -892,7 +892,7 @@ int main(int argc, char **argv) {
set_glog_onlinelog(true); set_glog_onlinelog(true);
// enable these lines if you need debug info // enable these lines if you need debug info
set_glog(loglvl); set_glog(loglvl);
SET_LOG_DEBUG(UE_TIMING); SET_LOG_DEBUG(DEBUG_UE_TIMING);
// moreover you need to init itti with the following line // moreover you need to init itti with the following line
// however itti will catch all signals, so ctrl-c won't work anymore // however itti will catch all signals, so ctrl-c won't work anymore
// alternatively you can disable ITTI completely in CMakeLists.txt // alternatively you can disable ITTI completely in CMakeLists.txt
......
...@@ -989,7 +989,7 @@ int main(int argc, char **argv) { ...@@ -989,7 +989,7 @@ int main(int argc, char **argv) {
set_glog_onlinelog(true); set_glog_onlinelog(true);
// enable these lines if you need debug info // enable these lines if you need debug info
set_glog(loglvl); set_glog(loglvl);
SET_LOG_DEBUG(UE_TIMING); set_log_debug("UE_TIMING", true);
// moreover you need to init itti with the following line // moreover you need to init itti with the following line
// however itti will catch all signals, so ctrl-c won't work anymore // however itti will catch all signals, so ctrl-c won't work anymore
// alternatively you can disable ITTI completely in CMakeLists.txt // alternatively you can disable ITTI completely in CMakeLists.txt
......
...@@ -938,7 +938,7 @@ int main(int argc, char **argv) { ...@@ -938,7 +938,7 @@ int main(int argc, char **argv) {
ndi=0; ndi=0;
phy_reset_ue(0,0,0); phy_reset_ue(0,0,0);
UE->UE_mode[eNB_id]=PUSCH; UE->UE_mode[eNB_id]=PUSCH;
SET_LOG_DEBUG(UE_TIMING); set_log_debug("UE_TIMING", true);
for (trials = 0; trials<n_frames; trials++) { for (trials = 0; trials<n_frames; trials++) {
// printf("*"); // printf("*");
......
...@@ -403,7 +403,7 @@ int main(int argc, char **argv){ ...@@ -403,7 +403,7 @@ int main(int argc, char **argv){
// Configure log // Configure log
logInit(); logInit();
set_glog(loglvl); set_glog(loglvl);
SET_LOG_DEBUG(PRACH); SET_LOG_DEBUG(DEBUG_PRACH);
// Configure gNB and RU // Configure gNB and RU
RC.gNB = (PHY_VARS_gNB**) malloc(2*sizeof(PHY_VARS_gNB *)); RC.gNB = (PHY_VARS_gNB**) malloc(2*sizeof(PHY_VARS_gNB *));
......
...@@ -160,7 +160,7 @@ int CU_send_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(sctp_assoc_t assoc_id, f1ap_ ...@@ -160,7 +160,7 @@ int CU_send_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(sctp_assoc_t assoc_id, f1ap_
LOG_E(F1AP, "Failed to encode F1 gNB-DU Configuration Update Acknowledge\n"); LOG_E(F1AP, "Failed to encode F1 gNB-DU Configuration Update Acknowledge\n");
return -1; return -1;
} }
LOG_DUMPMSG(F1AP, LOG_DUMP_CHAR, buffer, len, "F1AP gNB-DU CONFIGURATION UPDATE : "); LOG_DUMPMSG(F1AP, DEBUG_F1AP, buffer, len, "F1AP gNB-DU CONFIGURATION UPDATE : ");
ASN_STRUCT_FREE(asn_DEF_F1AP_F1AP_PDU, pdu); ASN_STRUCT_FREE(asn_DEF_F1AP_F1AP_PDU, pdu);
f1ap_itti_send_sctp_data_req(assoc_id, buffer, len); f1ap_itti_send_sctp_data_req(assoc_id, buffer, len);
return 0; return 0;
...@@ -185,7 +185,7 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(sctp_assoc_t assoc_id, f1ap_gnb_cu_confi ...@@ -185,7 +185,7 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(sctp_assoc_t assoc_id, f1ap_gnb_cu_confi
LOG_E(F1AP, "Failed to encode F1 gNB-CU Configuration Update\n"); LOG_E(F1AP, "Failed to encode F1 gNB-CU Configuration Update\n");
return -1; return -1;
} }
LOG_DUMPMSG(F1AP, LOG_DUMP_CHAR, buffer, len, "F1AP gNB-CU CONFIGURATION UPDATE : "); LOG_DUMPMSG(F1AP, DEBUG_F1AP, buffer, len, "F1AP gNB-CU CONFIGURATION UPDATE : ");
ASN_STRUCT_FREE(asn_DEF_F1AP_F1AP_PDU, pdu); ASN_STRUCT_FREE(asn_DEF_F1AP_F1AP_PDU, pdu);
f1ap_itti_send_sctp_data_req(assoc_id, buffer, len); f1ap_itti_send_sctp_data_req(assoc_id, buffer, len);
return 0; return 0;
......
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