- Refine logs functions to avoid copies

- Make logs functions "task-aware"

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4281 818b1a75-f10b-46b9-bf7c-635c3b92a50f
This commit is contained in:
Cedric Roux
2013-10-25 12:56:06 +00:00
parent 129ccac0ae
commit 6f3adad3e8
4 changed files with 504 additions and 523 deletions
+485 -495
View File
File diff suppressed because it is too large Load Diff
+19 -8
View File
@@ -233,7 +233,7 @@ extern "C" {
typedef enum {
MIN_LOG_COMPONENTS = 0,
PHY,
PHY = MIN_LOG_COMPONENTS,
MAC,
EMU,
OCG,
@@ -270,12 +270,15 @@ typedef struct {
typedef struct {
const char *name;
int level;
int flag;
int interval;
int fd;
int filelog;
char* filelog_name;
int level;
int flag;
int interval;
int fd;
int filelog;
char *filelog_name;
/* SR: make the log buffer component relative */
char log_buffer[MAX_LOG_TOTAL];
}log_component_t;
typedef struct {
@@ -285,7 +288,7 @@ typedef struct {
int facility;
int audit_facility;
int format;
}log_config_t;
} log_config_t;
typedef struct {
@@ -311,6 +314,14 @@ typedef struct LOG_params {
int len;
} LOG_params;
extern log_t *g_log;
#if !defined(LOG_NO_THREAD)
extern LOG_params log_list[2000];
extern pthread_mutex_t log_lock;
extern pthread_cond_t log_notify;
extern int log_shutdown;
#endif
/*--- INCLUDES ---------------------------------------------------------------*/
# include "log_if.h"
-7
View File
@@ -1,7 +0,0 @@
extern log_t *g_log;
extern LOG_params log_list[2000];
extern pthread_mutex_t log_lock;
extern pthread_cond_t log_notify;
extern int log_shutdown;
-13
View File
@@ -1,13 +0,0 @@
// main log variables
log_t *g_log;
// vars for the log thread
LOG_params log_list[2000];
int log_list_head = 0;
int log_list_tail = 0;
int log_list_nb_elements = 0;
pthread_mutex_t log_lock;
pthread_cond_t log_notify;
int log_shutdown;