Commit 493da9ae authored by Vijay C's avatar Vijay C

Merge branch 'private/bugz122773' into '3GPP_TTCN_System_Simulator'

LTTng Logging filtering for eNB and Proxy

See merge request firecell/rdsubscription/sequansrd!63
parents a3b597d8 20fca14d
...@@ -209,18 +209,18 @@ THREAD_STRUCT = ( ...@@ -209,18 +209,18 @@ THREAD_STRUCT = (
log_config = log_config =
{ {
global_log_level ="debug"; global_log_level ="error";
global_log_verbosity ="low"; #global_log_verbosity ="low";
hw_log_level ="error"; #hw_log_level ="error";
hw_log_verbosity ="low"; #hw_log_verbosity ="low";
phy_log_level ="error"; #phy_log_level ="error";
phy_log_verbosity ="low"; #phy_log_verbosity ="low";
mac_log_level ="analysis"; #mac_log_level ="analysis";
mac_log_verbosity ="low"; #mac_log_verbosity ="low";
rlc_log_level ="warn"; #rlc_log_level ="warn";
rlc_log_verbosity ="low"; #rlc_log_verbosity ="low";
pdcp_log_level ="analysis"; #pdcp_log_level ="analysis";
pdcp_log_verbosity ="low"; #pdcp_log_verbosity ="low";
rrc_log_level ="analysis"; rrc_log_level ="info";
rrc_log_verbosity ="full"; #rrc_log_verbosity ="full";
}; };
...@@ -2852,6 +2852,7 @@ target_link_libraries (nr-uesoftmodem ${LIBXML2_LIBRARIES}) ...@@ -2852,6 +2852,7 @@ target_link_libraries (nr-uesoftmodem ${LIBXML2_LIBRARIES})
target_link_libraries (nr-uesoftmodem pthread m CONFIG_LIB rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES}) target_link_libraries (nr-uesoftmodem pthread m CONFIG_LIB rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES})
target_link_libraries (nr-uesoftmodem ${LIB_LMS_LIBRARIES}) target_link_libraries (nr-uesoftmodem ${LIB_LMS_LIBRARIES})
target_link_libraries (nr-uesoftmodem ${T_LIB}) target_link_libraries (nr-uesoftmodem ${T_LIB})
target_link_libraries (nr-uesoftmodem lttng-ust)
add_dependencies( nr-uesoftmodem ldpc_orig ldpc_optim ldpc_optim8seg ldpc ) add_dependencies( nr-uesoftmodem ldpc_orig ldpc_optim ldpc_optim8seg ldpc )
if (CUDA_FOUND) if (CUDA_FOUND)
......
...@@ -594,6 +594,30 @@ void logRecord_mt(const char *file, ...@@ -594,6 +594,30 @@ void logRecord_mt(const char *file,
va_end(args); va_end(args);
} }
void logRecord_tp(const char *file,
const char *func,
int line,
int comp,
int level,
const char *format,
... )
{
log_component_t *c = &g_log->log_component[comp];
char header[48];
char buf[1024];
va_list args;
va_start(args, format);
vsnprintf(buf, sizeof(buf)-1, format, args);
va_end(args);
if(map_int_to_str(log_level_names, level) != NULL)
snprintf(header, sizeof(header)-1, "SS-%s %s", c->name, map_int_to_str(log_level_names, level));
else
snprintf(header, sizeof(header)-1, "SS-%s", c->name);
LOG_SS(header, buf) ;
}
void vlogRecord_mt(const char *file, void vlogRecord_mt(const char *file,
const char *func, const char *func,
int line, int line,
......
...@@ -313,6 +313,7 @@ void logTerm (void); ...@@ -313,6 +313,7 @@ void logTerm (void);
int isLogInitDone (void); int isLogInitDone (void);
void logRecord_mt(const char *file, const char *func, int line,int comp, int level, const char *format, ...) __attribute__ ((format (printf, 6, 7))); void logRecord_mt(const char *file, const char *func, int line,int comp, int level, const char *format, ...) __attribute__ ((format (printf, 6, 7)));
void vlogRecord_mt(const char *file, const char *func, int line, int comp, int level, const char *format, va_list args ); void vlogRecord_mt(const char *file, const char *func, int line, int comp, int level, const char *format, va_list args );
void logRecord_tp(const char *file, const char *func, int line,int comp, int level, const char *format, ...) __attribute__ ((format (printf, 6, 7)));
void log_dump(int component, void *buffer, int buffsize,int datatype, const char *format, ... ); void log_dump(int component, void *buffer, int buffsize,int datatype, const char *format, ... );
int set_log(int component, int level); int set_log(int component, int level);
void set_glog(int level); void set_glog(int level);
...@@ -419,12 +420,12 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int ...@@ -419,12 +420,12 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int
# if T_TRACER # if T_TRACER
/* per component, level dependent macros */ /* per component, level dependent macros */
# define LOG_E(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_ERR ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_ERR, x) ;} else { T(T_LEGACY_ ## c ## _ERROR, T_PRINTF(x)) ;}} while (0) # define T_LOG_E(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_ERR ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_ERR, x) ;} else { T(T_LEGACY_ ## c ## _ERROR, T_PRINTF(x)) ;}} while (0)
# define LOG_W(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_WARNING) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_WARNING, x) ;} else { T(T_LEGACY_ ## c ## _WARNING, T_PRINTF(x)) ;}} while (0) # define T_LOG_W(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_WARNING) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_WARNING, x) ;} else { T(T_LEGACY_ ## c ## _WARNING, T_PRINTF(x)) ;}} while (0)
# define LOG_A(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_ANALYSIS) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_ANALYSIS, x) ;} else { T(T_LEGACY_ ## c ## _INFO, T_PRINTF(x)) ;}} while (0) # define T_LOG_A(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_ANALYSIS) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_ANALYSIS, x) ;} else { T(T_LEGACY_ ## c ## _INFO, T_PRINTF(x)) ;}} while (0)
# define LOG_I(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_INFO ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_INFO, x) ;} else { T(T_LEGACY_ ## c ## _INFO, T_PRINTF(x)) ;}} while (0) # define T_LOG_I(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_INFO ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_INFO, x) ;} else { T(T_LEGACY_ ## c ## _INFO, T_PRINTF(x)) ;}} while (0)
# define LOG_D(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_DEBUG ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_DEBUG, x) ;} else { T(T_LEGACY_ ## c ## _DEBUG, T_PRINTF(x)) ;}} while (0) # define T_LOG_D(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_DEBUG ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_DEBUG, x) ;} else { T(T_LEGACY_ ## c ## _DEBUG, T_PRINTF(x)) ;}} while (0)
# define LOG_T(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_TRACE ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_TRACE, x) ;} else { T(T_LEGACY_ ## c ## _TRACE, T_PRINTF(x)) ;}} while (0) # define T_LOG_T(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_TRACE ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_TRACE, x) ;} else { T(T_LEGACY_ ## c ## _TRACE, T_PRINTF(x)) ;}} while (0)
# define VLOG(c,l, f, args) do { if (T_stdout) { if( g_log->log_component[c].level >= l ) vlogRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, l, f, args) ;} } while (0) # define VLOG(c,l, f, args) do { if (T_stdout) { if( g_log->log_component[c].level >= l ) vlogRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, l, f, args) ;} } while (0)
/* 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...) do { if(g_log->dump_mask & f) log_dump(c, b, s, LOG_DUMP_CHAR, x) ;} while (0) /* */ # define LOG_DUMPMSG(c, f, b, s, x...) do { if(g_log->dump_mask & f) log_dump(c, b, s, LOG_DUMP_CHAR, x) ;} while (0) /* */
...@@ -438,12 +439,12 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int ...@@ -438,12 +439,12 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int
# define LOG_VAR(A,B) A B # define LOG_VAR(A,B) A B
# else /* T_TRACER: remove all debugging and tracing messages, except errors */ # else /* T_TRACER: remove all debugging and tracing messages, except errors */
# define LOG_E(c, x...) do { if( g_log->log_component[c].level >= OAILOG_ERR ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_ERR, x) ;} while (0) # define T_LOG_E(c, x...) do { if( g_log->log_component[c].level >= OAILOG_ERR ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_ERR, x) ;} while (0)
# define LOG_W(c, x...) do { if( g_log->log_component[c].level >= OAILOG_WARNING) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_WARNING, x) ;} while (0) # define T_LOG_W(c, x...) do { if( g_log->log_component[c].level >= OAILOG_WARNING) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_WARNING, x) ;} while (0)
# define LOG_A(c, x...) do { if( g_log->log_component[c].level >= OAILOG_ANALYSIS) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_ANALYSIS, x);} while (0) # define T_LOG_A(c, x...) do { if( g_log->log_component[c].level >= OAILOG_ANALYSIS) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_ANALYSIS, x);} while (0)
# define LOG_I(c, x...) do { if( g_log->log_component[c].level >= OAILOG_INFO ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_INFO, x) ;} while (0) # define T_LOG_I(c, x...) do { if( g_log->log_component[c].level >= OAILOG_INFO ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_INFO, x) ;} while (0)
# define LOG_D(c, x...) do { if( g_log->log_component[c].level >= OAILOG_DEBUG ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_DEBUG, x) ;} while (0) # define T_LOG_D(c, x...) do { if( g_log->log_component[c].level >= OAILOG_DEBUG ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_DEBUG, x) ;} while (0)
# define LOG_T(c, x...) do { if( g_log->log_component[c].level >= OAILOG_TRACE ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_TRACE, x) ;} while (0) # define T_LOG_T(c, x...) do { if( g_log->log_component[c].level >= OAILOG_TRACE ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_TRACE, x) ;} while (0)
# define VLOG(c,l, f, args) do { if( g_log->log_component[c].level >= l ) vlogRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, l, f, args) ; } while (0) # define VLOG(c,l, f, args) do { if( g_log->log_component[c].level >= l ) vlogRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, l, f, args) ; } while (0)
# define nfapi_log(FILE, FNC, LN, COMP, LVL, FMT...) # define nfapi_log(FILE, FNC, LN, COMP, LVL, FMT...)
...@@ -456,6 +457,37 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int ...@@ -456,6 +457,37 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int
# define T_ACTIVE(a) (0) # define T_ACTIVE(a) (0)
# endif /* T_TRACER */ # endif /* T_TRACER */
# define LOG_E(c, x...) do { \
T_LOG_E(c, x); \
if(g_log->log_component[c].level >= OAILOG_ERR) { \
logRecord_tp(__FILE__, __FUNCTION__, __LINE__, c, OAILOG_ERR, x); \
} } while(0)
# define LOG_W(c, x...) do { \
T_LOG_W(c, x); \
if(g_log->log_component[c].level >= OAILOG_WARNING) { \
logRecord_tp(__FILE__, __FUNCTION__, __LINE__, c, OAILOG_WARNING, x); \
} } while(0)
# define LOG_A(c, x...) do { \
T_LOG_A(c, x); \
if(g_log->log_component[c].level >= OAILOG_ANALYSIS) { \
logRecord_tp(__FILE__, __FUNCTION__, __LINE__, c, OAILOG_ANALYSIS, x);\
} } while(0)
# define LOG_I(c, x...) do { \
T_LOG_I(c, x); \
if(g_log->log_component[c].level >= OAILOG_INFO) { \
logRecord_tp(__FILE__, __FUNCTION__, __LINE__, c, OAILOG_INFO, x); \
} } while(0)
# define LOG_D(c, x...) do { \
T_LOG_D(c, x); \
if(g_log->log_component[c].level >= OAILOG_DEBUG) { \
logRecord_tp(__FILE__, __FUNCTION__, __LINE__, c, OAILOG_DEBUG, x); \
} } while(0)
# define LOG_T(c, x...) do { \
T_LOG_T(c, x); \
if(g_log->log_component[c].level >= OAILOG_TRACE) { \
logRecord_tp(__FILE__, __FUNCTION__, __LINE__, c, OAILOG_TRACE, x); \
} } while(0)
/* avoid warnings for variables only used in LOG macro's but set outside debug section */ /* avoid warnings for variables only used in LOG macro's but set outside debug section */
#define GCC_NOTUSED __attribute__((unused)) #define GCC_NOTUSED __attribute__((unused))
#define LOG_USEDINLOG_VAR(A,B) GCC_NOTUSED A B #define LOG_USEDINLOG_VAR(A,B) GCC_NOTUSED A B
......
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
__func__, __LINE__, buf); \ __func__, __LINE__, buf); \
} } while (0) } } while (0)
#define LOG_SS(component, log) tracepoint(SSeNB, SS_LOG, \ #define LOG_SS(component, log) tracepoint(SSeNB, SS_LOG, \
#component, -1, g_log->sfn, \ component, -1, g_log->sfn, \
g_log->sf, __func__, __LINE__,\ g_log->sf, __func__, __LINE__,\
log) log)
#define LOG_P(component, _string, buf, len) tracepoint(SSeNB, SS_PKT, \ #define LOG_P(component, _string, buf, len) tracepoint(SSeNB, SS_PKT, \
......
...@@ -2146,6 +2146,7 @@ uint8_t do_SIB23(uint8_t Mod_id, ...@@ -2146,6 +2146,7 @@ uint8_t do_SIB23(uint8_t Mod_id,
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n", AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n",
enc_rval.failed_type->name, enc_rval.encoded); enc_rval.failed_type->name, enc_rval.encoded);
LOG_D(RRC,"[eNB] SystemInformation Encoded %zd bits (%zd bytes)\n",enc_rval.encoded,(enc_rval.encoded+7)/8); LOG_D(RRC,"[eNB] SystemInformation Encoded %zd bits (%zd bytes)\n",enc_rval.encoded,(enc_rval.encoded+7)/8);
LOG_P(RRC, "BCCH_DL_SCH_Message", (uint8_t *)buffer, 900);
if (enc_rval.encoded==-1) { if (enc_rval.encoded==-1) {
msg("[RRC] ASN1 : SI encoding failed for SIB23\n"); msg("[RRC] ASN1 : SI encoding failed for SIB23\n");
......
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