reset for remerging
This commit is contained in:
@@ -38,30 +38,14 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
# ifdef COMPONENT_CLI
|
||||
# ifdef COMPONENT_CLI_IF
|
||||
# define private_cli_if(x) x
|
||||
# define friend_cli_if(x) x
|
||||
# define public_cli_if(x) x
|
||||
# else
|
||||
# define private_cli_if(x)
|
||||
# define friend_cli_if(x) extern x
|
||||
# define public_cli_if(x) extern x
|
||||
# endif
|
||||
# else
|
||||
# define private_cli_if(x)
|
||||
# define friend_cli_if(x)
|
||||
# define public_cli_if(x) extern x
|
||||
# endif
|
||||
|
||||
/** @defgroup _cli_if Interfaces of CLI
|
||||
* @{*/
|
||||
|
||||
|
||||
public_cli_if( void cli_init (void); )
|
||||
public_cli_if( int cli_server_init(cli_handler_t handler); )
|
||||
public_cli_if(void cli_server_cleanup(void);)
|
||||
public_cli_if(void cli_server_recv(const void * data, socklen_t len);)
|
||||
void cli_init (void);
|
||||
int cli_server_init(cli_handler_t handler);
|
||||
void cli_server_cleanup(void);
|
||||
void cli_server_recv(const void * data, socklen_t len);
|
||||
/* @}*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -32,21 +32,6 @@
|
||||
|
||||
#include "types.h"
|
||||
//-----------------------------------------------------------------------------
|
||||
# ifdef list_C
|
||||
# define private_list(x) x
|
||||
# define public_list(x) x
|
||||
# else
|
||||
# define private_list(x)
|
||||
# define public_list(x) extern x
|
||||
# endif
|
||||
# ifdef LIST2_C
|
||||
# define private_list2(x) x
|
||||
# define public_list2(x) x
|
||||
# else
|
||||
# define private_list2(x)
|
||||
# define public_list2(x) extern x
|
||||
# endif
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
typedef struct Job_List_s {
|
||||
Job_elt_t *head;
|
||||
@@ -67,36 +52,36 @@ typedef struct Packet_OTG_List_s {
|
||||
} Packet_OTG_List_t;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
public_list( void job_list_init (Job_List_t*);)
|
||||
public_list( void job_list_free (Job_List_t* listP);)
|
||||
public_list( Job_elt_t* job_list_get_head (Job_List_t*);)
|
||||
public_list( Job_elt_t* job_list_remove_head (Job_List_t* );)
|
||||
public_list( Job_elt_t* job_list_remove_element (Job_elt_t*, Job_List_t*);)
|
||||
public_list( void job_list_add_head (Job_elt_t* , Job_List_t* );)
|
||||
public_list( void job_list_add_tail_eurecom (Job_elt_t* , Job_List_t* );)
|
||||
public_list( void job_list_add_list (Job_List_t* , Job_List_t* );)
|
||||
public_list( void job_list_display (Job_List_t* );)
|
||||
void job_list_init (Job_List_t*);
|
||||
void job_list_free (Job_List_t* listP);
|
||||
Job_elt_t* job_list_get_head (Job_List_t*);
|
||||
Job_elt_t* job_list_remove_head (Job_List_t* );
|
||||
Job_elt_t* job_list_remove_element (Job_elt_t*, Job_List_t*);
|
||||
void job_list_add_head (Job_elt_t* , Job_List_t* );
|
||||
void job_list_add_tail_eurecom (Job_elt_t* , Job_List_t* );
|
||||
void job_list_add_list (Job_List_t* , Job_List_t* );
|
||||
void job_list_display (Job_List_t* );
|
||||
|
||||
public_list( void event_list_init (Event_List_t*);)
|
||||
public_list( void event_list_free (Event_List_t* listP);)
|
||||
public_list( Event_elt_t* event_list_get_head (Event_List_t*);)
|
||||
public_list( Event_elt_t* event_list_remove_head (Event_List_t* );)
|
||||
public_list( Event_elt_t* event_list_remove_element (Event_elt_t*, Event_List_t*);)
|
||||
public_list( void event_list_add_head (Event_elt_t* , Event_List_t* );)
|
||||
public_list( void event_list_add_element (Event_elt_t* , Event_elt_t* , Event_List_t* );)
|
||||
public_list( void event_list_add_tail_eurecom (Event_elt_t* , Event_List_t* );)
|
||||
public_list( void event_list_add_list (Event_List_t* , Event_List_t* );)
|
||||
public_list( void event_list_display (Event_List_t* );)
|
||||
void event_list_init (Event_List_t*);
|
||||
void event_list_free (Event_List_t* listP);
|
||||
Event_elt_t* event_list_get_head (Event_List_t*);
|
||||
Event_elt_t* event_list_remove_head (Event_List_t* );
|
||||
Event_elt_t* event_list_remove_element (Event_elt_t*, Event_List_t*);
|
||||
void event_list_add_head (Event_elt_t* , Event_List_t* );
|
||||
void event_list_add_element (Event_elt_t* , Event_elt_t* , Event_List_t* );
|
||||
void event_list_add_tail_eurecom (Event_elt_t* , Event_List_t* );
|
||||
void event_list_add_list (Event_List_t* , Event_List_t* );
|
||||
void event_list_display (Event_List_t* );
|
||||
|
||||
public_list( void pkt_list_init (Packet_OTG_List_t*);)
|
||||
public_list( void pkt_list_free (Packet_OTG_List_t* listP);)
|
||||
public_list( Packet_otg_elt_t* pkt_list_get_head (Packet_OTG_List_t*);)
|
||||
public_list( Packet_otg_elt_t* pkt_list_remove_head (Packet_OTG_List_t* );)
|
||||
public_list( Packet_otg_elt_t* pkt_list_remove_element (Packet_otg_elt_t*, Packet_OTG_List_t*);)
|
||||
public_list( void pkt_list_add_head (Packet_otg_elt_t* , Packet_OTG_List_t* );)
|
||||
public_list( void pkt_list_add_element (Packet_otg_elt_t* , Packet_otg_elt_t* , Packet_OTG_List_t* );)
|
||||
public_list( void pkt_list_add_tail_eurecom (Packet_otg_elt_t* , Packet_OTG_List_t* );)
|
||||
public_list( void pkt_list_add_list (Packet_OTG_List_t* , Packet_OTG_List_t* );)
|
||||
public_list( void pkt_list_display (Packet_OTG_List_t* );)
|
||||
void pkt_list_init (Packet_OTG_List_t*);
|
||||
void pkt_list_free (Packet_OTG_List_t* listP);
|
||||
Packet_otg_elt_t* pkt_list_get_head (Packet_OTG_List_t*);
|
||||
Packet_otg_elt_t* pkt_list_remove_head (Packet_OTG_List_t* );
|
||||
Packet_otg_elt_t* pkt_list_remove_element (Packet_otg_elt_t*, Packet_OTG_List_t*);
|
||||
void pkt_list_add_head (Packet_otg_elt_t* , Packet_OTG_List_t* );
|
||||
void pkt_list_add_element (Packet_otg_elt_t* , Packet_otg_elt_t* , Packet_OTG_List_t* );
|
||||
void pkt_list_add_tail_eurecom (Packet_otg_elt_t* , Packet_OTG_List_t* );
|
||||
void pkt_list_add_list (Packet_OTG_List_t* , Packet_OTG_List_t* );
|
||||
void pkt_list_display (Packet_OTG_List_t* );
|
||||
|
||||
#endif
|
||||
|
||||
+27
-57
@@ -39,66 +39,36 @@
|
||||
#ifndef __LIST_H__
|
||||
# define __LIST_H__
|
||||
|
||||
# include "UTIL/MEM/mem_block.h"
|
||||
//-----------------------------------------------------------------------------
|
||||
# ifdef LIST_C
|
||||
# define private_list(x) x
|
||||
# define public_list(x) x
|
||||
# else
|
||||
# define private_list(x)
|
||||
# define public_list(x) extern x
|
||||
# endif
|
||||
# ifdef LIST2_C
|
||||
# define private_list2(x) x
|
||||
# define public_list2(x) x
|
||||
# else
|
||||
# define private_list2(x)
|
||||
# define public_list2(x) extern x
|
||||
# endif
|
||||
//-----------------------------------------------------------------------------
|
||||
#include "platform_constants.h"
|
||||
#include<linux/types.h>
|
||||
#include<stdlib.h>
|
||||
#include<sys/queue.h>
|
||||
|
||||
#define LIST_NAME_MAX_CHAR 32
|
||||
#include "UTIL/MEM/mem_block.h"
|
||||
|
||||
|
||||
typedef struct {
|
||||
struct mem_block_t *head;
|
||||
struct mem_block_t *tail;
|
||||
int nb_elements;
|
||||
char name[LIST_NAME_MAX_CHAR];
|
||||
} list2_t;
|
||||
//-----------------------------------------------------------------------------
|
||||
typedef struct {
|
||||
struct mem_block_t *head;
|
||||
struct mem_block_t *tail;
|
||||
int nb_elements;
|
||||
char name[LIST_NAME_MAX_CHAR];
|
||||
} list_t;
|
||||
void list_init (list_t* , char *);
|
||||
void list_free (list_t* listP);
|
||||
mem_block_t* list_get_head (list_t*);
|
||||
mem_block_t* list_remove_head (list_t* );
|
||||
mem_block_t* list_remove_element (mem_block_t*, list_t*);
|
||||
void list_add_head (mem_block_t* , list_t* );
|
||||
void list_add_tail_eurecom (mem_block_t* , list_t* );
|
||||
void list_add_list (list_t* , list_t* );
|
||||
void list_display (list_t* );
|
||||
//-----------------------------------------------------------------------------
|
||||
public_list( void list_init (list_t* , char *);)
|
||||
public_list( void list_free (list_t* listP);)
|
||||
public_list( mem_block_t* list_get_head (list_t*);)
|
||||
public_list( mem_block_t* list_remove_head (list_t* );)
|
||||
public_list( mem_block_t* list_remove_element (mem_block_t*, list_t*);)
|
||||
public_list( void list_add_head (mem_block_t* , list_t* );)
|
||||
public_list( void list_add_tail_eurecom (mem_block_t* , list_t* );)
|
||||
public_list( void list_add_list (list_t* , list_t* );)
|
||||
public_list( void list_display (list_t* );)
|
||||
//-----------------------------------------------------------------------------
|
||||
public_list2( void list2_init (list2_t*, char*);)
|
||||
public_list2( void list2_free (list2_t* );)
|
||||
public_list2( mem_block_t* list2_get_head (list2_t*);)
|
||||
public_list2( mem_block_t* list2_get_tail (list2_t*);)
|
||||
public_list2( mem_block_t* list2_remove_element (mem_block_t* , list2_t* );)
|
||||
public_list2( mem_block_t* list2_remove_head (list2_t* );)
|
||||
public_list2( mem_block_t* list2_remove_tail (list2_t* );)
|
||||
public_list2( void list2_add_head (mem_block_t* , list2_t* );)
|
||||
public_list2( void list2_add_tail (mem_block_t* , list2_t* );)
|
||||
public_list2( void list2_add_list (list2_t* , list2_t* );)
|
||||
public_list2( void list2_display (list2_t* );)
|
||||
void list2_init (list2_t*, char*);
|
||||
void list2_free (list2_t* );
|
||||
mem_block_t* list2_get_head (list2_t*);
|
||||
mem_block_t* list2_get_tail (list2_t*);
|
||||
mem_block_t* list2_remove_element (mem_block_t* , list2_t* );
|
||||
mem_block_t* list2_remove_head (list2_t* );
|
||||
mem_block_t* list2_remove_tail (list2_t* );
|
||||
void list2_add_head (mem_block_t* , list2_t* );
|
||||
void list2_add_tail (mem_block_t* , list2_t* );
|
||||
void list2_add_list (list2_t* , list2_t* );
|
||||
void list2_display (list2_t* );
|
||||
//-----------------------------------------------------------------------------
|
||||
/* The following lists are used for sorting numbers */
|
||||
#ifndef LINUX_LIST
|
||||
@@ -126,11 +96,11 @@ struct list {
|
||||
};
|
||||
#endif
|
||||
//-----------------------------------------------------------------------------
|
||||
public_list2( void push_front (struct list*, double); )
|
||||
public_list2( void initialize (struct list*); )
|
||||
public_list2( void del (struct list*); )
|
||||
public_list2( void totable (double*, struct list*);)
|
||||
public_list2( int compare (const void * a, const void * b);)
|
||||
public_list2( int32_t calculate_median(struct list *loc_list);)
|
||||
void push_front (struct list*, double);
|
||||
void initialize (struct list*);
|
||||
void del (struct list*);
|
||||
void totable (double*, struct list*);
|
||||
int compare (const void * a, const void * b);
|
||||
int32_t calculate_median(struct list *loc_list);
|
||||
|
||||
#endif
|
||||
|
||||
+449
-891
File diff suppressed because it is too large
Load Diff
+53
-43
@@ -92,7 +92,8 @@ extern "C" {
|
||||
# define LOG_DEBUG 7 /*!< \brief debug-level messages */
|
||||
# define LOG_FILE 8 /*!< \brief message sequence chart -level */
|
||||
# define LOG_TRACE 9 /*!< \brief trace-level messages */
|
||||
#define NUM_LOG_LEVEL 10 /*!< \brief the number of message levels users have with LOG */
|
||||
# define LOG_MATLAB 10 /*!< \brief output to matlab file */
|
||||
#define NUM_LOG_LEVEL 11 /*!< \brief the number of message levels users have with LOG */
|
||||
/* @}*/
|
||||
|
||||
|
||||
@@ -150,7 +151,7 @@ typedef enum {
|
||||
MIN_LOG_COMPONENTS = 0,
|
||||
PHY = MIN_LOG_COMPONENTS,
|
||||
MAC,
|
||||
EMU,
|
||||
SIM,
|
||||
OCG,
|
||||
OMG,
|
||||
OPT,
|
||||
@@ -185,10 +186,13 @@ typedef enum {
|
||||
LOCALIZE,
|
||||
RRH,
|
||||
X2AP,
|
||||
MAX_LOG_COMPONENTS,
|
||||
LOADER,
|
||||
MAX_LOG_PREDEF_COMPONENTS,
|
||||
}
|
||||
comp_name_t;
|
||||
|
||||
#define MAX_LOG_DYNALLOC_COMPONENTS 20
|
||||
#define MAX_LOG_COMPONENTS (MAX_LOG_PREDEF_COMPONENTS + MAX_LOG_DYNALLOC_COMPONENTS)
|
||||
//#define msg printf
|
||||
|
||||
typedef struct {
|
||||
@@ -230,6 +234,7 @@ typedef struct {
|
||||
int syslog;
|
||||
int filelog;
|
||||
char* filelog_name;
|
||||
int async; // asynchronous mode, via dedicated log thread + log buffer
|
||||
} log_t;
|
||||
|
||||
typedef struct LOG_params {
|
||||
@@ -253,6 +258,11 @@ typedef enum log_instance_type_e {
|
||||
void log_set_instance_type (log_instance_type_t instance);
|
||||
#endif
|
||||
|
||||
#define LOG_MEM_SIZE 100*1024*1024
|
||||
#define LOG_MEM_FILE "./logmem.log"
|
||||
int logInit_log_mem(void);
|
||||
void output_log_mem(void);
|
||||
|
||||
#ifdef LOG_MAIN
|
||||
log_t *g_log;
|
||||
#else
|
||||
@@ -283,18 +293,28 @@ char *map_int_to_str(mapping *map, int val);
|
||||
void logClean (void);
|
||||
int is_newline( char *str, int size);
|
||||
void *log_thread_function(void * list);
|
||||
|
||||
int register_log_component(char *name, char *fext, int compidx);
|
||||
/** @defgroup _logIt logIt function
|
||||
* @ingroup _macro
|
||||
* @brief Macro used to call tr_log_full_ex with file, function and line information
|
||||
* @{*/
|
||||
#ifdef LOG_NO_THREAD
|
||||
|
||||
#define logIt(component, level, format, args...) (g_log->log_component[component].interval?logRecord_mt(__FILE__, __FUNCTION__, __LINE__, component, level, format, ##args):(void)0)
|
||||
#else //default
|
||||
#define logIt(component, level, format, args...) (g_log->log_component[component].interval?logRecord(__FILE__, __FUNCTION__, __LINE__, component, level, format, ##args):(void)0)
|
||||
#endif
|
||||
|
||||
|
||||
/* @}*/
|
||||
|
||||
/*!\fn int32_t write_file_matlab(const char *fname, const char *vname, void *data, int length, int dec, char format);
|
||||
\brief Write output file from signal data
|
||||
@param fname output file name
|
||||
@param vname output vector name (for MATLAB/OCTAVE)
|
||||
@param data point to data
|
||||
@param length length of data vector to output
|
||||
@param dec decimation level
|
||||
@param format data format (0 = real 16-bit, 1 = complex 16-bit,2 real 32-bit, 3 complex 32-bit,4 = real 8-bit, 5 = complex 8-bit)
|
||||
*/
|
||||
int32_t write_file_matlab(const char *fname, const char *vname, void *data, int length, int dec, char format);
|
||||
|
||||
/*----------------macro definitions for reading log configuration from the config module */
|
||||
#define CONFIG_STRING_LOG_PREFIX "log_config"
|
||||
|
||||
@@ -306,15 +326,16 @@ void *log_thread_function(void * list);
|
||||
#define LOG_CONFIG_LEVEL_FORMAT "%s_log_level"
|
||||
#define LOG_CONFIG_VERBOSITY_FORMAT "%s_log_verbosity"
|
||||
#define LOG_CONFIG_LOGFILE_FORMAT "%s_log_infile"
|
||||
|
||||
/*--------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* LOG globalconfiguration parameters */
|
||||
/* optname helpstr paramflags XXXptr defXXXval type numelt */
|
||||
/* optname help paramflags XXXptr defXXXval type numelt */
|
||||
/*--------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
#define LOG_GLOBALPARAMS_DESC { \
|
||||
{LOG_CONFIG_STRING_GLOBAL_LOG_LEVEL, NULL, 0, strptr:(char **)&gloglevel, defstrval:log_level_names[2].name, TYPE_STRING, 0}, \
|
||||
{LOG_CONFIG_STRING_GLOBAL_LOG_VERBOSITY,NULL, 0, strptr:(char **)&glogverbo, defstrval:log_verbosity_names[2].name, TYPE_STRING, 0}, \
|
||||
{LOG_CONFIG_STRING_GLOBAL_LOG_ONLINE, NULL, 0, iptr:&(g_log->onlinelog), defintval:1, TYPE_INT, 0, }, \
|
||||
{LOG_CONFIG_STRING_GLOBAL_LOG_INFILE, NULL, 0, iptr:&(g_log->filelog), defintval:0, TYPE_INT, 0, }, \
|
||||
{LOG_CONFIG_STRING_GLOBAL_LOG_LEVEL, NULL, 0, strptr:(char **)&gloglevel, defstrval:log_level_names[2].name, TYPE_STRING, 0}, \
|
||||
{LOG_CONFIG_STRING_GLOBAL_LOG_VERBOSITY,NULL, 0, strptr:(char **)&glogverbo, defstrval:log_verbosity_names[2].name, TYPE_STRING, 0}, \
|
||||
{LOG_CONFIG_STRING_GLOBAL_LOG_ONLINE, NULL, 0, iptr:&(g_log->onlinelog), defintval:1, TYPE_INT, 0}, \
|
||||
{LOG_CONFIG_STRING_GLOBAL_LOG_INFILE, NULL, 0, iptr:&(g_log->filelog), defintval:0, TYPE_INT, 0}, \
|
||||
}
|
||||
/*----------------------------------------------------------------------------------*/
|
||||
/** @defgroup _debugging debugging macros
|
||||
@@ -322,43 +343,32 @@ void *log_thread_function(void * list);
|
||||
* @brief Macro used to call logIt function with different message levels
|
||||
* @{*/
|
||||
|
||||
// debugging macros
|
||||
// debugging macros(g_log->log_component[component].interval?logRecord_mt(__FILE__, __FUNCTION__, __LINE__, component, level, format, ##args):(void)0)
|
||||
# if T_TRACER
|
||||
# include "T.h"
|
||||
# define LOG_I(c, x...) T(T_LEGACY_ ## c ## _INFO, T_PRINTF(x))
|
||||
# define LOG_W(c, x...) T(T_LEGACY_ ## c ## _WARNING, T_PRINTF(x))
|
||||
# define LOG_E(c, x...) T(T_LEGACY_ ## c ## _ERROR, T_PRINTF(x))
|
||||
# define LOG_D(c, x...) T(T_LEGACY_ ## c ## _DEBUG, T_PRINTF(x))
|
||||
# define LOG_T(c, x...) T(T_LEGACY_ ## c ## _TRACE, T_PRINTF(x))
|
||||
# define LOG_I(c, x...) do { if (T_stdout) { logIt(c, LOG_INFO, x) ;} else { T(T_LEGACY_ ## c ## _INFO, T_PRINTF(x)) ;}} while (0)
|
||||
# define LOG_W(c, x...) do { if (T_stdout) { logIt(c, LOG_WARNING, x) ;} else { T(T_LEGACY_ ## c ## _WARNING, T_PRINTF(x)) ;}} while (0)
|
||||
# define LOG_E(c, x...) do { if (T_stdout) { logIt(c, LOG_ERR, x) ;} else { T(T_LEGACY_ ## c ## _ERROR, T_PRINTF(x)) ;}} while (0)
|
||||
# define LOG_D(c, x...) do { if (T_stdout) { logIt(c, LOG_DEBUG, x) ;} else { T(T_LEGACY_ ## c ## _DEBUG, T_PRINTF(x)) ;}} while (0)
|
||||
# define LOG_T(c, x...) do { if (T_stdout) { logIt(c, LOG_TRACE, x) ;} else { T(T_LEGACY_ ## c ## _TRACE, T_PRINTF(x)) ;}} while (0)
|
||||
# define LOG_G(c, x...) do { if (T_stdout) { logIt(c, LOG_EMERG, x) ;}} while (0) /* */
|
||||
# define LOG_A(c, x...) do { if (T_stdout) { logIt(c, LOG_ALERT, x) ;}} while (0) /* */
|
||||
# define LOG_C(c, x...) do { if (T_stdout) { logIt(c, LOG_CRIT, x) ;}} while (0) /* */
|
||||
# define LOG_N(c, x...) do { if (T_stdout) { logIt(c, LOG_NOTICE, x) ;}} while (0) /* */
|
||||
# define LOG_F(c, x...) do { if (T_stdout) { logIt(c, LOG_FILE, x) ;}} while (0) /* */
|
||||
# define LOG_M(file, vector, data, len, dec, format) write_file_matlab(file, vector, data, len, dec, format)/* */
|
||||
# else /* T_TRACER */
|
||||
# define LOG_I(c, x...) /* */
|
||||
# define LOG_W(c, x...) /* */
|
||||
# define LOG_E(c, x...) /* */
|
||||
# define LOG_D(c, x...) /* */
|
||||
# define LOG_T(c, x...) /* */
|
||||
# define LOG_G(c, x...) /* */
|
||||
# define LOG_A(c, x...) /* */
|
||||
# define LOG_C(c, x...) /* */
|
||||
# define LOG_N(c, x...) /* */
|
||||
# define LOG_F(c, x...) /* */
|
||||
# else /* T_TRACER */
|
||||
# if DISABLE_LOG_X
|
||||
# define LOG_I(c, x...) /* */
|
||||
# define LOG_W(c, x...) /* */
|
||||
# define LOG_E(c, x...) /* */
|
||||
# define LOG_D(c, x...) /* */
|
||||
# define LOG_T(c, x...) /* */
|
||||
# define LOG_G(c, x...) /* */
|
||||
# define LOG_A(c, x...) /* */
|
||||
# define LOG_C(c, x...) /* */
|
||||
# define LOG_N(c, x...) /* */
|
||||
# define LOG_F(c, x...) /* */
|
||||
# else /*DISABLE_LOG_X*/
|
||||
# define LOG_G(c, x...) logIt(c, LOG_EMERG, x)
|
||||
# define LOG_A(c, x...) logIt(c, LOG_ALERT, x)
|
||||
# define LOG_C(c, x...) logIt(c, LOG_CRIT, x)
|
||||
# define LOG_E(c, x...) logIt(c, LOG_ERR, x)
|
||||
# define LOG_W(c, x...) logIt(c, LOG_WARNING, x)
|
||||
# define LOG_N(c, x...) logIt(c, LOG_NOTICE, x)
|
||||
# define LOG_I(c, x...) logIt(c, LOG_INFO, x)
|
||||
# define LOG_D(c, x...) logIt(c, LOG_DEBUG, x)
|
||||
# define LOG_F(c, x...) logIt(c, LOG_FILE, x) // log to a file, useful for the MSC chart generation
|
||||
# define LOG_T(c, x...) logIt(c, LOG_TRACE, x)
|
||||
# endif /*DISABLE_LOG_X*/
|
||||
# define LOG_M(file, vector, data, len, dec, format) /* */
|
||||
# endif /* T_TRACER */
|
||||
/* @}*/
|
||||
|
||||
|
||||
@@ -32,3 +32,6 @@ extern int log_shutdown;
|
||||
|
||||
extern mapping log_level_names[];
|
||||
extern mapping log_verbosity_names[];
|
||||
|
||||
extern int log_mem_flag;
|
||||
extern char * log_mem_filename;
|
||||
|
||||
@@ -89,9 +89,6 @@ const char* eurecomVariablesNames[] = {
|
||||
"subframe_TX1_UE",
|
||||
"subframe_RX0_UE",
|
||||
"subframe_RX1_UE",
|
||||
"missed_slot_enb",
|
||||
"daq_mbox",
|
||||
"rx_offset_mbox",
|
||||
"ue_rx_offset",
|
||||
"diff2",
|
||||
"hw_subframe",
|
||||
@@ -222,7 +219,10 @@ const char* eurecomFunctionsNames[] = {
|
||||
"ue_lock_mutex_rxtx_for_cnt_decrement1",
|
||||
"ue_lock_mutex_rxtx_for_cnt_increment0",
|
||||
"ue_lock_mutex_rxtx_for_cnt_increment1",
|
||||
|
||||
/* simulation signals */
|
||||
"do_DL_sig",
|
||||
"do_UL_sig",
|
||||
"UE_trx_read",
|
||||
/* RRH signals */
|
||||
"eNB_tx",
|
||||
"eNB_rx",
|
||||
|
||||
@@ -65,9 +65,6 @@ typedef enum {
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_TX1_UE,
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX0_UE,
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX1_UE,
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_MISSED_SLOTS_ENB,
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_DAQ_MBOX,
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_UE_OFFSET_MBOX,
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_UE_RX_OFFSET,
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_DIFF,
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_HW_SUBFRAME,
|
||||
@@ -199,7 +196,10 @@ typedef enum {
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_LOCK_MUTEX_RXTX_FOR_CNT_DECREMENT1,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_LOCK_MUTEX_RXTX_FOR_CNT_INCREMENT0,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_LOCK_MUTEX_RXTX_FOR_CNT_INCREMENT1,
|
||||
|
||||
/* SIMULATION signals */
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_SIM_DO_DL_SIGNAL,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_SIM_DO_UL_SIGNAL,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_SIM_UE_TRX_READ,
|
||||
/* RRH signals */
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_TX,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_RX,
|
||||
@@ -447,28 +447,13 @@ 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 /* T_TRACER */
|
||||
|
||||
#if defined(ENABLE_VCD)
|
||||
#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)
|
||||
#else
|
||||
#define VCD_SIGNAL_DUMPER_INIT(aRgUmEnT)
|
||||
#define VCD_SIGNAL_DUMPER_CLOSE()
|
||||
#define VCD_SIGNAL_DUMPER_CREATE_HEADER()
|
||||
#define VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(vAr1,vAr2)
|
||||
#define VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(vAr1,vAr2)
|
||||
#endif
|
||||
|
||||
#define VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(var, val)
|
||||
#define VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(var, val)
|
||||
|
||||
#endif /* T_TRACER */
|
||||
|
||||
#endif /* !defined (VCD_SIGNAL_DUMPER_H_) */
|
||||
|
||||
@@ -275,9 +275,9 @@ get_free_mem_block (uint32_t sizeP, const char* caller)
|
||||
} while (pool_selected++ < 12);
|
||||
|
||||
LOG_E(PHY, "[MEM_MNGT][ERROR][FATAL] failed allocating MEM_BLOCK size %d byes (pool_selected=%d size=%d)\n", sizeP, pool_selected, size);
|
||||
display_mem_load();
|
||||
AssertFatal(1==0,"get_free_mem_block failed");
|
||||
|
||||
// display_mem_load();
|
||||
// AssertFatal(1==0,"get_free_mem_block failed");
|
||||
LOG_E(MAC,"[MEM_MNGT][ERROR][FATAL] get_free_mem_block failed!!!\n");
|
||||
#ifdef MEMBLOCK_BIG_LOCK
|
||||
if (pthread_mutex_unlock(&mtex)) abort();
|
||||
#endif
|
||||
|
||||
@@ -32,13 +32,7 @@
|
||||
# define __MEM_BLOCK_H__
|
||||
|
||||
#include <stdint.h>
|
||||
#ifdef MEM_BLOCK_C
|
||||
# define public_mem_block(x) x
|
||||
# define private_mem_block(x) x
|
||||
#else
|
||||
# define public_mem_block(x) extern x
|
||||
# define private_mem_block(x)
|
||||
#endif
|
||||
#include "openair2/COMMON/platform_constants.h"
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
typedef struct mem_block_t {
|
||||
@@ -47,21 +41,20 @@ typedef struct mem_block_t {
|
||||
unsigned char pool_id;
|
||||
unsigned char *data;
|
||||
} mem_block_t;
|
||||
#include "UTIL/LISTS/list.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
public_mem_block(void *pool_buffer_init (void);)
|
||||
public_mem_block(void *pool_buffer_clean (void *arg);)
|
||||
public_mem_block(void free_mem_block (mem_block_t * leP, const char* caller);)
|
||||
public_mem_block(mem_block_t* get_free_mem_block (uint32_t sizeP, const char* caller);)
|
||||
public_mem_block(mem_block_t *get_free_copy_mem_block (void);)
|
||||
public_mem_block(mem_block_t *get_free_copy_mem_block_up (void);)
|
||||
public_mem_block(mem_block_t *copy_mem_block (mem_block_t * leP, mem_block_t * destP);)
|
||||
public_mem_block(void display_mem_load (void);)
|
||||
void *pool_buffer_init (void);
|
||||
void *pool_buffer_clean (void *arg);
|
||||
void free_mem_block (mem_block_t * leP, const char* caller);
|
||||
mem_block_t* get_free_mem_block (uint32_t sizeP, const char* caller);
|
||||
mem_block_t *get_free_copy_mem_block (void);
|
||||
mem_block_t *get_free_copy_mem_block_up (void);
|
||||
mem_block_t *copy_mem_block (mem_block_t * leP, mem_block_t * destP);
|
||||
void display_mem_load (void);
|
||||
|
||||
public_mem_block(void check_mem_area (void);)
|
||||
private_mem_block(void check_free_mem_block (mem_block_t * leP);)
|
||||
void check_mem_area (void);
|
||||
void check_free_mem_block (mem_block_t * leP);
|
||||
# define MEM_SCALE MAX_MOBILES_PER_ENB
|
||||
// definition of the size of the allocated memory area
|
||||
# define MEM_MNGT_MB0_BLOCK_SIZE 64
|
||||
@@ -139,9 +132,26 @@ private_mem_block(void check_free_mem_block (mem_block_t * leP);)
|
||||
# define MEM_MNGT_NB_ELEMENTS MEM_MNGT_MB0_NB_BLOCKS + MEM_MNGT_MB1_NB_BLOCKS + MEM_MNGT_MB2_NB_BLOCKS + MEM_MNGT_MB3_NB_BLOCKS + MEM_MNGT_MB4_NB_BLOCKS + MEM_MNGT_MB5_NB_BLOCKS + MEM_MNGT_MB6_NB_BLOCKS + MEM_MNGT_MB7_NB_BLOCKS + MEM_MNGT_MB8_NB_BLOCKS + MEM_MNGT_MB9_NB_BLOCKS + MEM_MNGT_MB10_NB_BLOCKS + MEM_MNGT_MB11_NB_BLOCKS + MEM_MNGT_MB12_NB_BLOCKS + MEM_MNGT_MBCOPY_NB_BLOCKS
|
||||
# define MEM_MNGT_POOL_ID_COPY 13
|
||||
|
||||
#define LIST_NAME_MAX_CHAR 32
|
||||
|
||||
|
||||
private_mem_block(typedef struct {
|
||||
typedef struct {
|
||||
struct mem_block_t *head;
|
||||
struct mem_block_t *tail;
|
||||
int nb_elements;
|
||||
char name[LIST_NAME_MAX_CHAR];
|
||||
} list2_t;
|
||||
//-----------------------------------------------------------------------------
|
||||
typedef struct {
|
||||
struct mem_block_t *head;
|
||||
struct mem_block_t *tail;
|
||||
int nb_elements;
|
||||
char name[LIST_NAME_MAX_CHAR];
|
||||
} list_t;
|
||||
|
||||
|
||||
|
||||
typedef struct {
|
||||
//-----------------------------------------------------------
|
||||
// basic memory management
|
||||
//-----------------------------------------------------------
|
||||
@@ -161,9 +171,9 @@ private_mem_block(typedef struct {
|
||||
mem_block_t mem_blocks[MEM_MNGT_NB_ELEMENTS];
|
||||
list_t mem_lists[14];
|
||||
|
||||
} mem_pool;)
|
||||
} mem_pool;
|
||||
|
||||
private_mem_block(mem_pool mem_block_var;)
|
||||
mem_pool mem_block_var;
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -46,17 +46,6 @@
|
||||
#define DIRECTION_DOWNLINK 1
|
||||
|
||||
/* SR: no need to declare following part: */
|
||||
#if 0
|
||||
/* rntiType */
|
||||
#define NO_RNTI 0
|
||||
#define P_RNTI 1
|
||||
#define RA_RNTI 2
|
||||
#define C_RNTI 3
|
||||
#define SI_RNTI 4
|
||||
#define SPS_RNTI 5
|
||||
#define M_RNTI 6
|
||||
#endif
|
||||
|
||||
typedef enum mac_lte_oob_event {
|
||||
ltemac_send_preamble,
|
||||
ltemac_send_sr,
|
||||
@@ -153,35 +142,6 @@ typedef struct mac_lte_info {
|
||||
guint16 oob_rnti[MAX_SRs];
|
||||
} mac_lte_info;
|
||||
|
||||
/* SR: no need to declare following part: */
|
||||
#if 0
|
||||
typedef struct mac_lte_tap_info {
|
||||
/* Info from context */
|
||||
guint16 rnti;
|
||||
guint16 ueid;
|
||||
guint8 rntiType;
|
||||
guint8 isPredefinedData;
|
||||
guint8 crcStatusValid;
|
||||
mac_lte_crc_status crcStatus;
|
||||
guint8 direction;
|
||||
|
||||
guint8 isPHYRetx;
|
||||
guint16 ueInTTI;
|
||||
|
||||
nstime_t time;
|
||||
|
||||
/* Number of bytes (which part is used depends upon context settings) */
|
||||
guint32 single_number_of_bytes;
|
||||
guint32 bytes_for_lcid[11];
|
||||
guint32 sdus_for_lcid[11];
|
||||
guint8 number_of_rars;
|
||||
|
||||
/* Number of padding bytes includes padding subheaders and trailing padding */
|
||||
guint16 padding_bytes;
|
||||
guint16 raw_length;
|
||||
} mac_lte_tap_info;
|
||||
#endif
|
||||
|
||||
/* Accessor function to check if a frame was considered to be ReTx */
|
||||
//int is_mac_lte_frame_retx(packet_info *pinfo, guint8 direction);
|
||||
|
||||
|
||||
@@ -94,6 +94,7 @@ umts_add_timer_list_up (list2_t * atimer_listP, void (*procP) (void *, void *),
|
||||
uint8_t inserted = 0;
|
||||
|
||||
mb = get_free_mem_block (sizeof (struct timer_unit), __func__);
|
||||
if(mb==NULL) return NULL;
|
||||
((struct timer_unit *) (mb->data))->proc = procP;
|
||||
((struct timer_unit *) (mb->data))->protocol = protocolP;
|
||||
((struct timer_unit *) (mb->data))->timer_id = timer_idP;
|
||||
|
||||
Reference in New Issue
Block a user