realtime for UE
This commit is contained in:
@@ -255,7 +255,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", \
|
||||
|
||||
@@ -53,6 +53,26 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern double cpuf;
|
||||
static inline unsigned long long rdtsc(void) {
|
||||
unsigned long long a, d;
|
||||
__asm__ volatile ("rdtsc" : "=a" (a), "=d" (d));
|
||||
return (d<<32) | a;
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
#define check(a) checkT(a,__FILE__,__LINE__)
|
||||
|
||||
/** @defgroup _LOG LOG Generator
|
||||
* @{*/
|
||||
/* @}*/
|
||||
|
||||
Reference in New Issue
Block a user