Fix NFAPI integration
This commit fixes issues introduced by the previous commit.
Summary of work:
- cleanup:
- fix LOG_XX to be less verbose
- fix cmake_targets/CMakeLists.txt
- fix oaienv
- remove dead code
- bug fixes:
- in openair1/SCHED/fapi_l1.c we had:
eNB->pdcch_vars[subframe&1].num_dci = number_dci;
should be:
eNB->pdcch_vars[subframe&1].num_dci = 0;
This bug let the PHY send more DCIs than what should have been
sent because num_dci is incremented later on in the code.
This fix may be a problem for fapi mode, to be checked.
- add new T VCD traces
- revert openair1/PHY/TOOLS/file_output.c to 'develop' version
- remove thread_id in logRecord/logRecord_mt
- revert (and adapt) configuration files
- be careful when doing frame++, we need to % 1024
- revert target_rx_power in openair2/LAYER2/MAC/eNB_scheduler_ulsch.c
- NFAPI:
- the open-nFAPI code has been included in the repository. See nfapi/README.
Maybe we should "git clone" the Cisco repository instead. We have to be
careful of availability though.
What has been tested:
- monolithic eNB FDD 5/10MHz with one UE, iperf UDP/TCP uplink/downlink
Anything else may fail to work, especially the FAPI mode, which has not
been tested at all.
This commit is contained in:
+8
-14
@@ -861,7 +861,7 @@ void nfapi_log(char *file, char *func, int line, int comp, int level, const char
|
||||
}
|
||||
|
||||
//log record: add to a list
|
||||
void logRecord(const char *file, const char *func, int line, pthread_t thread_id, int comp,
|
||||
void logRecord(const char *file, const char *func, int line, int comp,
|
||||
int level, const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
@@ -876,7 +876,6 @@ void logRecord(const char *file, const char *func, int line, pthread_t thread_id
|
||||
log_params.file = strdup(file);
|
||||
log_params.func = strdup(func);
|
||||
log_params.line = line;
|
||||
log_params.thread_id = thread_id;
|
||||
log_params.comp = comp;
|
||||
log_params.level = level;
|
||||
log_params.format = format;
|
||||
@@ -915,7 +914,7 @@ void logRecord(const char *file, const char *func, int line, pthread_t thread_id
|
||||
}
|
||||
|
||||
void logRecord_thread_safe(const char *file, const char *func,
|
||||
int line, pthread_t thread_id, int comp, int level,
|
||||
int line, int comp, int level,
|
||||
int len, const char *params_string)
|
||||
{
|
||||
log_component_t *c;
|
||||
@@ -967,8 +966,6 @@ void logRecord_thread_safe(const char *file, const char *func,
|
||||
func);
|
||||
}
|
||||
|
||||
//total_len += snprintf(&log_buffer[total_len], MAX_LOG_TOTAL - total_len, "[%08lx] ", thread_id);
|
||||
|
||||
if ((g_log->flag & FLAG_FILE_LINE) || (c->flag & FLAG_FILE_LINE) ) {
|
||||
total_len += snprintf(&log_buffer[total_len], MAX_LOG_TOTAL - total_len, "[%s:%d]",
|
||||
file, line);
|
||||
@@ -1068,7 +1065,6 @@ void *log_thread_function(void *list)
|
||||
logRecord_thread_safe(log_params.file,
|
||||
log_params.func,
|
||||
log_params.line,
|
||||
log_params.thread_id,
|
||||
log_params.comp,
|
||||
log_params.level,
|
||||
log_params.len,
|
||||
@@ -1357,8 +1353,8 @@ void logRecord_mt(const char *file, const char *func, int line, int comp,
|
||||
#endif /* #if 0 */
|
||||
|
||||
//log record, format, and print: executed in the main thread (mt)
|
||||
void logRecord_mt(const char *file, const char *func, int line,
|
||||
pthread_t thread_id, int comp, int level, const char *format, ...)
|
||||
void logRecord_mt(const char *file, const char *func, int line, int comp,
|
||||
int level, const char *format, ...)
|
||||
{
|
||||
int len = 0;
|
||||
va_list args;
|
||||
@@ -1389,7 +1385,8 @@ void logRecord_mt(const char *file, const char *func, int line,
|
||||
return;
|
||||
}
|
||||
|
||||
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_LOG_RECORD, VCD_FUNCTION_IN);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_LOG_RECORD,
|
||||
VCD_FUNCTION_IN);
|
||||
|
||||
va_start(args, format);
|
||||
|
||||
@@ -1452,16 +1449,13 @@ void logRecord_mt(const char *file, const char *func, int line,
|
||||
if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL;
|
||||
}
|
||||
|
||||
//len += snprintf(&log_buffer[len], MAX_LOG_TOTAL - len, "[%08lx]", thread_id);
|
||||
//if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL;
|
||||
|
||||
len += vsnprintf(&log_buffer[len], MAX_LOG_TOTAL - len, format, args);
|
||||
if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL;
|
||||
log_end = log_buffer + len;
|
||||
|
||||
if ( (g_log->flag & FLAG_COLOR) || (c->flag & FLAG_COLOR) ) {
|
||||
len += snprintf(&log_buffer[len], MAX_LOG_TOTAL - len, "%s",
|
||||
log_level_highlight_end[level]);
|
||||
log_level_highlight_end[level]);
|
||||
if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL;
|
||||
}
|
||||
}
|
||||
@@ -1480,7 +1474,7 @@ void logRecord_mt(const char *file, const char *func, int line,
|
||||
}
|
||||
|
||||
#else
|
||||
fwrite(log_buffer, len, 1, stdout);
|
||||
fwrite(log_buffer, len, 1, stdout);
|
||||
#endif
|
||||
|
||||
#ifndef RTAI
|
||||
|
||||
+6
-21
@@ -240,7 +240,6 @@ typedef struct LOG_params {
|
||||
const char *file;
|
||||
const char *func;
|
||||
int line;
|
||||
pthread_t thread_id;
|
||||
int comp;
|
||||
int level;
|
||||
const char *format;
|
||||
@@ -263,8 +262,8 @@ void log_set_instance_type (log_instance_type_t instance);
|
||||
# include "log_if.h"
|
||||
/*----------------------------------------------------------------------------*/
|
||||
int logInit (void);
|
||||
void logRecord_mt(const char *file, const char *func, int line,pthread_t thread_id, int comp, int level, const char *format, ...) __attribute__ ((format (printf, 7, 8)));
|
||||
void logRecord(const char *file, const char *func, int line, pthread_t thread_id, int comp, int level, const char *format, ...) __attribute__ ((format (printf, 7, 8)));
|
||||
void logRecord_mt(const char *file, const char *func, int line,int comp, int level, const char *format, ...) __attribute__ ((format (printf, 6, 7)));
|
||||
void logRecord(const char *file, const char *func, int line,int comp, int level, const char *format, ...) __attribute__ ((format (printf, 6, 7)));
|
||||
int set_comp_log(int component, int level, int verbosity, int interval);
|
||||
int set_log(int component, int level, int interval);
|
||||
void set_glog(int level, int verbosity);
|
||||
@@ -286,15 +285,15 @@ void *log_thread_function(void * list);
|
||||
#ifdef USER_MODE
|
||||
//#define logIt(component, level, format, args...) do {logRecord(__FILE__, __FUNCTION__, __LINE__, component, level, format, ##args);} while(0);
|
||||
#ifdef LOG_NO_THREAD
|
||||
#define logIt(component, level, format, args...) logRecord_mt(__FILE__, __FUNCTION__, __LINE__, pthread_self(), component, level, format, ##args)
|
||||
#define logIt(component, level, format, args...) logRecord_mt(__FILE__, __FUNCTION__, __LINE__, component, level, format, ##args)
|
||||
#else //default
|
||||
#define logIt(component, level, format, args...) logRecord(__FILE__, __FUNCTION__, __LINE__, pthread_self(), component, level, format, ##args)
|
||||
#define logIt(component, level, format, args...) logRecord(__FILE__, __FUNCTION__, __LINE__, component, level, format, ##args)
|
||||
#endif
|
||||
#else
|
||||
#ifdef LOG_NO_THREAD
|
||||
#define logIt(component, level, format, args...) logRecord_mt(NULL, __FUNCTION__, __LINE__, pthread_self(), component, level, format, ##args)
|
||||
#define logIt(component, level, format, args...) logRecord_mt(NULL, __FUNCTION__, __LINE__, component, level, format, ##args)
|
||||
#else // default
|
||||
#define logIt(component, level, format, args...) logRecord(NULL, __FUNCTION__, __LINE__, pthread_self(), component, level, format, ##args)
|
||||
#define logIt(component, level, format, args...) logRecord(NULL, __FUNCTION__, __LINE__, component, level, format, ##args)
|
||||
#endif
|
||||
#endif
|
||||
/* @}*/
|
||||
@@ -353,19 +352,6 @@ void *log_thread_function(void * list);
|
||||
# define LOG_N(c, x...) /* */
|
||||
# define LOG_F(c, x...) /* */
|
||||
# else /*DISABLE_LOG_X*/
|
||||
#if 0
|
||||
extern log_t *g_log;
|
||||
# define LOG_G(c, x...) do { if (g_log->log_component[c].level > g_log->level || LOG_EMERG > g_log->log_component[c].level || LOG_EMERG > g_log->level) logIt(c, LOG_EMERG, x); } while(0)
|
||||
# define LOG_A(c, x...) do { if (g_log->log_component[c].level > g_log->level || LOG_ALERT > g_log->log_component[c].level || LOG_ALERT > g_log->level) logIt(c, LOG_ALERT, x); } while(0)
|
||||
# define LOG_C(c, x...) do { if (g_log->log_component[c].level > g_log->level || LOG_CRIT > g_log->log_component[c].level || LOG_CRIT > g_log->level) logIt(c, LOG_CRIT, x); } while(0)
|
||||
# define LOG_E(c, x...) do { if (g_log->log_component[c].level > g_log->level || LOG_ERR > g_log->log_component[c].level || LOG_ERR > g_log->level) logIt(c, LOG_ERR, x); } while(0)
|
||||
# define LOG_W(c, x...) do { if (g_log->log_component[c].level > g_log->level || LOG_WARNING > g_log->log_component[c].level || LOG_WARNING > g_log->level) logIt(c, LOG_WARNING, x); } while(0)
|
||||
# define LOG_N(c, x...) do { if (g_log->log_component[c].level > g_log->level || LOG_NOTICE > g_log->log_component[c].level || LOG_NOTICE > g_log->level) logIt(c, LOG_NOTICE, x); } while(0)
|
||||
# define LOG_I(c, x...) do { if (g_log->log_component[c].level > g_log->level || LOG_INFO > g_log->log_component[c].level || LOG_INFO > g_log->level) logIt(c, LOG_INFO, x); } while(0)
|
||||
# define LOG_D(c, x...) do { if (g_log->log_component[c].level > g_log->level || LOG_DEBUG > g_log->log_component[c].level || LOG_DEBUG > g_log->level) logIt(c, LOG_DEBUG, x); } while(0)
|
||||
# define LOG_F(c, x...) do { if (g_log->log_component[c].level > g_log->level || LOG_FILE > g_log->log_component[c].level || LOG_FILE > g_log->level) logIt(c, LOG_FILE, x); } while(0)
|
||||
# define LOG_T(c, x...) do { if (g_log->log_component[c].level > g_log->level || LOG_TRACE > g_log->log_component[c].level || LOG_TRACE > g_log->level) logIt(c, LOG_TRACE, x); } while(0)
|
||||
#else
|
||||
# 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)
|
||||
@@ -376,7 +362,6 @@ void *log_thread_function(void * list);
|
||||
# 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 /* 0 */
|
||||
# endif /*DISABLE_LOG_X*/
|
||||
# endif /* T_TRACER */
|
||||
#else /* USER_MODE */
|
||||
|
||||
Reference in New Issue
Block a user