Commit 6f3adad3 authored by Cedric Roux's avatar Cedric Roux

- 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
parent 129ccac0
This diff is collapsed.
...@@ -233,7 +233,7 @@ extern "C" { ...@@ -233,7 +233,7 @@ extern "C" {
typedef enum { typedef enum {
MIN_LOG_COMPONENTS = 0, MIN_LOG_COMPONENTS = 0,
PHY, PHY = MIN_LOG_COMPONENTS,
MAC, MAC,
EMU, EMU,
OCG, OCG,
...@@ -275,7 +275,10 @@ typedef struct { ...@@ -275,7 +275,10 @@ typedef struct {
int interval; int interval;
int fd; int fd;
int filelog; int filelog;
char* filelog_name; char *filelog_name;
/* SR: make the log buffer component relative */
char log_buffer[MAX_LOG_TOTAL];
}log_component_t; }log_component_t;
typedef struct { typedef struct {
...@@ -285,7 +288,7 @@ typedef struct { ...@@ -285,7 +288,7 @@ typedef struct {
int facility; int facility;
int audit_facility; int audit_facility;
int format; int format;
}log_config_t; } log_config_t;
typedef struct { typedef struct {
...@@ -311,6 +314,14 @@ typedef struct LOG_params { ...@@ -311,6 +314,14 @@ typedef struct LOG_params {
int len; int len;
} LOG_params; } 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 ---------------------------------------------------------------*/ /*--- INCLUDES ---------------------------------------------------------------*/
# include "log_if.h" # include "log_if.h"
......
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;
// 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;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment