Merge branch 'develop-realtime-lts' into develop_integration_w07
Conflicts: targets/RT/USER/lte-enb.c targets/RT/USER/lte-softmodem.c targets/RT/USER/lte-ue.c
This commit is contained in:
@@ -1664,18 +1664,6 @@ endif()
|
||||
|
||||
message ("NETTLE VERSION_INSTALLED = ${NETTLE_VERSION}")
|
||||
|
||||
string(REGEX REPLACE "([0-9]+).*" "\\1" NETTLE_VERSION_MAJOR ${NETTLE_VERSION})
|
||||
string(REGEX REPLACE "[0-9]+\\.([0-9]+).*" "\\1" NETTLE_VERSION_MINOR ${NETTLE_VERSION})
|
||||
message ("NETTLE_VERSION_MAJOR = ${NETTLE_VERSION_MAJOR}")
|
||||
message ("NETTLE_VERSION_MINOR = ${NETTLE_VERSION_MINOR}")
|
||||
|
||||
if ("${NETTLE_VERSION_MAJOR}" STREQUAL "" OR "${NETTLE_VERSION_MINOR}" STREQUAL "")
|
||||
message( FATAL_ERROR "The nettle version not detected properly. Try to run build_oai -I again" )
|
||||
endif()
|
||||
|
||||
add_definitions("-DNETTLE_VERSION_MAJOR=${NETTLE_VERSION_MAJOR}")
|
||||
add_definitions("-DNETTLE_VERSION_MINOR=${NETTLE_VERSION_MINOR}")
|
||||
|
||||
pkg_search_module(XPM xpm)
|
||||
if(NOT ${XPM_FOUND})
|
||||
message("PACKAGE xpm not found: some targets will fail")
|
||||
|
||||
@@ -65,7 +65,7 @@ _Assert_(cOND, _Assert_Exit_, #vALUE1 ": %" PRIdMAX "\n" #vALUE2 ": %" PRIdMAX "
|
||||
(intmax_t)vALUE1, (intmax_t)vALUE2, (intmax_t)vALUE3)
|
||||
|
||||
#define DevCheck4(cOND, vALUE1, vALUE2, vALUE3, vALUE4) \
|
||||
_Assert_(cOND, _Assert_Exit_, #vALUE1": %"PRIdMAX"\n"#vALUE2": %"PRIdMAX"\n"#vALUE3": %"PRIdMAX"\n"#vALUE4": %"PRIdMAX"\n\n", \
|
||||
_Assert_(cOND, _Assert_Exit_, #vALUE1": %" PRIdMAX "\n" #vALUE2 ": %" PRIdMAX "\n" #vALUE3 ": %" PRIdMAX "\n" #vALUE4 ": %" PRIdMAX "\n\n", \
|
||||
(intmax_t)vALUE1, (intmax_t)vALUE2, (intmax_t)vALUE3, (intmax_t)vALUE4)
|
||||
|
||||
#define DevParam(vALUE1, vALUE2, vALUE3) DevCheck(0, vALUE1, vALUE2, vALUE3)
|
||||
|
||||
@@ -40,6 +40,8 @@
|
||||
#include "SCHED/defs.h"
|
||||
#include "defs.h"
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
#include "UTIL/LOG/log.h"
|
||||
#include <syscall.h>
|
||||
|
||||
//#define DEBUG_DLSCH_CODING
|
||||
//#define DEBUG_DLSCH_FREE 1
|
||||
@@ -347,6 +349,8 @@ int dlsch_encoding_2threads0(te_params *tep) {
|
||||
|
||||
extern int oai_exit;
|
||||
void *te_thread(void *param) {
|
||||
pthread_setname_np( pthread_self(),"te processing");
|
||||
LOG_I(PHY,"thread te created id=%ld", syscall(__NR_gettid));
|
||||
|
||||
eNB_proc_t *proc = &((te_params *)param)->eNB->proc;
|
||||
while (!oai_exit) {
|
||||
|
||||
@@ -418,6 +418,7 @@ int ulsch_decoding_data_2thread0(td_params* tdp) {
|
||||
|
||||
extern int oai_exit;
|
||||
void *td_thread(void *param) {
|
||||
pthread_setname_np( pthread_self(), "td processing");
|
||||
PHY_VARS_eNB *eNB = ((td_params*)param)->eNB;
|
||||
eNB_proc_t *proc = &eNB->proc;
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#ifndef __PHY_DEFS__H__
|
||||
#define __PHY_DEFS__H__
|
||||
|
||||
#define _GNU_SOURCE
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <malloc.h>
|
||||
@@ -391,6 +392,9 @@ typedef struct {
|
||||
pthread_mutex_t mutex_rxtx;
|
||||
/// scheduling parameters for RXn-TXnp4 thread
|
||||
struct sched_param sched_param_rxtx;
|
||||
int sub_frame_start;
|
||||
int sub_frame_step;
|
||||
unsigned long long gotIQs;
|
||||
} UE_rxtx_proc_t;
|
||||
|
||||
/// Context data structure for eNB subframe processing
|
||||
|
||||
@@ -2603,6 +2603,7 @@ extern int oai_exit;
|
||||
|
||||
static void *fep_thread(void *param) {
|
||||
|
||||
pthread_setname_np( pthread_self(), "UEfep");
|
||||
PHY_VARS_eNB *eNB = (PHY_VARS_eNB *)param;
|
||||
eNB_proc_t *proc = &eNB->proc;
|
||||
while (!oai_exit) {
|
||||
|
||||
@@ -264,7 +264,7 @@ typedef struct protocol_ctxt_s {
|
||||
(Ctxt_Pp)->subframe = sUBfRAME; \
|
||||
PROTOCOL_CTXT_COMPUTE_MODULE_ID(Ctxt_Pp)
|
||||
|
||||
#define PROTOCOL_CTXT_FMT "[FRAME %05u][%s][MOD %02u][RNTI %"PRIx16"]"
|
||||
#define PROTOCOL_CTXT_FMT "[FRAME %05u][%s][MOD %02u][RNTI %" PRIx16 "]"
|
||||
#define PROTOCOL_CTXT_ARGS(CTXT_Pp) \
|
||||
(CTXT_Pp)->frame, \
|
||||
((CTXT_Pp)->enb_flag == ENB_FLAG_YES) ? "eNB":" UE", \
|
||||
|
||||
+272
-171
@@ -43,6 +43,13 @@
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdarg.h>
|
||||
#include <time.h>
|
||||
#include <stdint.h>
|
||||
#include <inttypes.h>
|
||||
#ifndef _GNU_SOURCE
|
||||
#define _GNU_SOURCE
|
||||
#endif
|
||||
#include <pthread.h>
|
||||
#else
|
||||
#include "rtai_fifos.h"
|
||||
#endif
|
||||
@@ -76,41 +83,197 @@ extern "C" {
|
||||
* @ingroup _macro
|
||||
* @brief LOG defines 9 levels of messages for users. Importance of these levels decrease gradually from 0 to 8
|
||||
* @{*/
|
||||
#ifndef LOG_EMERG
|
||||
# define LOG_EMERG 0 /*!< \brief system is unusable */
|
||||
#endif
|
||||
#ifndef LOG_ALERT
|
||||
# define LOG_ALERT 1 /*!< \brief action must be taken immediately */
|
||||
#endif
|
||||
#ifndef LOG_CRIT
|
||||
# define LOG_CRIT 2 /*!< \brief critical conditions */
|
||||
#endif
|
||||
#ifndef LOG_ERR
|
||||
# define LOG_ERR 3 /*!< \brief error conditions */
|
||||
#endif
|
||||
#ifndef LOG_WARNING
|
||||
# define LOG_WARNING 4 /*!< \brief warning conditions */
|
||||
#endif
|
||||
#ifndef LOG_NOTICE
|
||||
# define LOG_NOTICE 5 /*!< \brief normal but significant condition */
|
||||
#endif
|
||||
#ifndef LOG_INFO
|
||||
# define LOG_INFO 6 /*!< \brief informational */
|
||||
#endif
|
||||
#ifndef LOG_DEBUG
|
||||
# define LOG_DEBUG 7 /*!< \brief debug-level messages */
|
||||
#endif
|
||||
#ifndef LOG_FILE
|
||||
# define LOG_FILE 8 /*!< \brief message sequence chart -level */
|
||||
#endif
|
||||
#ifndef LOG_TRACE
|
||||
# define LOG_TRACE 9 /*!< \brief trace-level messages */
|
||||
#endif
|
||||
|
||||
#define NUM_LOG_LEVEL 10 /*!< \brief the number of message levels users have with LOG */
|
||||
/* @}*/
|
||||
|
||||
|
||||
/** @defgroup _log_format Defined log format
|
||||
* @ingroup _macro
|
||||
* @brief Macro of log formats defined by LOG
|
||||
* @{*/
|
||||
|
||||
/* .log_format = 0x13 uncolored standard messages
|
||||
* .log_format = 0x93 colored standard messages */
|
||||
|
||||
#define LOG_RED "\033[1;31m" /*!< \brief VT100 sequence for bold red foreground */
|
||||
#define LOG_GREEN "\033[32m" /*!< \brief VT100 sequence for green foreground */
|
||||
#define LOG_ORANGE "\033[93m" /*!< \brief VT100 sequence for orange foreground */
|
||||
#define LOG_BLUE "\033[34m" /*!< \brief VT100 sequence for blue foreground */
|
||||
#define LOG_CYBL "\033[40;36m" /*!< \brief VT100 sequence for cyan foreground on black background */
|
||||
#define LOG_RESET "\033[0m" /*!< \brief VT100 sequence for reset (black) foreground */
|
||||
/* @}*/
|
||||
|
||||
|
||||
/** @defgroup _syslog_conf Macros for write in syslog.conf
|
||||
* @ingroup _macro
|
||||
* @brief Macros used to write lines (local/remote) in syslog.conf
|
||||
* @{*/
|
||||
#define LOG_LOCAL 0x01
|
||||
#define LOG_REMOTE 0x02
|
||||
|
||||
#define FLAG_COLOR 0x001 /*!< \brief defaults */
|
||||
#define FLAG_PID 0x002 /*!< \brief defaults */
|
||||
#define FLAG_COMP 0x004
|
||||
#define FLAG_THREAD 0x008 /*!< \brief all : 255/511 */
|
||||
#define FLAG_LEVEL 0x010
|
||||
#define FLAG_FUNCT 0x020
|
||||
#define FLAG_FILE_LINE 0x040
|
||||
#define FLAG_TIME 0x100
|
||||
|
||||
#define LOG_NONE 0x00
|
||||
#define LOG_LOW 0x5
|
||||
#define LOG_MED 0x15
|
||||
#define LOG_HIGH 0x35
|
||||
#define LOG_FULL 0x75
|
||||
|
||||
#define OAI_OK 0 /*!< \brief all ok */
|
||||
#define OAI_ERR 1 /*!< \brief generic error */
|
||||
#define OAI_ERR_READ_ONLY 2 /*!< \brief tried to write to read-only item */
|
||||
#define OAI_ERR_NOTFOUND 3 /*!< \brief something wasn't found */
|
||||
/* @}*/
|
||||
|
||||
|
||||
//static char *log_level_highlight_start[] = {LOG_RED, LOG_RED, LOG_RED, LOG_RED, LOG_BLUE, "", "", "", LOG_GREEN}; /*!< \brief Optional start-format strings for highlighting */
|
||||
|
||||
//static char *log_level_highlight_end[] = {LOG_RESET, LOG_RESET, LOG_RESET, LOG_RESET, LOG_RESET, "", "", "", LOG_RESET}; /*!< \brief Optional end-format strings for highlighting */
|
||||
|
||||
typedef enum {
|
||||
MIN_LOG_COMPONENTS = 0,
|
||||
PHY = MIN_LOG_COMPONENTS,
|
||||
MAC,
|
||||
EMU,
|
||||
OCG,
|
||||
OMG,
|
||||
OPT,
|
||||
OTG,
|
||||
OTG_LATENCY,
|
||||
OTG_LATENCY_BG,
|
||||
OTG_GP,
|
||||
OTG_GP_BG,
|
||||
OTG_JITTER,
|
||||
RLC,
|
||||
PDCP,
|
||||
RRC,
|
||||
NAS,
|
||||
PERF,
|
||||
OIP,
|
||||
CLI,
|
||||
MSC,
|
||||
OCM,
|
||||
UDP_,
|
||||
GTPU,
|
||||
SPGW,
|
||||
S1AP,
|
||||
SCTP,
|
||||
HW,
|
||||
OSA,
|
||||
RAL_ENB,
|
||||
RAL_UE,
|
||||
ENB_APP,
|
||||
FLEXRAN_AGENT,
|
||||
TMR,
|
||||
USIM,
|
||||
LOCALIZE,
|
||||
RRH,
|
||||
X2AP,
|
||||
MAX_LOG_COMPONENTS,
|
||||
}
|
||||
comp_name_t;
|
||||
|
||||
//#define msg printf
|
||||
|
||||
typedef struct {
|
||||
char *name; /*!< \brief string name of item */
|
||||
int value; /*!< \brief integer value of mapping */
|
||||
} mapping;
|
||||
|
||||
|
||||
typedef struct {
|
||||
const char *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 {
|
||||
unsigned int remote_ip;
|
||||
unsigned int audit_ip;
|
||||
int remote_level;
|
||||
int facility;
|
||||
int audit_facility;
|
||||
int format;
|
||||
} log_config_t;
|
||||
|
||||
|
||||
typedef struct {
|
||||
log_component_t log_component[MAX_LOG_COMPONENTS];
|
||||
log_config_t config;
|
||||
char* level2string[NUM_LOG_LEVEL];
|
||||
int level;
|
||||
int onlinelog;
|
||||
int flag;
|
||||
int syslog;
|
||||
int filelog;
|
||||
char* filelog_name;
|
||||
} log_t;
|
||||
|
||||
typedef struct LOG_params {
|
||||
const char *file;
|
||||
const char *func;
|
||||
int line;
|
||||
int comp;
|
||||
int level;
|
||||
const char *format;
|
||||
char l_buff_info [MAX_LOG_INFO];
|
||||
int len;
|
||||
} LOG_params;
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
typedef enum log_instance_type_e {
|
||||
LOG_INSTANCE_UNKNOWN,
|
||||
LOG_INSTANCE_ENB,
|
||||
LOG_INSTANCE_UE,
|
||||
} log_instance_type_t;
|
||||
|
||||
void log_set_instance_type (log_instance_type_t instance);
|
||||
#endif
|
||||
|
||||
|
||||
/*--- INCLUDES ---------------------------------------------------------------*/
|
||||
# include "log_if.h"
|
||||
/*----------------------------------------------------------------------------*/
|
||||
int logInit (void);
|
||||
void logRecord_mt(const char *file, const char *func, int line,int comp, int level, const char *format, ...);
|
||||
void logRecord(const char *file, const char *func, int line,int comp, int level, const char *format, ...);
|
||||
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);
|
||||
void set_log_syslog(int enable);
|
||||
void set_log_onlinelog(int enable);
|
||||
void set_log_filelog(int enable);
|
||||
void set_component_filelog(int comp);
|
||||
int map_str_to_int(mapping *map, const char *str);
|
||||
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);
|
||||
|
||||
/** @defgroup _logIt logIt function
|
||||
* @ingroup _macro
|
||||
* @brief Macro used to call tr_log_full_ex with file, function and line information
|
||||
@@ -186,169 +349,107 @@ extern "C" {
|
||||
#define LOG_RETURN(c,x) do {uint32_t __rv;__rv=(unsigned int)(x);LOG_T(c,"Returning %08x\n", __rv);return((typeof(x))__rv);}while(0) /*!< \brief Macro to log a function exit, including integer value, then to return a value to the calling function */
|
||||
/* @}*/
|
||||
|
||||
|
||||
/** @defgroup _log_format Defined log format
|
||||
* @ingroup _macro
|
||||
* @brief Macro of log formats defined by LOG
|
||||
* @{*/
|
||||
|
||||
/* .log_format = 0x13 uncolored standard messages
|
||||
* .log_format = 0x93 colored standard messages */
|
||||
|
||||
#define LOG_RED "\033[1;31m" /*!< \brief VT100 sequence for bold red foreground */
|
||||
#define LOG_GREEN "\033[32m" /*!< \brief VT100 sequence for green foreground */
|
||||
#define LOG_ORANGE "\033[93m" /*!< \brief VT100 sequence for orange foreground */
|
||||
#define LOG_BLUE "\033[34m" /*!< \brief VT100 sequence for blue foreground */
|
||||
#define LOG_CYBL "\033[40;36m" /*!< \brief VT100 sequence for cyan foreground on black background */
|
||||
#define LOG_RESET "\033[0m" /*!< \brief VT100 sequence for reset (black) foreground */
|
||||
/* @}*/
|
||||
|
||||
|
||||
/** @defgroup _syslog_conf Macros for write in syslog.conf
|
||||
* @ingroup _macro
|
||||
* @brief Macros used to write lines (local/remote) in syslog.conf
|
||||
* @{*/
|
||||
#define LOG_LOCAL 0x01
|
||||
#define LOG_REMOTE 0x02
|
||||
|
||||
#define FLAG_COLOR 0x001 /*!< \brief defaults */
|
||||
#define FLAG_PID 0x002 /*!< \brief defaults */
|
||||
#define FLAG_COMP 0x004
|
||||
#define FLAG_THREAD 0x008 /*!< \brief all : 255/511 */
|
||||
#define FLAG_LEVEL 0x010
|
||||
#define FLAG_FUNCT 0x020
|
||||
#define FLAG_FILE_LINE 0x040
|
||||
#define FLAG_TIME 0x100
|
||||
|
||||
#define LOG_NONE 0x00
|
||||
#define LOG_LOW 0x5
|
||||
#define LOG_MED 0x15
|
||||
#define LOG_HIGH 0x35
|
||||
#define LOG_FULL 0x75
|
||||
|
||||
#define OAI_OK 0 /*!< \brief all ok */
|
||||
#define OAI_ERR 1 /*!< \brief generic error */
|
||||
#define OAI_ERR_READ_ONLY 2 /*!< \brief tried to write to read-only item */
|
||||
#define OAI_ERR_NOTFOUND 3 /*!< \brief something wasn't found */
|
||||
/* @}*/
|
||||
|
||||
|
||||
//static char *log_level_highlight_start[] = {LOG_RED, LOG_RED, LOG_RED, LOG_RED, LOG_BLUE, "", "", "", LOG_GREEN}; /*!< \brief Optional start-format strings for highlighting */
|
||||
|
||||
//static char *log_level_highlight_end[] = {LOG_RESET, LOG_RESET, LOG_RESET, LOG_RESET, LOG_RESET, "", "", "", LOG_RESET}; /*!< \brief Optional end-format strings for highlighting */
|
||||
|
||||
typedef enum {
|
||||
MIN_LOG_COMPONENTS = 0,
|
||||
PHY = MIN_LOG_COMPONENTS,
|
||||
MAC,
|
||||
EMU,
|
||||
OCG,
|
||||
OMG,
|
||||
OPT,
|
||||
OTG,
|
||||
OTG_LATENCY,
|
||||
OTG_LATENCY_BG,
|
||||
OTG_GP,
|
||||
OTG_GP_BG,
|
||||
OTG_JITTER,
|
||||
RLC,
|
||||
PDCP,
|
||||
RRC,
|
||||
NAS,
|
||||
PERF,
|
||||
OIP,
|
||||
CLI,
|
||||
MSC,
|
||||
OCM,
|
||||
UDP_,
|
||||
GTPU,
|
||||
SPGW,
|
||||
S1AP,
|
||||
SCTP,
|
||||
HW,
|
||||
OSA,
|
||||
RAL_ENB,
|
||||
RAL_UE,
|
||||
ENB_APP,
|
||||
FLEXRAN_AGENT,
|
||||
TMR,
|
||||
USIM,
|
||||
LOCALIZE,
|
||||
RRH,
|
||||
X2AP,
|
||||
MAX_LOG_COMPONENTS,
|
||||
static __inline__ uint64_t rdtsc(void) {
|
||||
uint64_t a, d;
|
||||
__asm__ volatile ("rdtsc" : "=a" (a), "=d" (d));
|
||||
return (d<<32) | a;
|
||||
}
|
||||
comp_name_t;
|
||||
|
||||
//#define msg printf
|
||||
#define DEBUG_REALTIME 1
|
||||
#if DEBUG_REALTIME
|
||||
|
||||
typedef struct {
|
||||
char *name; /*!< \brief string name of item */
|
||||
int value; /*!< \brief integer value of mapping */
|
||||
} mapping;
|
||||
extern double cpuf;
|
||||
|
||||
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();
|
||||
struct timespec CPUt;
|
||||
clock_gettime(CLOCK_THREAD_CPUTIME_ID, &CPUt);
|
||||
uint64_t CPUTime=CPUt.tv_sec*1000*1000+CPUt.tv_nsec/1000;
|
||||
double microCycles=(double)(cpuf*1000);
|
||||
int duration=(int)((cur-last)/microCycles);
|
||||
if ( last!=0 && duration > timeout ) {
|
||||
//struct timespec ts;
|
||||
//clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||
printf("%s:%d lte-ue delay %d (exceed %d), CPU for this period: %lld\n", file, line,
|
||||
duration, timeout, (long long)CPUTime-lastCPUTime );
|
||||
}
|
||||
last=cur;
|
||||
lastCPUTime=CPUTime;
|
||||
return cur;
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
const char *name;
|
||||
int level;
|
||||
int flag;
|
||||
int interval;
|
||||
int fd;
|
||||
int filelog;
|
||||
char *filelog_name;
|
||||
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);
|
||||
int duration=(int)((cur-last)/microCycles);
|
||||
if ( last!=0 && duration > timeout )
|
||||
printf("%s:%d lte-ue delay %d (exceed %d)\n", file, line,
|
||||
duration, timeout);
|
||||
last=cur;
|
||||
return cur;
|
||||
}
|
||||
|
||||
/* SR: make the log buffer component relative */
|
||||
char log_buffer[MAX_LOG_TOTAL];
|
||||
} log_component_t;
|
||||
typedef struct m {
|
||||
uint64_t iterations;
|
||||
uint64_t sum;
|
||||
uint64_t maxArray[11];
|
||||
} Meas;
|
||||
|
||||
typedef struct {
|
||||
unsigned int remote_ip;
|
||||
unsigned int audit_ip;
|
||||
int remote_level;
|
||||
int facility;
|
||||
int audit_facility;
|
||||
int format;
|
||||
} log_config_t;
|
||||
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=%"
|
||||
PRIu64 ":%" PRIu64 ":%" PRIu64 ":%" PRIu64 ":%" PRIu64 ":%" PRIu64 ":%" PRIu64 ":%" PRIu64 ":%" PRIu64 ":%" PRIu64 "\n",
|
||||
txt,
|
||||
M->sum/M->iterations,
|
||||
M->iterations,
|
||||
M->maxArray[1],M->maxArray[2], M->maxArray[3],M->maxArray[4], M->maxArray[5],
|
||||
M->maxArray[6],M->maxArray[7], M->maxArray[8],M->maxArray[9],M->maxArray[10]);
|
||||
LOG_W(PHY,txt2);
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
log_component_t log_component[MAX_LOG_COMPONENTS];
|
||||
log_config_t config;
|
||||
char* level2string[NUM_LOG_LEVEL];
|
||||
int level;
|
||||
int onlinelog;
|
||||
int flag;
|
||||
int syslog;
|
||||
int filelog;
|
||||
char* filelog_name;
|
||||
} log_t;
|
||||
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);
|
||||
M->maxArray[0]=diff;
|
||||
M->sum+=diff;
|
||||
M->iterations++;
|
||||
qsort(M->maxArray, 11, sizeof(uint64_t), cmpint);
|
||||
printMeas(txt,M,period);
|
||||
}
|
||||
}
|
||||
|
||||
typedef struct LOG_params {
|
||||
const char *file;
|
||||
const char *func;
|
||||
int line;
|
||||
int comp;
|
||||
int level;
|
||||
const char *format;
|
||||
char l_buff_info [MAX_LOG_INFO];
|
||||
int len;
|
||||
} LOG_params;
|
||||
#define check(a) do { checkT(a,__FILE__,__LINE__); } while (0)
|
||||
#define checkcpu(a) do { checkTCPU(a,__FILE__,__LINE__); } while (0)
|
||||
#define initRefTimes(a) static __thread Meas a= {0}
|
||||
#define pickTime(a) uint64_t a=rdtsc()
|
||||
#define readTime(a) a
|
||||
#define initStaticTime(a) static __thread uint64_t a={0}
|
||||
#define pickStaticTime(a) do { a=rdtsc(); } while (0)
|
||||
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
typedef enum log_instance_type_e {
|
||||
LOG_INSTANCE_UNKNOWN,
|
||||
LOG_INSTANCE_ENB,
|
||||
LOG_INSTANCE_UE,
|
||||
} log_instance_type_t;
|
||||
|
||||
void log_set_instance_type (log_instance_type_t instance);
|
||||
#else
|
||||
#define check(a) do {} while (0)
|
||||
#define checkcpu(a) do {} while (0)
|
||||
#define initRefTimes(a) do {} while (0)
|
||||
#define initStaticTime(a) do {} while (0)
|
||||
#define pickTime(a) do {} while (0)
|
||||
#define readTime(a) 0
|
||||
#define pickStaticTime(a) do {} while (0)
|
||||
#define updateTimes(a,b,c,d) do {} while (0)
|
||||
#define printMeas(a,b,c) do {} while (0)
|
||||
#endif
|
||||
int logInit (void);
|
||||
|
||||
/*--- INCLUDES ---------------------------------------------------------------*/
|
||||
# include "log_if.h"
|
||||
/*----------------------------------------------------------------------------*/
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -27,59 +27,8 @@
|
||||
* \warning This component can be runned only in user-space
|
||||
* @ingroup routing
|
||||
*/
|
||||
#ifndef __LOG_IF_H__
|
||||
# define __LOG_IF_H__
|
||||
|
||||
|
||||
/*--- INCLUDES ---------------------------------------------------------------*/
|
||||
# include "log.h"
|
||||
/*----------------------------------------------------------------------------*/
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
# ifdef COMPONENT_LOG
|
||||
# ifdef COMPONENT_LOG_IF
|
||||
# define private_log_if(x) x
|
||||
# define friend_log_if(x) x
|
||||
# define public_log_if(x) x
|
||||
# else
|
||||
# define private_log_if(x)
|
||||
# define friend_log_if(x) extern x
|
||||
# define public_log_if(x) extern x
|
||||
# endif
|
||||
# else
|
||||
# define private_log_if(x)
|
||||
# define friend_log_if(x)
|
||||
# define public_log_if(x) extern x
|
||||
# endif
|
||||
|
||||
/** @defgroup _log_if Interfaces of LOG
|
||||
* @{*/
|
||||
|
||||
//public_log_if( log_t *g_log;)
|
||||
|
||||
public_log_if( int logInit (void);)
|
||||
public_log_if( void logRecord_mt(const char *file, const char *func, int line,int comp, int level, const char *format, ...) __attribute__ ((format (printf, 6, 7)));)
|
||||
public_log_if( void logRecord(const char *file, const char *func, int line,int comp, int level, const char *format, ...) __attribute__ ((format (printf, 6, 7)));)
|
||||
public_log_if( int set_comp_log(int component, int level, int verbosity, int interval);)
|
||||
public_log_if( int set_log(int component, int level, int interval);)
|
||||
public_log_if( void set_glog(int level, int verbosity);)
|
||||
public_log_if( void set_log_syslog(int enable);)
|
||||
public_log_if( void set_log_onlinelog(int enable);)
|
||||
public_log_if( void set_log_filelog(int enable);)
|
||||
public_log_if( void set_component_filelog(int comp);)
|
||||
public_log_if( int map_str_to_int(mapping *map, const char *str);)
|
||||
public_log_if( char *map_int_to_str(mapping *map, int val);)
|
||||
public_log_if( void logClean (void); )
|
||||
public_log_if( int is_newline( char *str, int size);)
|
||||
public_log_if( void *log_thread_function(void * list);)
|
||||
|
||||
/* @}*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// LTS: kept this file for compatibility
|
||||
// this file was probably a trial to separate internal functions and external ones
|
||||
// but it has never been finished, most source code include directly log.h (not log_if.h)
|
||||
#include "log.h"
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include <nettle/nettle-meta.h>
|
||||
#include <nettle/aes.h>
|
||||
#include <nettle/ctr.h>
|
||||
#include <nettle/bignum.h>
|
||||
|
||||
#include "UTIL/LOG/log.h"
|
||||
|
||||
@@ -191,7 +192,7 @@ int stream_encrypt_eea2(stream_cipher_t *stream_cipher, uint8_t **out)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if NETTLE_VERSION_MAJOR < 3
|
||||
#if !defined(NETTLE_VERSION_MAJOR) || NETTLE_VERSION_MAJOR < 3
|
||||
nettle_aes128.set_encrypt_key(ctx, stream_cipher->key_length,
|
||||
stream_cipher->key);
|
||||
#else
|
||||
|
||||
@@ -224,6 +224,7 @@ static void *_nas_user_mngr(void *args)
|
||||
{
|
||||
LOG_FUNC_IN;
|
||||
|
||||
pthread_setname_np( pthread_self(), "nas_user_mngr");
|
||||
int exit_loop = FALSE;
|
||||
|
||||
int *fd = (int *) args;
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include <nettle/nettle-meta.h>
|
||||
#include <nettle/aes.h>
|
||||
#include <nettle/ctr.h>
|
||||
#include <nettle/bignum.h>
|
||||
|
||||
#include "assertions.h"
|
||||
#include "conversions.h"
|
||||
@@ -78,7 +79,7 @@ int nas_stream_encrypt_eea2(nas_stream_cipher_t *stream_cipher, uint8_t *out)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if NETTLE_VERSION_MAJOR < 3
|
||||
#if !defined(NETTLE_VERSION_MAJOR) || NETTLE_VERSION_MAJOR < 3
|
||||
nettle_aes128.set_encrypt_key(ctx, stream_cipher->key_length,
|
||||
stream_cipher->key);
|
||||
#else
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include <nettle/nettle-meta.h>
|
||||
#include <nettle/aes.h>
|
||||
#include <nettle/ctr.h>
|
||||
#include <nettle/bignum.h>
|
||||
|
||||
static
|
||||
void test_uncipher_ctr(const struct nettle_cipher *cipher, const uint8_t *key,
|
||||
@@ -41,7 +42,7 @@ void test_uncipher_ctr(const struct nettle_cipher *cipher, const uint8_t *key,
|
||||
uint8_t *data = malloc(length);
|
||||
uint8_t *ctr = malloc(cipher->block_size);
|
||||
|
||||
#if NETTLE_VERSION_MAJOR < 3
|
||||
#if !defined(NETTLE_VERSION_MAJOR) || NETTLE_VERSION_MAJOR < 3
|
||||
cipher->set_encrypt_key(ctx, key_length, key);
|
||||
#else
|
||||
cipher->set_encrypt_key(ctx, key);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -31,16 +31,16 @@ eNBs =
|
||||
tdd_config_s = 0;
|
||||
prefix_type = "NORMAL";
|
||||
eutra_band = 7;
|
||||
downlink_frequency = 2660000000L;
|
||||
downlink_frequency = 2630000000L;
|
||||
uplink_frequency_offset = -120000000;
|
||||
Nid_cell = 0;
|
||||
N_RB_DL = 25;
|
||||
N_RB_DL = 50;
|
||||
Nid_cell_mbsfn = 0;
|
||||
nb_antenna_ports = 1;
|
||||
nb_antennas_tx = 1;
|
||||
nb_antennas_rx = 1;
|
||||
tx_gain = 90;
|
||||
rx_gain = 125;
|
||||
rx_gain = 110;
|
||||
prach_root = 0;
|
||||
prach_config_index = 0;
|
||||
prach_high_speed = "DISABLE";
|
||||
|
||||
+1176
-1241
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,95 @@
|
||||
#ifndef LTE_SOFTMODEM_H
|
||||
#define LTE_SOFTMODEM_H
|
||||
|
||||
#define _GNU_SOURCE
|
||||
#include <execinfo.h>
|
||||
#include <fcntl.h>
|
||||
#include <getopt.h>
|
||||
#include <linux/sched.h>
|
||||
#include "rt_wrapper.h"
|
||||
#include <sched.h>
|
||||
#include <signal.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <syscall.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/sysinfo.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <sys/sysinfo.h>
|
||||
#include "rt_wrapper.h"
|
||||
#include "../../ARCH/COMMON/common_lib.h"
|
||||
#undef MALLOC
|
||||
#include "assertions.h"
|
||||
#include "msc.h"
|
||||
#include "PHY/types.h"
|
||||
#include "PHY/defs.h"
|
||||
#include "SIMULATION/ETH_TRANSPORT/proto.h"
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
#if defined(ENABLE_USE_MME)
|
||||
#include "s1ap_eNB.h"
|
||||
#ifdef PDCP_USE_NETLINK
|
||||
#include "SIMULATION/ETH_TRANSPORT/proto.h"
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
extern pthread_cond_t sync_cond;
|
||||
extern pthread_mutex_t sync_mutex;
|
||||
extern int sync_var;
|
||||
|
||||
|
||||
extern uint32_t downlink_frequency[MAX_NUM_CCs][4];
|
||||
extern int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
|
||||
|
||||
extern int rx_input_level_dBm;
|
||||
extern uint8_t exit_missed_slots;
|
||||
extern uint64_t num_missed_slots; // counter for the number of missed slots
|
||||
|
||||
extern int oaisim_flag;
|
||||
extern volatile int oai_exit;
|
||||
|
||||
extern openair0_config_t openair0_cfg[MAX_CARDS];
|
||||
extern pthread_cond_t sync_cond;
|
||||
extern pthread_mutex_t sync_mutex;
|
||||
extern int sync_var;
|
||||
extern int transmission_mode;
|
||||
extern double cpuf;
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
extern volatile int start_eNB;
|
||||
extern volatile int start_UE;
|
||||
#endif
|
||||
|
||||
typedef struct threads_s {
|
||||
int iq;
|
||||
int odd;
|
||||
int even;
|
||||
} threads_t;
|
||||
extern threads_t threads;
|
||||
|
||||
extern void exit_fun(const char* s);
|
||||
// In lte-enb.c
|
||||
extern int setup_eNB_buffers(PHY_VARS_eNB **phy_vars_eNB, openair0_config_t *openair0_cfg);
|
||||
extern void init_eNB(eNB_func_t *, eNB_timing_t *,int,eth_params_t *,int,int);
|
||||
extern void stop_eNB(int);
|
||||
extern void kill_eNB_proc(int inst);
|
||||
|
||||
// In lte-ue.c
|
||||
extern int setup_ue_buffers(PHY_VARS_UE **phy_vars_ue, openair0_config_t *openair0_cfg);
|
||||
extern void fill_ue_band_info(void);
|
||||
extern void init_UE(int);
|
||||
extern void reset_opp_meas(void);
|
||||
extern void print_opp_meas(void);
|
||||
|
||||
extern void init_fep_thread(PHY_VARS_eNB *, pthread_attr_t *);
|
||||
extern void init_td_thread(PHY_VARS_eNB *, pthread_attr_t *);
|
||||
extern void init_te_thread(PHY_VARS_eNB *, pthread_attr_t *);
|
||||
|
||||
#endif
|
||||
+701
-1654
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user