very big merge with merged develop, basic test done
This commit is contained in:
+92
-33
@@ -43,6 +43,7 @@
|
||||
#include <string.h>
|
||||
#include <linux/prctl.h>
|
||||
#include "common/config/config_userapi.h"
|
||||
|
||||
// main log variables
|
||||
|
||||
log_mem_cnt_t log_mem_d[2];
|
||||
@@ -59,7 +60,6 @@ char __log_mem_filename[1024]={0};
|
||||
char * log_mem_filename = &__log_mem_filename[0];
|
||||
char logmem_filename[1024] = {0};
|
||||
|
||||
|
||||
mapping log_level_names[] = {
|
||||
{"error", OAILOG_ERR},
|
||||
{"warn", OAILOG_WARNING},
|
||||
@@ -83,7 +83,13 @@ char *log_level_highlight_start[] = {LOG_RED, LOG_ORANGE, "", LOG_BLUE, LOG_CYBL
|
||||
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) {
|
||||
int write_file_matlab(const char *fname,
|
||||
const char *vname,
|
||||
void *data,
|
||||
int length,
|
||||
int dec,
|
||||
char format)
|
||||
{
|
||||
FILE *fp=NULL;
|
||||
int i;
|
||||
|
||||
@@ -223,9 +229,10 @@ 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) {
|
||||
void log_getconfig(log_t *g_log)
|
||||
{
|
||||
char *gloglevel = NULL;
|
||||
int consolelog ;
|
||||
int consolelog = 0;
|
||||
paramdef_t logparams_defaults[] = LOG_GLOBALPARAMS_DESC;
|
||||
paramdef_t logparams_level[MAX_LOG_PREDEF_COMPONENTS];
|
||||
paramdef_t logparams_logfile[MAX_LOG_PREDEF_COMPONENTS];
|
||||
@@ -317,7 +324,9 @@ void log_getconfig(log_t *g_log) {
|
||||
|
||||
config_get( logparams_debug,(sizeof(log_maskmap)/sizeof(mapping)) - 1,CONFIG_STRING_LOG_PREFIX);
|
||||
config_get( logparams_dump,(sizeof(log_maskmap)/sizeof(mapping)) - 1,CONFIG_STRING_LOG_PREFIX);
|
||||
config_check_unknown_cmdlineopt(CONFIG_STRING_LOG_PREFIX);
|
||||
|
||||
if (config_check_unknown_cmdlineopt(CONFIG_STRING_LOG_PREFIX) > 0)
|
||||
exit(1);
|
||||
|
||||
/* set the debug mask according to the debug parameters values */
|
||||
for (int i=0; log_maskmap[i].name != NULL ; i++) {
|
||||
@@ -332,7 +341,10 @@ void log_getconfig(log_t *g_log) {
|
||||
set_glog_onlinelog(consolelog);
|
||||
}
|
||||
|
||||
int register_log_component(char *name, char *fext, int compidx) {
|
||||
int register_log_component(char *name,
|
||||
char *fext,
|
||||
int compidx)
|
||||
{
|
||||
int computed_compidx=compidx;
|
||||
|
||||
if (strlen(fext) > 3) {
|
||||
@@ -355,13 +367,14 @@ int register_log_component(char *name, char *fext, int compidx) {
|
||||
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);
|
||||
fprintf(stderr,"{LOG} %s %d Couldn't register component %s\n",__FILE__,__LINE__,name);
|
||||
}
|
||||
|
||||
return computed_compidx;
|
||||
}
|
||||
|
||||
int isLogInitDone (void) {
|
||||
int isLogInitDone (void)
|
||||
{
|
||||
if (g_log == NULL)
|
||||
return 0;
|
||||
|
||||
@@ -371,7 +384,8 @@ int isLogInitDone (void) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
int logInit (void) {
|
||||
int logInit (void)
|
||||
{
|
||||
int i;
|
||||
g_log = calloc(1, sizeof(log_t));
|
||||
|
||||
@@ -409,25 +423,28 @@ int logInit (void) {
|
||||
register_log_component("FLEXRAN_AGENT","log",FLEXRAN_AGENT);
|
||||
register_log_component("PROTO_AGENT","log",PROTO_AGENT);
|
||||
register_log_component("TMR","",TMR);
|
||||
register_log_component("EMU","log",EMU);
|
||||
register_log_component("USIM","txt",USIM);
|
||||
register_log_component("SIM","txt",SIM);
|
||||
/* following log component are used for the localization*/
|
||||
/* following log component are used for the localization*/
|
||||
register_log_component("LOCALIZE","log",LOCALIZE);
|
||||
register_log_component("NAS","log",NAS);
|
||||
register_log_component("UDP","",UDP_);
|
||||
register_log_component("GTPV1U","",GTPU);
|
||||
register_log_component("S1AP","",S1AP);
|
||||
register_log_component("F1AP","",F1AP);
|
||||
register_log_component("X2AP","",X2AP);
|
||||
register_log_component("M2AP","",M2AP);
|
||||
register_log_component("M3AP","",M3AP);
|
||||
register_log_component("SCTP","",SCTP);
|
||||
register_log_component("X2AP","",X2AP);
|
||||
register_log_component("LOADER","log",LOADER);
|
||||
register_log_component("ASN","log",ASN);
|
||||
register_log_component("NFAPI_PNF","log",NFAPI_PNF);
|
||||
register_log_component("NFAPI_VNF","log",NFAPI_VNF);
|
||||
register_log_component("NFAPI_PNF","log",NFAPI_PNF);
|
||||
register_log_component("GNB_APP","log",GNB_APP);
|
||||
register_log_component("NR_RRC","log",NR_RRC);
|
||||
register_log_component("NR_MAC","log",NR_MAC);
|
||||
register_log_component("NR_PHY","log",NR_PHY);
|
||||
|
||||
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
|
||||
@@ -446,7 +463,9 @@ int logInit (void) {
|
||||
}
|
||||
|
||||
|
||||
char *log_getthreadname(char *threadname, int bufsize) {
|
||||
char *log_getthreadname(char *threadname,
|
||||
int bufsize)
|
||||
{
|
||||
int rt = pthread_getname_np(pthread_self(), threadname,bufsize) ;
|
||||
|
||||
if (rt == 0) {
|
||||
@@ -456,7 +475,12 @@ char *log_getthreadname(char *threadname, int bufsize) {
|
||||
}
|
||||
}
|
||||
|
||||
static int log_header(char *log_buffer, int buffsize, int comp, int level,const char *format) {
|
||||
static int 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],
|
||||
@@ -468,20 +492,35 @@ static int log_header(char *log_buffer, int buffsize, int comp, int level,const
|
||||
log_level_highlight_end[level]);
|
||||
}
|
||||
|
||||
void logRecord_mt(const char *file, const char *func, int line, int comp, int level, const char *format, ... ) {
|
||||
char log_buffer[MAX_LOG_TOTAL];
|
||||
void logRecord_mt(const char *file,
|
||||
const char *func,
|
||||
int line,
|
||||
int comp,
|
||||
int level,
|
||||
const char *format,
|
||||
... )
|
||||
{
|
||||
char log_buffer[MAX_LOG_TOTAL]= {0};
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
va_start(args,format);
|
||||
if (log_mem_flag == 1) {
|
||||
log_output_memory(file,func,line,comp,level, format,args);
|
||||
log_output_memory(file,func,line,comp,level,format,args);
|
||||
} else {
|
||||
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);
|
||||
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);
|
||||
fflush(g_log->log_component[comp].stream);
|
||||
}
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
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 )
|
||||
{
|
||||
char log_buffer[MAX_LOG_TOTAL];
|
||||
if (log_mem_flag == 1) {
|
||||
log_output_memory(file,func,line,comp,level, format,args);
|
||||
@@ -491,7 +530,13 @@ void vlogRecord_mt(const char *file, const char *func, int line, int comp, int l
|
||||
}
|
||||
}
|
||||
|
||||
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,
|
||||
... )
|
||||
{
|
||||
va_list args;
|
||||
char *wbuf;
|
||||
|
||||
@@ -532,7 +577,9 @@ void log_dump(int component, void *buffer, int buffsize,int datatype, const char
|
||||
}
|
||||
}
|
||||
|
||||
int set_log(int component, int level) {
|
||||
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);
|
||||
@@ -548,13 +595,15 @@ int set_log(int component, int level) {
|
||||
|
||||
|
||||
|
||||
void set_glog(int level) {
|
||||
void set_glog(int level)
|
||||
{
|
||||
for (int c=0; c< MAX_LOG_COMPONENTS; c++ ) {
|
||||
set_log(c, level);
|
||||
}
|
||||
}
|
||||
|
||||
void set_glog_onlinelog(int enable) {
|
||||
void set_glog_onlinelog(int enable)
|
||||
{
|
||||
for (int c=0; c< MAX_LOG_COMPONENTS; c++ ) {
|
||||
if ( enable ) {
|
||||
g_log->log_component[c].level = g_log->log_component[c].savedlevel;
|
||||
@@ -566,7 +615,8 @@ void set_glog_onlinelog(int enable) {
|
||||
}
|
||||
}
|
||||
}
|
||||
void set_glog_filelog(int enable) {
|
||||
void set_glog_filelog(int enable)
|
||||
{
|
||||
static FILE *fptr;
|
||||
|
||||
if ( enable ) {
|
||||
@@ -590,7 +640,8 @@ void set_glog_filelog(int enable) {
|
||||
}
|
||||
}
|
||||
|
||||
void set_component_filelog(int comp) {
|
||||
void set_component_filelog(int comp)
|
||||
{
|
||||
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");
|
||||
}
|
||||
@@ -599,7 +650,8 @@ void set_component_filelog(int comp) {
|
||||
g_log->log_component[comp].print = fprintf;
|
||||
g_log->log_component[comp].filelog = 1;
|
||||
}
|
||||
void close_component_filelog(int comp) {
|
||||
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 ) {
|
||||
@@ -616,7 +668,9 @@ void close_component_filelog(int comp) {
|
||||
* with string value NULL
|
||||
*/
|
||||
/* map a string to an int. Takes a mapping array and a string as arg */
|
||||
int map_str_to_int(mapping *map, const char *str) {
|
||||
int map_str_to_int(mapping *map,
|
||||
const char *str)
|
||||
{
|
||||
while (1) {
|
||||
if (map->name == NULL) {
|
||||
return(-1);
|
||||
@@ -631,7 +685,9 @@ int map_str_to_int(mapping *map, const char *str) {
|
||||
}
|
||||
|
||||
/* map an int to a string. Takes a mapping array and a value */
|
||||
char *map_int_to_str(mapping *map, int val) {
|
||||
char *map_int_to_str(mapping *map,
|
||||
int val)
|
||||
{
|
||||
while (1) {
|
||||
if (map->name == NULL) {
|
||||
return NULL;
|
||||
@@ -645,7 +701,9 @@ char *map_int_to_str(mapping *map, int val) {
|
||||
}
|
||||
}
|
||||
|
||||
int is_newline( char *str, int size) {
|
||||
int is_newline(char *str,
|
||||
int size)
|
||||
{
|
||||
int i;
|
||||
|
||||
for ( i = 0; i < size; i++ ) {
|
||||
@@ -658,7 +716,8 @@ int is_newline( char *str, int size) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void logClean (void) {
|
||||
void logClean (void)
|
||||
{
|
||||
int i;
|
||||
|
||||
if(isLogInitDone()) {
|
||||
@@ -670,7 +729,7 @@ void logClean (void) {
|
||||
}
|
||||
}
|
||||
|
||||
extern int oai_exit;
|
||||
extern volatile int oai_exit;//extern int oai_exit;
|
||||
void flush_mem_to_file(void)
|
||||
{
|
||||
int fp;
|
||||
|
||||
+47
-28
@@ -25,7 +25,6 @@
|
||||
* \date 2009 - 2014
|
||||
* \version 0.5
|
||||
* @ingroup util
|
||||
|
||||
*/
|
||||
|
||||
#ifndef __LOG_H__
|
||||
@@ -53,6 +52,7 @@
|
||||
#endif
|
||||
#include <pthread.h>
|
||||
#include "T.h"
|
||||
#include <common/utils/utils.h>
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -82,11 +82,11 @@ extern "C" {
|
||||
* @brief LOG defines 9 levels of messages for users. Importance of these levels decrease gradually from 0 to 8
|
||||
* @{*/
|
||||
# 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_ERR 0 /*!< \brief critical error conditions, impact on "must have" functionalities */
|
||||
# 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 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)*/
|
||||
/* @}*/
|
||||
@@ -184,6 +184,7 @@ typedef enum {
|
||||
MIN_LOG_COMPONENTS = 0,
|
||||
PHY = MIN_LOG_COMPONENTS,
|
||||
MAC,
|
||||
EMU,
|
||||
SIM,
|
||||
OCG,
|
||||
OMG,
|
||||
@@ -200,6 +201,7 @@ typedef enum {
|
||||
NAS,
|
||||
PERF,
|
||||
OIP,
|
||||
CLI,
|
||||
MSC,
|
||||
OCM,
|
||||
UDP_,
|
||||
@@ -224,6 +226,10 @@ typedef enum {
|
||||
X2AP,
|
||||
M2AP,
|
||||
M3AP,
|
||||
GNB_APP,
|
||||
NR_RRC,
|
||||
NR_MAC,
|
||||
NR_PHY,
|
||||
LOADER,
|
||||
ASN,
|
||||
NFAPI_VNF,
|
||||
@@ -294,7 +300,7 @@ extern "C" {
|
||||
# include "log_if.h"
|
||||
/*----------------------------------------------------------------------------*/
|
||||
int logInit (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 vlogRecord_mt(const char *file, const char *func, int line, int comp, int level, const char *format, va_list args );
|
||||
void log_dump(int component, void *buffer, int buffsize,int datatype, const char *format, ... );
|
||||
@@ -360,14 +366,14 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int
|
||||
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* LOG globalconfiguration parameters */
|
||||
/* optname help paramflags XXXptr defXXXval type numelt */
|
||||
/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* LOG global configuration parameters */
|
||||
/* optname help paramflags XXXptr defXXXval type numelt */
|
||||
/*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
#define LOG_GLOBALPARAMS_DESC { \
|
||||
{LOG_CONFIG_STRING_GLOBAL_LOG_LEVEL, "Default log level for all componemts\n", 0, strptr:(char **)&gloglevel, defstrval:log_level_names[2].name, TYPE_STRING, 0}, \
|
||||
{LOG_CONFIG_STRING_GLOBAL_LOG_ONLINE, "Default console output option, for all components\n", 0, iptr:&(consolelog), defintval:1, TYPE_INT, 0}, \
|
||||
{LOG_CONFIG_STRING_GLOBAL_LOG_OPTIONS, LOG_CONFIG_HELP_OPTIONS, 0, strlistptr:NULL, defstrlistval:NULL, TYPE_STRINGLIST,0} \
|
||||
{LOG_CONFIG_STRING_GLOBAL_LOG_LEVEL, "Default log level for all componemts\n", 0, strptr:(char **)&gloglevel, defstrval:log_level_names[2].name, TYPE_STRING, 0}, \
|
||||
{LOG_CONFIG_STRING_GLOBAL_LOG_ONLINE, "Default console output option, for all components\n", 0, iptr:&(consolelog), defintval:1, TYPE_INT, 0}, \
|
||||
{LOG_CONFIG_STRING_GLOBAL_LOG_OPTIONS, LOG_CONFIG_HELP_OPTIONS, 0, strlistptr:NULL, defstrlistval:NULL, TYPE_STRINGLIST, 0} \
|
||||
}
|
||||
|
||||
#define LOG_OPTIONS_IDX 2
|
||||
@@ -383,7 +389,7 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int
|
||||
// debugging macros
|
||||
#define LOG_F LOG_I /* because LOG_F was originaly to dump a message or buffer but is also used as a regular level...., to dump use LOG_DUMPMSG */
|
||||
# if T_TRACER
|
||||
/* per component, level dependant 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 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_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)
|
||||
@@ -392,33 +398,33 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int
|
||||
# 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 */
|
||||
# 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) /* */
|
||||
/* bitmask dependant macros, to isolate debugging code */
|
||||
/* bitmask dependent macros, to isolate debugging code */
|
||||
# define LOG_DEBUGFLAG(D) (g_log->debug_mask & D)
|
||||
|
||||
/* bitmask dependant 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_M(file, vector, data, len, dec, format) do { write_file_matlab(file, vector, data, len, dec, format);} while(0)/* */
|
||||
/* define variable only used in LOG macro's */
|
||||
# define LOG_VAR(A,B) A B
|
||||
# else /* T_TRACER: remove all debugging and tracing messages, except errors */
|
||||
# define LOG_I(c, x...) /* */
|
||||
# define LOG_W(c, x...) /* */
|
||||
# define LOG_E(c, x...) /* */
|
||||
# define LOG_D(c, x...) /* */
|
||||
# define LOG_I(c, x...) do {logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_INFO, x) ; } while(0)/* */
|
||||
# define LOG_W(c, x...) do {logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_WARNING, x) ; } while(0)/* */
|
||||
# define LOG_E(c, x...) do {logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_ERR, x) ; } while(0)/* */
|
||||
# define LOG_D(c, x...) do {logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_DEBUG, x) ; } while(0)/* */
|
||||
# define LOG_T(c, x...) /* */
|
||||
|
||||
# define LOG_DUMPMSG(c, b, s, x...) /* */
|
||||
# define nfapi_log(FILE, FNC, LN, COMP, LVL, FMT...)
|
||||
# define LOG_DEBUGFLAG(D) ( 0 )
|
||||
# define LOG_DUMPFLAG(D) ( 0 )
|
||||
# define LOG_M(file, vector, data, len, dec, format)
|
||||
# define LOG_M(file, vector, data, len, dec, format) do { write_file_matlab(file, vector, data, len, dec, format);} while(0)
|
||||
# define LOG_VAR(A,B)
|
||||
# endif /* T_TRACER */
|
||||
/* avoid warnings for variables only used in LOG macro's but set outside debug section */
|
||||
#define GCC_NOTUSED __attribute__((unused))
|
||||
#define LOG_USEDINLOG_VAR(A,B) GCC_NOTUSED A B
|
||||
|
||||
/* unfiltered macros, usefull for simulators or messages at init time, before log is configured */
|
||||
/* unfiltered macros, useful for simulators or messages at init time, before log is configured */
|
||||
#define LOG_UM(file, vector, data, len, dec, format) do { write_file_matlab(file, vector, data, len, dec, format);} while(0)
|
||||
#define LOG_UI(c, x...) do {logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_INFO, x) ; } while(0)
|
||||
#define LOG_UDUMPMSG(c, b, s, f, x...) do { log_dump(c, b, s, f, x) ;} while (0) /* */
|
||||
@@ -448,7 +454,10 @@ static __inline__ uint64_t rdtsc(void) {
|
||||
|
||||
extern double cpuf;
|
||||
|
||||
static inline uint64_t checkTCPU(int timeout, char *file, int line) {
|
||||
static inline uint64_t checkTCPU(int timeout,
|
||||
char *file,
|
||||
int line)
|
||||
{
|
||||
static uint64_t __thread lastCPUTime=0;
|
||||
static uint64_t __thread last=0;
|
||||
uint64_t cur=rdtsc();
|
||||
@@ -470,7 +479,10 @@ static inline uint64_t checkTCPU(int timeout, char *file, int line) {
|
||||
return cur;
|
||||
}
|
||||
|
||||
static inline unsigned long long checkT(int timeout, char *file, int line) {
|
||||
static inline unsigned long long checkT(int timeout,
|
||||
char *file,
|
||||
int line)
|
||||
{
|
||||
static unsigned long long __thread last=0;
|
||||
unsigned long long cur=rdtsc();
|
||||
int microCycles=(int)(cpuf*1000);
|
||||
@@ -490,7 +502,10 @@ typedef struct m {
|
||||
uint64_t maxArray[11];
|
||||
} Meas;
|
||||
|
||||
static inline void printMeas(char *txt, Meas *M, int period) {
|
||||
static inline void printMeas(char *txt,
|
||||
Meas *M,
|
||||
int period)
|
||||
{
|
||||
if (M->iterations%period == 0 ) {
|
||||
char txt2[512];
|
||||
sprintf(txt2,"%s avg=%" PRIu64 " iterations=%" PRIu64 " max=%"
|
||||
@@ -508,13 +523,19 @@ static inline void printMeas(char *txt, Meas *M, int period) {
|
||||
}
|
||||
}
|
||||
|
||||
static inline int cmpint(const void *a, const void *b) {
|
||||
static inline int cmpint(const void *a,
|
||||
const void *b)
|
||||
{
|
||||
uint64_t *aa=(uint64_t *)a;
|
||||
uint64_t *bb=(uint64_t *)b;
|
||||
return (int)(*aa-*bb);
|
||||
}
|
||||
|
||||
static inline void updateTimes(uint64_t start, Meas *M, int period, char *txt) {
|
||||
static inline void updateTimes(uint64_t start,
|
||||
Meas *M,
|
||||
int period,
|
||||
char *txt)
|
||||
{
|
||||
if (start!=0) {
|
||||
uint64_t end=rdtsc();
|
||||
long long diff=(end-start)/(cpuf*1000);
|
||||
@@ -551,5 +572,3 @@ static inline void updateTimes(uint64_t start, Meas *M, int period, char *txt) {
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -76,10 +76,10 @@ const char* eurecomVariablesNames[] = {
|
||||
"frame_number_TX1_RU",
|
||||
"frame_number_RX0_RU",
|
||||
"frame_number_RX1_RU",
|
||||
"subframe_number_TX0_RU",
|
||||
"subframe_number_TX1_RU",
|
||||
"subframe_number_RX0_RU",
|
||||
"subframe_number_RX1_RU",
|
||||
"tti_number_TX0_RU",
|
||||
"tti_number_TX1_RU",
|
||||
"tti_number_RX0_RU",
|
||||
"tti_number_RX1_RU",
|
||||
"subframe_number_if4p5_north_out",
|
||||
"frame_number_if4p5_north_out",
|
||||
"subframe_number_if4p5_north_asynch_in",
|
||||
@@ -238,7 +238,17 @@ const char* eurecomVariablesNames[] = {
|
||||
"ue0_drx_long_cycle",
|
||||
"ue0_drx_retransmission_harq0",
|
||||
"ue0_drx_active_time",
|
||||
"ue0_drx_active_time_condition"
|
||||
"ue0_drx_active_time_condition",
|
||||
/*signal for NR*/
|
||||
"frame_number_TX0_gNB",
|
||||
"frame_number_TX1_gNB",
|
||||
"frame_number_RX0_gNB",
|
||||
"frame_number_RX1_gNB",
|
||||
"slot_number_TX0_gNB",
|
||||
"slot_number_TX1_gNB",
|
||||
"slot_number_RX0_gNB",
|
||||
"slot_number_RX1_gNB",
|
||||
"ru_tx_ofdm_mask"
|
||||
};
|
||||
|
||||
const char* eurecomFunctionsNames[] = {
|
||||
@@ -276,7 +286,7 @@ const char* eurecomFunctionsNames[] = {
|
||||
"do_DL_sig",
|
||||
"do_UL_sig",
|
||||
"UE_trx_read",
|
||||
/* RRH signals */
|
||||
/* RRH signals */
|
||||
"eNB_tx",
|
||||
"eNB_rx",
|
||||
"eNB_trx",
|
||||
@@ -286,7 +296,6 @@ const char* eurecomFunctionsNames[] = {
|
||||
"eNB_proc_sleep",
|
||||
"trx_read_rf",
|
||||
"trx_write_rf",
|
||||
|
||||
/* PHY signals */
|
||||
"ue_synch",
|
||||
"ue_slot_fep",
|
||||
@@ -320,6 +329,13 @@ const char* eurecomFunctionsNames[] = {
|
||||
"phy_procedures_ru_feptx_ofdm7",
|
||||
"phy_procedures_ru_feptx_ofdm8",
|
||||
"phy_procedures_ru_feptx_ofdm9",
|
||||
"phy_procedures_ru_feptx_ofdm10",
|
||||
"phy_procedures_ru_feptx_ofdm11",
|
||||
"phy_procedures_ru_feptx_ofdm12",
|
||||
"phy_procedures_ru_feptx_ofdm13",
|
||||
"phy_procedures_ru_feptx_ofdm14",
|
||||
"phy_procedures_ru_feptx_ofdm15",
|
||||
"phy_procedures_ru_feptx_ofdm16",
|
||||
"phy_procedures_ru_feptx_prec0",
|
||||
"phy_procedures_ru_feptx_prec1",
|
||||
"phy_procedures_ru_feptx_prec2",
|
||||
@@ -335,6 +351,7 @@ const char* eurecomFunctionsNames[] = {
|
||||
"phy_procedures_ue_tx",
|
||||
"phy_procedures_ue_rx",
|
||||
"phy_procedures_ue_tx_ulsch_uespec",
|
||||
"phy_procedures_nr_ue_tx_ulsch_uespec",
|
||||
"phy_procedures_ue_tx_pucch",
|
||||
"phy_procedures_ue_tx_ulsch_common",
|
||||
"phy_procedures_ue_tx_prach",
|
||||
@@ -358,6 +375,11 @@ const char* eurecomFunctionsNames[] = {
|
||||
"dlsch_decoding5",
|
||||
"dlsch_decoding6",
|
||||
"dlsch_decoding7",
|
||||
"dlsch_segmentation",
|
||||
"dlsch_deinterleaving",
|
||||
"dlsch_rate_matching",
|
||||
"dlsch_ldpc",
|
||||
"dlsch_compine_seg",
|
||||
"dlsch_pmch_decoding",
|
||||
"rx_pdcch",
|
||||
"dci_decoding",
|
||||
@@ -386,6 +408,7 @@ const char* eurecomFunctionsNames[] = {
|
||||
"phy_enb_prach_rx",
|
||||
"phy_ru_prach_rx",
|
||||
"phy_enb_pdcch_tx",
|
||||
"phy_enb_common_tx",
|
||||
"phy_enb_rs_tx",
|
||||
"phy_ue_generate_prach",
|
||||
"phy_ue_ulsch_modulation",
|
||||
@@ -400,7 +423,6 @@ const char* eurecomFunctionsNames[] = {
|
||||
"phy_eNB_dlsch_scrambling",
|
||||
"phy_eNB_beam_precoding",
|
||||
"phy_eNB_ofdm_mod_l",
|
||||
|
||||
/* MAC signals */
|
||||
"macxface_macphy_init",
|
||||
"macxface_macphy_exit",
|
||||
@@ -417,7 +439,6 @@ const char* eurecomFunctionsNames[] = {
|
||||
"mac_dlsch_preprocessor",
|
||||
"mac_schedule_dlsch",
|
||||
"mac_fill_dlsch_dci",
|
||||
|
||||
"macxface_out_of_sync_ind",
|
||||
"macxface_ue_decode_si",
|
||||
"macxface_ue_decode_pcch",
|
||||
@@ -429,9 +450,7 @@ const char* eurecomFunctionsNames[] = {
|
||||
"macxface_ue_process_rar",
|
||||
"macxface_ue_scheduler",
|
||||
"macxface_ue_get_sr",
|
||||
|
||||
"ue_send_mch_sdu",
|
||||
|
||||
/*RLC signals */
|
||||
"rlc_data_req",
|
||||
// "rlc_data_ind", // this calls "pdcp_data_ind",
|
||||
@@ -441,7 +460,6 @@ const char* eurecomFunctionsNames[] = {
|
||||
"rlc_um_try_reassembly",
|
||||
"rlc_um_check_timer_dar_time_out",
|
||||
"rlc_um_receive_process_dar",
|
||||
|
||||
/* PDCP signals */
|
||||
"pdcp_run",
|
||||
"pdcp_data_req",
|
||||
@@ -473,7 +491,6 @@ const char* eurecomFunctionsNames[] = {
|
||||
"itti_dump_enqueue_message_malloc",
|
||||
"itti_relay_thread",
|
||||
"test",
|
||||
|
||||
/* IF4/IF5 signals */
|
||||
"send_if4_ru",
|
||||
"send_if4_ru1",
|
||||
@@ -483,10 +500,8 @@ const char* eurecomFunctionsNames[] = {
|
||||
"recv_if4_ru2",
|
||||
"send_if5",
|
||||
"recv_if5",
|
||||
|
||||
"compress_if",
|
||||
"decompress_if",
|
||||
|
||||
"nfapi_subframe",
|
||||
"generate_pcfich",
|
||||
"generate_dci0",
|
||||
@@ -496,7 +511,10 @@ const char* eurecomFunctionsNames[] = {
|
||||
"pdcch_modulation",
|
||||
"pdcch_interleaving",
|
||||
"pdcch_tx",
|
||||
|
||||
/*NR softmodem signal*/
|
||||
"wakeup_txfh",
|
||||
"gNB_thread_rxtx0",
|
||||
"gNB_thread_rxtx1"
|
||||
};
|
||||
|
||||
struct vcd_module_s vcd_modules[] = {
|
||||
@@ -615,6 +633,10 @@ inline static uint32_t vcd_get_write_index(void)
|
||||
return write_index;
|
||||
}
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
int signal_mask(void);
|
||||
#endif
|
||||
|
||||
void *vcd_dumper_thread_rt(void *args)
|
||||
{
|
||||
vcd_queue_user_data_t *data;
|
||||
@@ -623,7 +645,7 @@ void *vcd_dumper_thread_rt(void *args)
|
||||
uint32_t data_ready_wait;
|
||||
|
||||
# if defined(ENABLE_ITTI)
|
||||
signal_mask();
|
||||
return 0; //signal_mask(); //function defined at common/utils/ocp_itti/intertask_interface.cpp
|
||||
# endif
|
||||
|
||||
sched_param.sched_priority = sched_get_priority_min(SCHED_FIFO) + 1;
|
||||
|
||||
@@ -53,10 +53,10 @@ typedef enum {
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX1_RU,
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX0_RU,
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX1_RU,
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_TX0_RU,
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_TX1_RU,
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX0_RU,
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX1_RU,
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_TTI_NUMBER_TX0_RU,
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_TTI_NUMBER_TX1_RU,
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_TTI_NUMBER_RX0_RU,
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_TTI_NUMBER_RX1_RU,
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_IF4P5_NORTH_OUT,
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_IF4P5_NORTH_OUT,
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_IF4P5_NORTH_ASYNCH_IN,
|
||||
@@ -216,6 +216,18 @@ typedef enum {
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_DRX_RETRANSMISSION_HARQ0,
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_DRX_ACTIVE_TIME,
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_DRX_ACTIVE_TIME_CONDITION,
|
||||
/*signal for NR*/
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_GNB,
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX1_GNB,
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX0_GNB,
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX1_GNB,
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_SLOT_NUMBER_TX0_GNB,
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_SLOT_NUMBER_TX1_GNB,
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_SLOT_NUMBER_RX0_GNB,
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_SLOT_NUMBER_RX1_GNB,
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_RU_TX_OFDM_MASK,
|
||||
|
||||
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_END
|
||||
} vcd_signal_dump_variables;
|
||||
|
||||
@@ -298,6 +310,13 @@ typedef enum {
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM7,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM8,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM9,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM10,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM11,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM12,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM13,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM14,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM15,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM16,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC1,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC2,
|
||||
@@ -313,6 +332,7 @@ typedef enum {
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX_ULSCH_UESPEC,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_NR_UE_TX_ULSCH_UESPEC,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX_PUCCH,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX_ULSCH_COMMON,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX_PRACH,
|
||||
@@ -336,6 +356,11 @@ typedef enum {
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_DECODING5,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_DECODING6,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_DECODING7,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_SEGMENTATION,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_DEINTERLEAVING,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_RATE_MATCHING,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_LDPC,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_COMBINE_SEG,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_PMCH_DECODING,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_RX_PDCCH,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_DCI_DECODING,
|
||||
@@ -364,6 +389,7 @@ typedef enum {
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PRACH_RX,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_RU_PRACH_RX,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PDCCH_TX,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_COMMON_TX,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_RS_TX,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GENERATE_PRACH,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ULSCH_MODULATION,
|
||||
@@ -477,6 +503,11 @@ typedef enum {
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_PDCCH_INTERLEAVING,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_PDCCH_TX,
|
||||
|
||||
/*NR softmodem signal*/
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_WAKEUP_TXFH,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_PROC_RXTX0,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_PROC_RXTX1,
|
||||
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_END
|
||||
} vcd_signal_dump_functions;
|
||||
|
||||
@@ -535,12 +566,20 @@ extern int ouput_vcd;
|
||||
|
||||
#include "T.h"
|
||||
|
||||
#define VCD_SIGNAL_DUMPER_INIT(x) /* nothing */
|
||||
#define VCD_SIGNAL_DUMPER_CLOSE() /* nothing */
|
||||
#define VCD_SIGNAL_DUMPER_CREATE_HEADER() /* nothing */
|
||||
#define VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(var, val) T_VCD_VARIABLE(var, val)
|
||||
#define VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(var, val) T_VCD_FUNCTION(var, val)
|
||||
#else
|
||||
|
||||
#define VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(var, val)
|
||||
#define VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(var, val)
|
||||
#else /* T_TRACER */
|
||||
|
||||
#define VCD_SIGNAL_DUMPER_INIT(aRgUmEnT) vcd_signal_dumper_init(aRgUmEnT)
|
||||
#define VCD_SIGNAL_DUMPER_CLOSE() vcd_signal_dumper_close()
|
||||
#define VCD_SIGNAL_DUMPER_CREATE_HEADER() vcd_signal_dumper_create_header()
|
||||
#define VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(vAr1,vAr2) vcd_signal_dumper_dump_variable_by_name(vAr1,vAr2)
|
||||
#define VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(vAr1,vAr2) vcd_signal_dumper_dump_function_by_name(vAr1,vAr2)
|
||||
|
||||
|
||||
#endif /* T_TRACER */
|
||||
|
||||
|
||||
+34
-2
@@ -1,3 +1,35 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*!\file common/utils/T/T_defs.h
|
||||
* \brief
|
||||
* \author
|
||||
* \date
|
||||
* \version
|
||||
* \company EURECOM
|
||||
* \email
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#ifndef _T_defs_H_
|
||||
#define _T_defs_H_
|
||||
|
||||
@@ -41,10 +73,10 @@ typedef struct {
|
||||
} T_cache_t;
|
||||
|
||||
/* number of VCD functions (to be kept up to date! see in T_messages.txt) */
|
||||
#define VCD_NUM_FUNCTIONS (230)
|
||||
#define VCD_NUM_FUNCTIONS (247)
|
||||
|
||||
/* number of VCD variables (to be kept up to date! see in T_messages.txt) */
|
||||
#define VCD_NUM_VARIABLES (177)
|
||||
#define VCD_NUM_VARIABLES (186)
|
||||
|
||||
/* first VCD function (to be kept up to date! see in T_messages.txt) */
|
||||
#define VCD_FIRST_FUNCTION ((uintptr_t)T_VCD_FUNCTION_RT_SLEEP)
|
||||
|
||||
+233
-12
@@ -77,6 +77,10 @@ ID = ENB_PHY_INITIATE_RA_PROCEDURE
|
||||
DESC = eNodeB initiates a random access procedure after detecting enough energy for one of the preambles
|
||||
GROUP = ALL:PHY:ENB:WIRESHARK
|
||||
FORMAT = int,eNB_ID : int,frame : int,subframe : int,preamble : int,energy : int,delay
|
||||
ID = GNB_PHY_DL_TICK
|
||||
DESC = gNodeB downlink tick - one tick per ms at start of downlink processing
|
||||
GROUP = ALL:PHY:GRAPHIC:GNB
|
||||
FORMAT = int,gNB_ID : int,frame : int,subframe
|
||||
ID = ENB_PHY_MIB
|
||||
DESC = MIB data
|
||||
GROUP = ALL:PHY:ENB:WIRESHARK
|
||||
@@ -296,6 +300,27 @@ ID = LEGACY_MAC_TRACE
|
||||
GROUP = ALL:LEGACY_MAC:LEGACY_GROUP_TRACE:LEGACY
|
||||
FORMAT = string,log
|
||||
|
||||
ID = LEGACY_NR_MAC_INFO
|
||||
DESC = NR_MAC legacy logs - info level
|
||||
GROUP = ALL:LEGACY_NR_MAC:LEGACY_GROUP_INFO:LEGACY
|
||||
FORMAT = string,log
|
||||
ID = LEGACY_NR_MAC_ERROR
|
||||
DESC = NR_MAC legacy logs - error level
|
||||
GROUP = ALL:LEGACY_NR_MAC:LEGACY_GROUP_ERROR:LEGACY
|
||||
FORMAT = string,log
|
||||
ID = LEGACY_NR_MAC_WARNING
|
||||
DESC = NR_MAC legacy logs - warning level
|
||||
GROUP = ALL:LEGACY_NR_MAC:LEGACY_GROUP_WARNING:LEGACY
|
||||
FORMAT = string,log
|
||||
ID = LEGACY_NR_MAC_DEBUG
|
||||
DESC = NR_MAC legacy logs - debug level
|
||||
GROUP = ALL:LEGACY_NR_MAC:LEGACY_GROUP_DEBUG:LEGACY
|
||||
FORMAT = string,log
|
||||
ID = LEGACY_NR_MAC_TRACE
|
||||
DESC = NR_MAC legacy logs - trace level
|
||||
GROUP = ALL:LEGACY_NR_MAC:LEGACY_GROUP_TRACE:LEGACY
|
||||
FORMAT = string,log
|
||||
|
||||
ID = LEGACY_PHY_INFO
|
||||
DESC = PHY legacy logs - info level
|
||||
GROUP = ALL:LEGACY_PHY:LEGACY_GROUP_INFO:LEGACY
|
||||
@@ -317,6 +342,27 @@ ID = LEGACY_PHY_TRACE
|
||||
GROUP = ALL:LEGACY_PHY:LEGACY_GROUP_TRACE:LEGACY
|
||||
FORMAT = string,log
|
||||
|
||||
ID = LEGACY_NR_PHY_INFO
|
||||
DESC = NR_PHY legacy logs - info level
|
||||
GROUP = ALL:LEGACY_NR_PHY:LEGACY_GROUP_INFO:LEGACY
|
||||
FORMAT = string,log
|
||||
ID = LEGACY_NR_PHY_ERROR
|
||||
DESC = NR_PHY legacy logs - error level
|
||||
GROUP = ALL:LEGACY_NR_PHY:LEGACY_GROUP_ERROR:LEGACY
|
||||
FORMAT = string,log
|
||||
ID = LEGACY_NR_PHY_WARNING
|
||||
DESC = NR_PHY legacy logs - warning level
|
||||
GROUP = ALL:LEGACY_NR_PHY:LEGACY_GROUP_WARNING:LEGACY
|
||||
FORMAT = string,log
|
||||
ID = LEGACY_NR_PHY_DEBUG
|
||||
DESC = NR_PHY legacy logs - debug level
|
||||
GROUP = ALL:LEGACY_NR_PHY:LEGACY_GROUP_DEBUG:LEGACY
|
||||
FORMAT = string,log
|
||||
ID = LEGACY_NR_PHY_TRACE
|
||||
DESC = NR_PHY legacy logs - trace level
|
||||
GROUP = ALL:LEGACY_NR_PHY:LEGACY_GROUP_TRACE:LEGACY
|
||||
FORMAT = string,log
|
||||
|
||||
ID = LEGACY_S1AP_INFO
|
||||
DESC = S1AP legacy logs - info level
|
||||
GROUP = ALL:LEGACY_S1AP:LEGACY_GROUP_INFO:LEGACY
|
||||
@@ -422,6 +468,27 @@ ID = LEGACY_RRC_TRACE
|
||||
GROUP = ALL:LEGACY_RRC:LEGACY_GROUP_TRACE:LEGACY
|
||||
FORMAT = string,log
|
||||
|
||||
ID = LEGACY_NR_RRC_INFO
|
||||
DESC = NR_RRC legacy logs - info level
|
||||
GROUP = ALL:LEGACY_NR_RRC:LEGACY_GROUP_INFO:LEGACY
|
||||
FORMAT = string,log
|
||||
ID = LEGACY_NR_RRC_ERROR
|
||||
DESC = NR_RRC legacy logs - error level
|
||||
GROUP = ALL:LEGACY_NR_RRC:LEGACY_GROUP_ERROR:LEGACY
|
||||
FORMAT = string,log
|
||||
ID = LEGACY_NR_RRC_WARNING
|
||||
DESC = NR_RRC legacy logs - warning level
|
||||
GROUP = ALL:LEGACY_NR_RRC:LEGACY_GROUP_WARNING:LEGACY
|
||||
FORMAT = string,log
|
||||
ID = LEGACY_NR_RRC_DEBUG
|
||||
DESC = NR_RRC legacy logs - debug level
|
||||
GROUP = ALL:LEGACY_NR_RRC:LEGACY_GROUP_DEBUG:LEGACY
|
||||
FORMAT = string,log
|
||||
ID = LEGACY_NR_RRC_TRACE
|
||||
DESC = NR_RRC legacy logs - trace level
|
||||
GROUP = ALL:LEGACY_NR_RRC:LEGACY_GROUP_TRACE:LEGACY
|
||||
FORMAT = string,log
|
||||
|
||||
ID = LEGACY_RLC_INFO
|
||||
DESC = RLC legacy logs - info level
|
||||
GROUP = ALL:LEGACY_RLC:LEGACY_GROUP_INFO:LEGACY
|
||||
@@ -485,6 +552,26 @@ ID = LEGACY_ENB_APP_TRACE
|
||||
GROUP = ALL:LEGACY_ENB_APP:LEGACY_GROUP_TRACE:LEGACY
|
||||
FORMAT = string,log
|
||||
|
||||
ID = LEGACY_GNB_APP_INFO
|
||||
DESC = GNB_APP legacy logs - info level
|
||||
GROUP = ALL:LEGACY_GNB_APP:LEGACY_GROUP_INFO:LEGACY
|
||||
FORMAT = string,log
|
||||
ID = LEGACY_GNB_APP_ERROR
|
||||
DESC = GNB_APP legacy logs - error level
|
||||
GROUP = ALL:LEGACY_GNB_APP:LEGACY_GROUP_ERROR:LEGACY
|
||||
FORMAT = string,log
|
||||
ID = LEGACY_GNB_APP_WARNING
|
||||
DESC = GNB_APP legacy logs - warning level
|
||||
GROUP = ALL:LEGACY_GNB_APP:LEGACY_GROUP_WARNING:LEGACY
|
||||
FORMAT = string,log
|
||||
ID = LEGACY_GNB_APP_DEBUG
|
||||
DESC = GNB_APP legacy logs - debug level
|
||||
GROUP = ALL:LEGACY_GNB_APP:LEGACY_GROUP_DEBUG:LEGACY
|
||||
FORMAT = string,log
|
||||
ID = LEGACY_GNB_APP_TRACE
|
||||
DESC = GNB_APP legacy logs - trace level
|
||||
GROUP = ALL:LEGACY_GNB_APP:LEGACY_GROUP_TRACE:LEGACY
|
||||
|
||||
ID = LEGACY_MCE_APP_INFO
|
||||
DESC = MCE_APP legacy logs - info level
|
||||
GROUP = ALL:LEGACY_MCE_APP:LEGACY_GROUP_INFO:LEGACY
|
||||
@@ -1189,26 +1276,26 @@ ID = VCD_VARIABLE_FRAME_NUMBER_RX1_RU
|
||||
GROUP = ALL:VCD:ENB:VCD_VARIABLE
|
||||
FORMAT = ulong,value
|
||||
VCD_NAME = frame_number_RX1_RU
|
||||
ID = VCD_VARIABLE_SUBFRAME_NUMBER_TX0_RU
|
||||
DESC = VCD variable SUBFRAME_NUMBER_TX0_RU
|
||||
ID = VCD_VARIABLE_TTI_NUMBER_TX0_RU
|
||||
DESC = VCD variable TTI_NUMBER_TX0_RU
|
||||
GROUP = ALL:VCD:ENB:VCD_VARIABLE
|
||||
FORMAT = ulong,value
|
||||
VCD_NAME = subframe_number_TX0_RU
|
||||
ID = VCD_VARIABLE_SUBFRAME_NUMBER_TX1_RU
|
||||
DESC = VCD variable SUBFRAME_NUMBER_TX1_RU
|
||||
VCD_NAME = tti_number_TX0_RU
|
||||
ID = VCD_VARIABLE_TTI_NUMBER_TX1_RU
|
||||
DESC = VCD variable TTI_NUMBER_TX1_RU
|
||||
GROUP = ALL:VCD:ENB:VCD_VARIABLE
|
||||
FORMAT = ulong,value
|
||||
VCD_NAME = subframe_number_TX1_RU
|
||||
ID = VCD_VARIABLE_SUBFRAME_NUMBER_RX0_RU
|
||||
DESC = VCD variable SUBFRAME_NUMBER_RX0_RU
|
||||
VCD_NAME = tti_number_TX1_RU
|
||||
ID = VCD_VARIABLE_TTI_NUMBER_RX0_RU
|
||||
DESC = VCD variable TTI_NUMBER_RX0_RU
|
||||
GROUP = ALL:VCD:ENB:VCD_VARIABLE
|
||||
FORMAT = ulong,value
|
||||
VCD_NAME = subframe_number_RX0_RU
|
||||
ID = VCD_VARIABLE_SUBFRAME_NUMBER_RX1_RU
|
||||
DESC = VCD variable SUBFRAME_NUMBER_RX1_RU
|
||||
VCD_NAME = tti_number_RX0_RU
|
||||
ID = VCD_VARIABLE_TTI_NUMBER_RX1_RU
|
||||
DESC = VCD variable TTI_NUMBER_RX1_RU
|
||||
GROUP = ALL:VCD:ENB:VCD_VARIABLE
|
||||
FORMAT = ulong,value
|
||||
VCD_NAME = subframe_number_RX1_RU
|
||||
VCD_NAME = tti_number_RX1_RU
|
||||
ID = VCD_VARIABLE_SUBFRAME_NUMBER_IF4P5_NORTH_OUT
|
||||
DESC = VCD variable SUBFRAME_NUMBER_IF4P5_NORTH_OUT
|
||||
GROUP = ALL:VCD:ENB:VCD_VARIABLE
|
||||
@@ -2005,6 +2092,53 @@ ID = VCD_VARIABLE_DRX_ACTIVE_TIME_CONDITION
|
||||
FORMAT = ulong,value
|
||||
VCD_NAME = ue0_drx_active_time_condition
|
||||
|
||||
#variable for gNB
|
||||
ID = VCD_VARIABLE_FRAME_NUMBER_TX0_GNB
|
||||
DESC = VCD variable FRAME_NUMBER_TX0_GNB
|
||||
GROUP = ALL:VCD:ENB:VCD_VARIABLE
|
||||
FORMAT = ulong,value
|
||||
VCD_NAME = frame_number_TX0_gNB
|
||||
ID = VCD_VARIABLE_FRAME_NUMBER_TX1_GNB
|
||||
DESC = VCD variable FRAME_NUMBER_TX1_GNB
|
||||
GROUP = ALL:VCD:ENB:VCD_VARIABLE
|
||||
FORMAT = ulong,value
|
||||
VCD_NAME = frame_number_TX1_gNB
|
||||
ID = VCD_VARIABLE_FRAME_NUMBER_RX0_GNB
|
||||
DESC = VCD variable FRAME_NUMBER_RX0_GNB
|
||||
GROUP = ALL:VCD:ENB:VCD_VARIABLE
|
||||
FORMAT = ulong,value
|
||||
VCD_NAME = frame_number_RX0_gNB
|
||||
ID = VCD_VARIABLE_FRAME_NUMBER_RX1_GNB
|
||||
DESC = VCD variable FRAME_NUMBER_RX1_GNB
|
||||
GROUP = ALL:VCD:ENB:VCD_VARIABLE
|
||||
FORMAT = ulong,value
|
||||
VCD_NAME = frame_number_RX1_gNB
|
||||
ID = VCD_VARIABLE_SLOT_NUMBER_TX0_GNB
|
||||
DESC = VCD variable SLOT_NUMBER_TX0_GNB
|
||||
GROUP = ALL:VCD:ENB:VCD_VARIABLE
|
||||
FORMAT = ulong,value
|
||||
VCD_NAME = slot_number_TX0_gNB
|
||||
ID = VCD_VARIABLE_SLOT_NUMBER_TX1_GNB
|
||||
DESC = VCD variable SLOT_NUMBER_TX1_GNB
|
||||
GROUP = ALL:VCD:ENB:VCD_VARIABLE
|
||||
FORMAT = ulong,value
|
||||
VCD_NAME = slot_number_TX1_gNB
|
||||
ID = VCD_VARIABLE_SLOT_NUMBER_RX0_GNB
|
||||
DESC = VCD variable SLOT_NUMBER_RX0_GNB
|
||||
GROUP = ALL:VCD:ENB:VCD_VARIABLE
|
||||
FORMAT = ulong,value
|
||||
VCD_NAME = slot_number_RX0_gNB
|
||||
ID = VCD_VARIABLE_SLOT_NUMBER_RX1_GNB
|
||||
DESC = VCD variable SLOT_NUMBER_RX1_GNB
|
||||
GROUP = ALL:VCD:ENB:VCD_VARIABLE
|
||||
FORMAT = ulong,value
|
||||
VCD_NAME = slot_number_RX1_gNB
|
||||
ID = VCD_VARIABLE_RU_TX_OFDM_MASK
|
||||
DESC = VCD variable RU_TX_OFDM_MASK
|
||||
GROUP = ALL:VCD:ENB:VCD_VARIABLE
|
||||
FORMAT = ulong,value
|
||||
VCD_NAME = ru_tx_ofdm_mask
|
||||
|
||||
#functions
|
||||
|
||||
ID = VCD_FUNCTION_RT_SLEEP
|
||||
@@ -2372,6 +2506,41 @@ ID = VCD_FUNCTION_PHY_PROCEDURES_RU_FEPTX_OFDM9
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
VCD_NAME = phy_procedures_ru_feptx_ofdm9
|
||||
ID = VCD_FUNCTION_PHY_PROCEDURES_RU_FEPTX_OFDM10
|
||||
DESC = VCD function PHY_PROCEDURES_RU_FEPTX_OFDM10
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
VCD_NAME = phy_procedures_ru_feptx_ofdm10
|
||||
ID = VCD_FUNCTION_PHY_PROCEDURES_RU_FEPTX_OFDM11
|
||||
DESC = VCD function PHY_PROCEDURES_RU_FEPTX_OFDM11
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
VCD_NAME = phy_procedures_ru_feptx_ofdm11
|
||||
ID = VCD_FUNCTION_PHY_PROCEDURES_RU_FEPTX_OFDM12
|
||||
DESC = VCD function PHY_PROCEDURES_RU_FEPTX_OFDM12
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
VCD_NAME = phy_procedures_ru_feptx_ofdm12
|
||||
ID = VCD_FUNCTION_PHY_PROCEDURES_RU_FEPTX_OFDM13
|
||||
DESC = VCD function PHY_PROCEDURES_RU_FEPTX_OFDM13
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
VCD_NAME = phy_procedures_ru_feptx_ofdm13
|
||||
ID = VCD_FUNCTION_PHY_PROCEDURES_RU_FEPTX_OFDM14
|
||||
DESC = VCD function PHY_PROCEDURES_RU_FEPTX_OFDM14
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
VCD_NAME = phy_procedures_ru_feptx_ofdm14
|
||||
ID = VCD_FUNCTION_PHY_PROCEDURES_RU_FEPTX_OFDM15
|
||||
DESC = VCD function PHY_PROCEDURES_RU_FEPTX_OFDM15
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
VCD_NAME = phy_procedures_ru_feptx_ofdm15
|
||||
ID = VCD_FUNCTION_PHY_PROCEDURES_RU_FEPTX_OFDM16
|
||||
DESC = VCD function PHY_PROCEDURES_RU_FEPTX_OFDM16
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
VCD_NAME = phy_procedures_ru_feptx_ofdm16
|
||||
ID = VCD_FUNCTION_PHY_PROCEDURES_RU_FEPTX_PREC
|
||||
DESC = VCD function PHY_PROCEDURES_RU_FEPTX_PREC
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
@@ -2447,6 +2616,11 @@ ID = VCD_FUNCTION_PHY_PROCEDURES_UE_TX_ULSCH_UESPEC
|
||||
GROUP = ALL:VCD:UE:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
VCD_NAME = phy_procedures_ue_tx_ulsch_uespec
|
||||
ID = VCD_FUNCTION_PHY_PROCEDURES_NR_UE_TX_ULSCH_UESPEC
|
||||
DESC = VCD function PHY_PROCEDURES_NR_UE_TX_ULSCH_UESPEC
|
||||
GROUP = ALL:VCD:UE:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
VCD_NAME = phy_procedures_nr_ue_tx_ulsch_uespec
|
||||
ID = VCD_FUNCTION_PHY_PROCEDURES_UE_TX_PUCCH
|
||||
DESC = VCD function PHY_PROCEDURES_UE_TX_PUCCH
|
||||
GROUP = ALL:VCD:UE:VCD_FUNCTION
|
||||
@@ -2562,6 +2736,31 @@ ID = VCD_FUNCTION_DLSCH_DECODING7
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
VCD_NAME = dlsch_decoding7
|
||||
ID = VCD_FUNCTION_DLSCH_SEGMENTATION
|
||||
DESC = VCD function DLSCH_SEGMENTATION
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
VCD_NAME = dlsch_segmentation
|
||||
ID = VCD_FUNCTION_DLSCH_DEINTERLEAVING
|
||||
DESC = VCD function DLSCH_DEINTERLEAVING
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
VCD_NAME = dlsch_deinterleaving
|
||||
ID = VCD_FUNCTION_DLSCH_RATE_MATCHING
|
||||
DESC = VCD function DLSCH_RATE_MATCHING
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
VCD_NAME = dlsch_rate_matching
|
||||
ID = VCD_FUNCTION_DLSCH_LDPC
|
||||
DESC = VCD function DLSCH_LDPC
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
VCD_NAME = dlsch_ldpc
|
||||
ID = VCD_FUNCTION_DLSCH_COMBINE_SEG
|
||||
DESC = VCD function DLSCH_COMBINE_SEG
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
VCD_NAME = dlsch_compine_seg
|
||||
ID = VCD_FUNCTION_DLSCH_PMCH_DECODING
|
||||
DESC = VCD function DLSCH_PMCH_DECODING
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
@@ -2702,6 +2901,11 @@ ID = VCD_FUNCTION_PHY_ENB_PDCCH_TX
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
VCD_NAME = phy_enb_pdcch_tx
|
||||
ID = VCD_FUNCTION_PHY_ENB_COMMON_TX
|
||||
DESC = VCD function PHY_ENB_COMMON_TX
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
VCD_NAME = phy_enb_common_tx
|
||||
ID = VCD_FUNCTION_PHY_ENB_RS_TX
|
||||
DESC = VCD function PHY_ENB_RS_TX
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
@@ -3157,3 +3361,20 @@ ID = VCD_FUNCTION_PDCCH_TX
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
VCD_NAME = pdcch_tx
|
||||
|
||||
#function for gNB
|
||||
ID = VCD_FUNCTION_WAKEUP_TXFH
|
||||
DESC = VCD function WAKEUP_TXFH
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
VCD_NAME = wakeup_txfh
|
||||
ID = VCD_FUNCTION_gNB_PROC_RXTX0
|
||||
DESC = VCD function gNB_PROC_RXTX0
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
VCD_NAME = gNB_thread_rxtx0
|
||||
ID = VCD_FUNCTION_gNB_PROC_RXTX1
|
||||
DESC = VCD function gNB_PROC_RXTX1
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
VCD_NAME = gNB_thread_rxtx1
|
||||
|
||||
@@ -23,9 +23,16 @@
|
||||
|
||||
#ifndef BACKTRACE_H_
|
||||
#define BACKTRACE_H_
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void display_backtrace(void);
|
||||
|
||||
void backtrace_handle_signal(siginfo_t *info);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* BACKTRACE_H_ */
|
||||
|
||||
@@ -162,34 +162,6 @@ hashtable_rc_t hashtable_is_key_exists (const hash_table_t *const hashtblP, cons
|
||||
return HASH_TABLE_KEY_NOT_EXISTS;
|
||||
}
|
||||
//-------------------------------------------------------------------------------------------------------------------------------
|
||||
hashtable_rc_t hashtable_apply_funct_on_elements (hash_table_t *const hashtblP, void functP(hash_key_t keyP, void *dataP, void *parameterP), void *parameterP)
|
||||
//-------------------------------------------------------------------------------------------------------------------------------
|
||||
{
|
||||
hash_node_t *node = NULL;
|
||||
unsigned int i = 0;
|
||||
unsigned int num_elements = 0;
|
||||
|
||||
if (hashtblP == NULL) {
|
||||
return HASH_TABLE_BAD_PARAMETER_HASHTABLE;
|
||||
}
|
||||
|
||||
while ((num_elements < hashtblP->num_elements) && (i < hashtblP->size)) {
|
||||
if (hashtblP->nodes[i] != NULL) {
|
||||
node=hashtblP->nodes[i];
|
||||
|
||||
while(node) {
|
||||
num_elements += 1;
|
||||
functP(node->key, node->data, parameterP);
|
||||
node=node->next;
|
||||
}
|
||||
}
|
||||
|
||||
i += 1;
|
||||
}
|
||||
|
||||
return HASH_TABLE_OK;
|
||||
}
|
||||
//-------------------------------------------------------------------------------------------------------------------------------
|
||||
hashtable_rc_t hashtable_dump_content (const hash_table_t *const hashtblP, char *const buffer_pP, int *const remaining_bytes_in_buffer_pP )
|
||||
//-------------------------------------------------------------------------------------------------------------------------------
|
||||
{
|
||||
@@ -266,7 +238,6 @@ hashtable_rc_t hashtable_insert(hash_table_t *const hashtblP, const hash_key_t k
|
||||
}
|
||||
|
||||
hashtblP->nodes[hash]=node;
|
||||
hashtblP->num_elements += 1;
|
||||
return HASH_TABLE_OK;
|
||||
}
|
||||
//-------------------------------------------------------------------------------------------------------------------------------
|
||||
@@ -295,7 +266,6 @@ hashtable_rc_t hashtable_remove(hash_table_t *const hashtblP, const hash_key_t k
|
||||
}
|
||||
|
||||
free(node);
|
||||
hashtblP->num_elements -= 1;
|
||||
return HASH_TABLE_OK;
|
||||
}
|
||||
|
||||
@@ -335,47 +305,3 @@ hashtable_rc_t hashtable_get(const hash_table_t *const hashtblP, const hash_key_
|
||||
*dataP = NULL;
|
||||
return HASH_TABLE_KEY_NOT_EXISTS;
|
||||
}
|
||||
//-------------------------------------------------------------------------------------------------------------------------------
|
||||
/*
|
||||
* Resizing
|
||||
* The number of elements in a hash table is not always known when creating the table.
|
||||
* If the number of elements grows too large, it will seriously reduce the performance of most hash table operations.
|
||||
* If the number of elements are reduced, the hash table will waste memory. That is why we provide a function for resizing the table.
|
||||
* Resizing a hash table is not as easy as a realloc(). All hash values must be recalculated and each element must be inserted into its new position.
|
||||
* We create a temporary hash_table_t object (newtbl) to be used while building the new hashes.
|
||||
* This allows us to reuse hashtable_insert() and hashtable_remove(), when moving the elements to the new table.
|
||||
* After that, we can just free the old table and copy the elements from newtbl to hashtbl.
|
||||
*/
|
||||
|
||||
hashtable_rc_t hashtable_resize(hash_table_t *const hashtblP, const hash_size_t sizeP) {
|
||||
hash_table_t newtbl;
|
||||
hash_size_t n;
|
||||
hash_node_t *node,*next;
|
||||
|
||||
if (hashtblP == NULL) {
|
||||
return HASH_TABLE_BAD_PARAMETER_HASHTABLE;
|
||||
}
|
||||
|
||||
newtbl.size = sizeP;
|
||||
newtbl.hashfunc = hashtblP->hashfunc;
|
||||
newtbl.num_elements = 0;
|
||||
|
||||
if(!(newtbl.nodes=calloc(sizeP, sizeof(hash_node_t *)))) return -1;
|
||||
|
||||
for(n=0; n<hashtblP->size; ++n) {
|
||||
for(node=hashtblP->nodes[n]; node; node=next) {
|
||||
next = node->next;
|
||||
hashtable_insert(&newtbl, node->key, node->data);
|
||||
// Lionel GAUTHIER: BAD CODE TO BE REWRITTEN
|
||||
hashtable_remove(hashtblP, node->key);
|
||||
}
|
||||
}
|
||||
|
||||
free(hashtblP->nodes);
|
||||
hashtblP->size=newtbl.size;
|
||||
hashtblP->nodes=newtbl.nodes;
|
||||
return HASH_TABLE_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -49,7 +49,6 @@ typedef struct hash_node_s {
|
||||
|
||||
typedef struct hash_table_s {
|
||||
hash_size_t size;
|
||||
hash_size_t num_elements;
|
||||
struct hash_node_s **nodes;
|
||||
hash_size_t (*hashfunc)(const hash_key_t);
|
||||
void (*freefunc)(void *);
|
||||
@@ -60,12 +59,10 @@ void hash_free_int_func(void *memoryP);
|
||||
hash_table_t *hashtable_create (const hash_size_t size, hash_size_t (*hashfunc)(const hash_key_t ), void (*freefunc)(void *));
|
||||
hashtable_rc_t hashtable_destroy(hash_table_t **hashtbl);
|
||||
hashtable_rc_t hashtable_is_key_exists (const hash_table_t *const hashtbl, const uint64_t key);
|
||||
hashtable_rc_t hashtable_apply_funct_on_elements (hash_table_t *const hashtblP, void funct(hash_key_t keyP, void *dataP, void *parameterP), void *parameterP);
|
||||
hashtable_rc_t hashtable_dump_content (const hash_table_t *const hashtblP, char *const buffer_pP, int *const remaining_bytes_in_buffer_pP );
|
||||
hashtable_rc_t hashtable_insert (hash_table_t *const hashtbl, const hash_key_t key, void *data);
|
||||
hashtable_rc_t hashtable_remove (hash_table_t *const hashtbl, const hash_key_t key);
|
||||
hashtable_rc_t hashtable_get (const hash_table_t *const hashtbl, const hash_key_t key, void **dataP);
|
||||
hashtable_rc_t hashtable_resize (hash_table_t *const hashtbl, const hash_size_t size);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -8,13 +8,14 @@
|
||||
|
||||
|
||||
#include <intertask_interface.h>
|
||||
#include <common/utils/system.h>
|
||||
|
||||
typedef struct timer_elm_s {
|
||||
timer_type_t type; ///< Timer type
|
||||
long instance;
|
||||
timer_type_t type; ///< Timer type
|
||||
long instance;
|
||||
long duration;
|
||||
uint64_t timeout;
|
||||
void *timer_arg; ///< Optional argument that will be passed when timer expires
|
||||
void *timer_arg; ///< Optional argument that will be passed when timer expires
|
||||
} timer_elm_t ;
|
||||
|
||||
typedef struct task_list_s {
|
||||
@@ -263,7 +264,8 @@ extern "C" {
|
||||
pthread_mutex_unlock (&t->queue_cond_lock);
|
||||
}
|
||||
|
||||
void itti_poll_msg(task_id_t task_id, MessageDef **received_msg) {
|
||||
void itti_poll_msg(task_id_t task_id, MessageDef **received_msg)
|
||||
{
|
||||
//reception of one message, non-blocking
|
||||
task_list_t *t=&tasks[task_id];
|
||||
pthread_mutex_lock(&t->queue_cond_lock);
|
||||
@@ -278,24 +280,13 @@ extern "C" {
|
||||
pthread_mutex_unlock (&t->queue_cond_lock);
|
||||
}
|
||||
|
||||
int itti_create_task(task_id_t task_id, void *(*start_routine)(void *), void *args_p) {
|
||||
int itti_create_task(task_id_t task_id,
|
||||
void *(*start_routine)(void *),
|
||||
void *args_p)
|
||||
{
|
||||
task_list_t *t=&tasks[task_id];
|
||||
AssertFatal ( pthread_create (&t->thread, NULL, start_routine, args_p) ==0,
|
||||
"Thread creation for task %d failed!\n", task_id);
|
||||
pthread_setname_np( t->thread, itti_get_task_name(task_id) );
|
||||
threadCreate (&t->thread, start_routine, args_p, (char*)itti_get_task_name(task_id),-1,OAI_PRIORITY_RT);
|
||||
LOG_I(TMR,"Created Posix thread %s\n", itti_get_task_name(task_id) );
|
||||
#if 1 // BMC test RT prio
|
||||
{
|
||||
int policy;
|
||||
struct sched_param sparam;
|
||||
memset(&sparam, 0, sizeof(sparam));
|
||||
sparam.sched_priority = sched_get_priority_max(SCHED_FIFO)-10;
|
||||
policy = SCHED_FIFO ;
|
||||
if (pthread_setschedparam(t->thread, policy, &sparam) != 0) {
|
||||
LOG_E(TMR,"task %s : Failed to set pthread priority\n", itti_get_task_name(task_id) );
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -303,14 +294,19 @@ extern "C" {
|
||||
pthread_exit (NULL);
|
||||
}
|
||||
|
||||
void itti_terminate_tasks(task_id_t task_id) {
|
||||
void itti_terminate_tasks(task_id_t task_id)
|
||||
{
|
||||
// Sends Terminate signals to all tasks.
|
||||
itti_send_terminate_message (task_id);
|
||||
usleep(100*1000); // Allow the tasks to receive the message before going returning to main thread
|
||||
}
|
||||
|
||||
int itti_init(task_id_t task_max, thread_id_t thread_max, MessagesIds messages_id_max, const task_info_t *tasks_info,
|
||||
const message_info_t *messages_info) {
|
||||
int itti_init(task_id_t task_max,
|
||||
thread_id_t thread_max,
|
||||
MessagesIds messages_id_max,
|
||||
const task_info_t *tasks_info,
|
||||
const message_info_t *messages_info)
|
||||
{
|
||||
AssertFatal(TASK_MAX<UINT16_MAX, "Max itti tasks");
|
||||
|
||||
for(int i=0; i<task_max; ++i) {
|
||||
@@ -335,7 +331,8 @@ extern "C" {
|
||||
int32_t instance,
|
||||
timer_type_t type,
|
||||
void *timer_arg,
|
||||
long *timer_id) {
|
||||
long *timer_id)
|
||||
{
|
||||
task_list_t *t=&tasks[task_id];
|
||||
|
||||
do {
|
||||
@@ -369,7 +366,8 @@ extern "C" {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int timer_remove(long timer_id) {
|
||||
int timer_remove(long timer_id)
|
||||
{
|
||||
task_id_t task_id=(task_id_t)(timer_id&0xffff);
|
||||
int ret;
|
||||
pthread_mutex_lock (&tasks[task_id].queue_cond_lock);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
Author: Laurent THOMAS, Open Cells
|
||||
Copyleft: OpenAirInterface software alliance and it's licence
|
||||
Copyleft: OpenAirInterface software alliance and it's license
|
||||
*/
|
||||
#ifndef INTERTASK_INTERFACE_H_
|
||||
#define INTERTASK_INTERFACE_H_
|
||||
@@ -25,7 +25,7 @@ typedef struct {
|
||||
typedef struct {
|
||||
uint32_t interval_sec;
|
||||
uint32_t interval_us;
|
||||
long task_id;
|
||||
long task_id;
|
||||
int32_t instance;
|
||||
timer_type_t type;
|
||||
void *timer_arg;
|
||||
@@ -33,7 +33,7 @@ typedef struct {
|
||||
} timer_create_t;
|
||||
|
||||
typedef struct {
|
||||
long task_id;
|
||||
long task_id;
|
||||
long timer_id;
|
||||
} timer_delete_t;
|
||||
|
||||
@@ -289,6 +289,7 @@ typedef struct {
|
||||
TASK_DEF(TASK_DATA_FORWARDING, TASK_PRIORITY_MED, 200, NULL, NULL) \
|
||||
TASK_DEF(TASK_END_MARKER, TASK_PRIORITY_MED, 200, NULL, NULL) \
|
||||
TASK_DEF(TASK_RRC_ENB, TASK_PRIORITY_MED, 200, rrc_enb_process_itti_msg,NULL)\
|
||||
TASK_DEF(TASK_RRC_GNB, TASK_PRIORITY_MED, 200, NULL,NULL)\
|
||||
TASK_DEF(TASK_RAL_ENB, TASK_PRIORITY_MED, 200, NULL, NULL) \
|
||||
TASK_DEF(TASK_S1AP, TASK_PRIORITY_MED, 200, NULL, NULL) \
|
||||
TASK_DEF(TASK_X2AP, TASK_PRIORITY_MED, 200, NULL, NULL) \
|
||||
@@ -299,6 +300,7 @@ typedef struct {
|
||||
TASK_DEF(TASK_M3AP_MCE, TASK_PRIORITY_MED, 200, NULL, NULL) \
|
||||
TASK_DEF(TASK_SCTP, TASK_PRIORITY_MED, 200, NULL, NULL) \
|
||||
TASK_DEF(TASK_ENB_APP, TASK_PRIORITY_MED, 200, NULL, NULL) \
|
||||
TASK_DEF(TASK_GNB_APP, TASK_PRIORITY_MED, 200, NULL, NULL) \
|
||||
TASK_DEF(TASK_MCE_APP, TASK_PRIORITY_MED, 200, NULL, NULL) \
|
||||
TASK_DEF(TASK_MME_APP, TASK_PRIORITY_MED, 200, NULL, NULL) \
|
||||
TASK_DEF(TASK_FLEXRAN_AGENT,TASK_PRIORITY_MED, 200, NULL, NULL) \
|
||||
@@ -413,10 +415,6 @@ typedef struct __attribute__ ((__packed__)) MessageDef_s {
|
||||
|
||||
#define INSTANCE_DEFAULT (UINT16_MAX - 1)
|
||||
|
||||
static inline int64_t clock_difftime_ns(struct timespec start, struct timespec end) {
|
||||
return (int64_t)( end.tv_sec-start.tv_sec) * (int64_t)(1000*1000*1000) + end.tv_nsec-start.tv_nsec;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -548,6 +546,7 @@ int timer_setup(
|
||||
int timer_remove(long timer_id);
|
||||
#define timer_stop timer_remove
|
||||
int signal_handle(int *end);
|
||||
int signal_mask(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -229,7 +229,7 @@ void configure_linux(void) {
|
||||
if ( (latency_target_fd = open("/dev/cpu_dma_latency", O_RDWR)) != -1 ) {
|
||||
ret = write(latency_target_fd, &latency_target_value, sizeof(latency_target_value));
|
||||
if (ret == 0) {
|
||||
printf("# error setting cpu_dma_latency to %d!: %s\n", latency_target_value, strerror(errno));
|
||||
printf("# error setting cpu_dma_latency to %u!: %s\n", latency_target_value, strerror(errno));
|
||||
close(latency_target_fd);
|
||||
latency_target_fd=-1;
|
||||
return;
|
||||
@@ -237,9 +237,9 @@ void configure_linux(void) {
|
||||
}
|
||||
}
|
||||
if (latency_target_fd != -1)
|
||||
LOG_I(HW,"# /dev/cpu_dma_latency set to %dus\n", latency_target_value);
|
||||
LOG_I(HW,"# /dev/cpu_dma_latency set to %u us\n", latency_target_value);
|
||||
else
|
||||
LOG_E(HW,"Can't set /dev/cpu_dma_latency to %dus\n", latency_target_value);
|
||||
LOG_E(HW,"Can't set /dev/cpu_dma_latency to %u us\n", latency_target_value);
|
||||
|
||||
// Set CPU frequency to it's maximum
|
||||
if ( 0 != system("for d in /sys/devices/system/cpu/cpu[0-9]*; do cat $d/cpufreq/cpuinfo_max_freq > $d/cpufreq/scaling_min_freq; done"))
|
||||
|
||||
@@ -8,7 +8,7 @@ By default the embedded telnet server, which is implemented in a shared library,
|
||||
./build_oai --build-lib telnetsrv
|
||||
```
|
||||
|
||||
This will create the `libtelnetsrv.so` file in the `targets/bin` and `cmake_targets/lte_build_oai/build` sub directories of the oai repository.
|
||||
This will create the `libtelnetsrv.so` file in the `targets/bin` and `cmake_targets/ran_build/build` sub directories of the oai repository.
|
||||
|
||||
When starting the softmodem, you must specify the **_\-\-telnetsrv_** option to load and start the telnet server. The telnet server is loaded via the [oai shared library loader](loader).
|
||||
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
|
||||
|
||||
set(TELNETROOT ${OPENAIR_DIR}/common/utils/telnetsrv )
|
||||
|
||||
|
||||
|
||||
set(TELNETSRV_SOURCE
|
||||
${TELNETROOT}/telnetsrv.c
|
||||
${TELNETROOT}/telnetsrv_phycmd.c
|
||||
@@ -16,14 +12,12 @@ set(TELNETSRV_SOURCE
|
||||
# ${APPROOT}/telnetsrv/telnetsrv_ethdevcmd.c
|
||||
# )
|
||||
|
||||
|
||||
|
||||
add_library(telnetsrv MODULE ${TELNETSRV_SOURCE} )
|
||||
#add_library(telnetsrv_ethdevcmd MODULE ${TELNETSRV_ETHDEVCMD_SOURCE} )
|
||||
target_link_libraries(telnetsrv PRIVATE history)
|
||||
|
||||
install(TARGETS telnetsrv DESTINATION bin)
|
||||
|
||||
if (EXISTS "${OPENAIR_BUILD_DIR}/lte_build_oai/build" AND IS_DIRECTORY "${OPENAIR_BUILD_DIR}/lte_build_oai/build")
|
||||
install(TARGETS telnetsrv DESTINATION ${OPENAIR_BUILD_DIR}/lte_build_oai/build)
|
||||
endif (EXISTS "${OPENAIR_BUILD_DIR}/lte_build_oai/build" AND IS_DIRECTORY "${OPENAIR_BUILD_DIR}/lte_build_oai/build")
|
||||
if (EXISTS "${OPENAIR_BUILD_DIR}/ran_build/build" AND IS_DIRECTORY "${OPENAIR_BUILD_DIR}/ran_build/build")
|
||||
install(TARGETS telnetsrv DESTINATION ${OPENAIR_BUILD_DIR}/ran_build/build)
|
||||
endif (EXISTS "${OPENAIR_BUILD_DIR}/ran_build/build" AND IS_DIRECTORY "${OPENAIR_BUILD_DIR}/ran_build/build")
|
||||
@@ -1,8 +1,13 @@
|
||||
all: measurement_display thread-pool-test
|
||||
all:
|
||||
measurement_display thread-pool-test
|
||||
|
||||
measurement_display: measurement_display.c thread-pool.h
|
||||
gcc measurement_display.c -I /data/openairinterface5g.nr/common/utils/ -I. /data/openairinterface5g.nr/common/utils/backtrace.c -lpthread -D TEST_THREAD_POOL -I../LOG -I../../utils/T -o measurement_display
|
||||
measurement_display:
|
||||
measurement_display.c thread-pool.h
|
||||
gcc measurement_display.c -I $ {OPENAIR_DIR}/ -I $ {OPENAIR_DIR}/common/utils/ -I. $ {OPENAIR_DIR}/common/utils/backtrace.c -lpthread -D TEST_THREAD_POOL -I../LOG -I../../utils/T -o
|
||||
measurement_display
|
||||
|
||||
thread-pool-test: thread-pool.c thread-pool.h
|
||||
gcc -g thread-pool.c -I /data/openairinterface5g.nr/common/utils/ -I. /data/openairinterface5g.nr/common/utils/backtrace.c -lpthread -D TEST_THREAD_POOL -I../LOG -I../../utils/T -o thread-pool-test
|
||||
thread-pool-test:
|
||||
thread-pool.c thread-pool.h
|
||||
gcc -g thread-pool.c -I $ {OPENAIR_DIR}/ -I $ {OPENAIR_DIR}/common/utils/ -I. $ {OPENAIR_DIR}/common/utils/backtrace.c -I $ {OPENAIR_DIR}/openair2/COMMON $ {OPENAIR_DIR}/common/utils/LOG/log.c $ {OPENAIR_DIR}/common/config/config_userapi.c
|
||||
$ {OPENAIR_DIR}/common/config/config_load_configmodule.c $ {OPENAIR_DIR}/common/config/config_cmdline.c -lpthread -ldl -D TEST_THREAD_POOL -I../LOG -I../../utils/T -o thread-pool-test
|
||||
|
||||
|
||||
@@ -2,22 +2,8 @@
|
||||
Author: Laurent THOMAS, Open Cells
|
||||
copyleft: OpenAirInterface Software Alliance and it's licence
|
||||
*/
|
||||
#include <common/utils/simple_executable.h>
|
||||
|
||||
#define __USE_GNU
|
||||
#define _GNU_SOURCE
|
||||
#include <stdio.h>
|
||||
#include <pthread.h>
|
||||
#include <sched.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/syscall.h>
|
||||
#include <sys/time.h>
|
||||
#include <stdint.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include "thread-pool.h"
|
||||
|
||||
#define SEP "\t"
|
||||
@@ -26,7 +12,7 @@ uint64_t cpuCyclesMicroSec;
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
if(argc != 2) {
|
||||
printf("Need one paramter: the trace Linux pipe (fifo)");
|
||||
printf("Need one parameter: the trace Linux pipe (fifo)");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
@@ -220,8 +220,10 @@ static inline notifiedFIFO_elt_t *pullTpool(notifiedFIFO_t *responseFifo, tpool_
|
||||
|
||||
if (t->measurePerf)
|
||||
msg->returnTime=rdtsc();
|
||||
|
||||
if (t->traceFd >= 0)
|
||||
if(write(t->traceFd, msg, sizeof(*msg)));
|
||||
|
||||
return msg;
|
||||
}
|
||||
|
||||
@@ -233,8 +235,10 @@ static inline notifiedFIFO_elt_t *tryPullTpool(notifiedFIFO_t *responseFifo, tpo
|
||||
|
||||
if (t->measurePerf)
|
||||
msg->returnTime=rdtsc();
|
||||
|
||||
if (t->traceFd)
|
||||
if(write(t->traceFd, msg, sizeof(*msg)));
|
||||
|
||||
return msg;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,69 +3,90 @@
|
||||
The thread pool is a working server, made of a set of worker threads that can be mapped on CPU cores.
|
||||
|
||||
Each worker loop on pick from the same input queue jobs to do.
|
||||
|
||||
When a job is done, the worker sends a return if a return is defined.
|
||||
|
||||
A selective abort allows to cancel parallel jobs (usage: a client pushed jobs, but from a response of one job, the other linked jobs becomes useless).
|
||||
A selective abort allows to cancel parallel jobs (usage: a client pushed jobs, but from a response of one job, the other linked jobs becomes useless).
|
||||
|
||||
All the thread pool functions are thread safe, nevertheless the working functions are implemented by the thread pool client, so the client has to tackle the parallel execution of his functions called "processingFunc" hereafter.
|
||||
All the thread pool functions are thread safe, nevertheless the working functions are implemented by the thread pool client,
|
||||
so the client has to tackle the parallel execution of his functions called "processingFunc" hereafter.
|
||||
|
||||
## license
|
||||
Author: Laurent Thomas, Open cells project
|
||||
The owner share this piece code to Openairsoftware alliance as per OSA license terms
|
||||
Author:
|
||||
Laurent Thomas, Open cells project
|
||||
The owner share this piece code to Openairsoftware alliance as per OSA license terms
|
||||
|
||||
# jobs
|
||||
|
||||
A job is a message (notifiedFIFO_elt_t):
|
||||
next: internal FIFO chain, do not set it
|
||||
key: a long int that the client can use to identify a message or a group of messages
|
||||
responseFifo: if the client defines a response FIFO, the message will be posted back after processing
|
||||
processingFunc: any funtion (type void processingFunc(void *)) that the worker will launch
|
||||
msgData: the data passed to processingFunc. It can be added automatically, or you can set it to a buffer you are managing
|
||||
malloced: a boolean that enable internal free in these cases: no return Fifo or Abort feature
|
||||
A job is a message (notifiedFIFO_elt_t):
|
||||
next:
|
||||
internal FIFO chain, do not set it
|
||||
key:
|
||||
a long int that the client can use to identify a message or a group of messages
|
||||
responseFifo:
|
||||
if the client defines a response FIFO, the message will be posted back after processing
|
||||
processingFunc:
|
||||
any funtion (type void processingFunc(void *)) that the worker will launch
|
||||
msgData:
|
||||
the data passed to processingFunc. It can be added automatically, or you can set it to a buffer you are managing
|
||||
malloced:
|
||||
a boolean that enable internal free in these cases:
|
||||
no return Fifo or Abort feature
|
||||
|
||||
The job messages can be created with newNotifiedFIFO_elt() and delNotifiedFIFO_elt() or managed by the client.
|
||||
The job messages can be created with newNotifiedFIFO_elt() and delNotifiedFIFO_elt() or managed by the client.
|
||||
|
||||
# Queues of jobs
|
||||
|
||||
Queues are type of: notifiedFIFO_t that must be initialized by init_notifiedFIFO()
|
||||
No delete function is required, the creator has only to free the data of type notifiedFIFO_t
|
||||
Queues are type of:
|
||||
notifiedFIFO_t that must be initialized by init_notifiedFIFO()
|
||||
No delete function is required, the creator has only to free the data of type notifiedFIFO_t
|
||||
|
||||
push_notifiedFIFO() add a job in the queue
|
||||
pull_notifiedFIFO() is blocking, poll_notifiedFIFO() is non blocking
|
||||
push_notifiedFIFO() add a job in the queue
|
||||
pull_notifiedFIFO() is blocking, poll_notifiedFIFO() is non blocking
|
||||
|
||||
abort_notifiedFIFO() allows the customer to delete all waiting jobs that match with the key (see key in jobs definition)
|
||||
abort_notifiedFIFO() allows the customer to delete all waiting jobs that match with the key (see key in jobs definition)
|
||||
|
||||
# Thread pools
|
||||
|
||||
## initialization
|
||||
The clients can create one or more thread pools with init_tpool()
|
||||
the params string structure: describes a list of cores, separated by "," that run a worker thread
|
||||
The clients can create one or more thread pools with init_tpool()
|
||||
the params string structure:
|
||||
describes a list of cores, separated by "," that run a worker thread
|
||||
|
||||
If the core exists on the CPU, the thread pool initialization sets the affinity between this thread and the related code (use negative values is allowed, so the thread will never be mapped on a specific core).
|
||||
If the core exists on the CPU, the thread pool initialization sets the affinity between this thread and
|
||||
the related code (use negative values is allowed, so the thread will never be mapped on a specific core).
|
||||
|
||||
The threads are all Linux real time scheduler, their name is set automatically is "Tpool_<core id>"
|
||||
The threads are all Linux real time scheduler, their name is set automatically is "Tpool_<core id>"
|
||||
|
||||
## adding jobs
|
||||
The client create their jobs messages as a notifiedFIFO_elt_t, then they push it with pushTpool() (that internally calls push_notifiedFIFO())
|
||||
The client create their jobs messages as a notifiedFIFO_elt_t, then they push it with pushTpool() (that internally calls push_notifiedFIFO())
|
||||
|
||||
If they need a return, they have to create response queues with init_notifiedFIFO() and set this FIFO pointer in the notifiedFIFO_elt_t before pushing the job.
|
||||
If they need a return, they have to create response queues with init_notifiedFIFO() and set this FIFO pointer in the notifiedFIFO_elt_t before pushing the job.
|
||||
|
||||
## abort
|
||||
|
||||
A abort service abortTpool() allows to abort all jobs that match a key (see jobs "key"). When the abort returns, it garanties no job (matching the key) response will be posted on response queues.
|
||||
A abort service abortTpool() allows to abort all jobs that match a key (see jobs "key"). When the abort returns, it garanties no job (matching the key) response will be posted on response queues.
|
||||
|
||||
Nevertheless, jobs already performed before the return of abortTpool() are pushed in the response Fifo queue.
|
||||
Nevertheless, jobs already performed before the return of abortTpool() are pushed in the response Fifo queue.
|
||||
|
||||
## Performance measurements
|
||||
|
||||
A performance measurement is integrated: the pool will automacillay fill timestamps:
|
||||
A performance measurement is integrated:
|
||||
the pool will automacillay fill timestamps:
|
||||
|
||||
* creationTime: time the request is push to the pool;
|
||||
* startProcessingTime: time a worker start to run on the job
|
||||
* endProcessingTime: time the worker finished the job
|
||||
* returnTime: time the client reads the result
|
||||
* creationTime:
|
||||
time the request is push to the pool;
|
||||
|
||||
if you set the environement variable: thread-pool-measurements to a valid file name
|
||||
* startProcessingTime:
|
||||
time a worker start to run on the job
|
||||
* endProcessingTime:
|
||||
time the worker finished the job
|
||||
* returnTime:
|
||||
time the client reads the result
|
||||
|
||||
if you set the environement variable:
|
||||
thread-pool-measurements to a valid file name
|
||||
These measurements will be wrote to this Linux pipe.
|
||||
|
||||
A tool to read the linux fifo and display it in ascii is provided: see the local directory Makefile for this tool and to compile the thread pool unitary tests.
|
||||
A tool to read the linux fifo and display it in ascii is provided:
|
||||
see the local directory Makefile for this tool and to compile the thread pool unitary tests.
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void *calloc_or_fail(size_t size);
|
||||
void *malloc_or_fail(size_t size);
|
||||
@@ -14,4 +17,17 @@ int hex_string_to_hex_value (uint8_t *hex_value, const char *hex_string, int siz
|
||||
|
||||
char *itoa(int i);
|
||||
|
||||
#define findInList(keY, result, list, element_type) {\
|
||||
int i;\
|
||||
for (i=0; i<sizeof(list)/sizeof(element_type) ; i++)\
|
||||
if (list[i].key==keY) {\
|
||||
result=list[i].val;\
|
||||
break;\
|
||||
}\
|
||||
AssertFatal(i < sizeof(list)/sizeof(element_type), "List %s doesn't contain %s\n",#list, #keY); \
|
||||
}
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user