From 80b89510b7d41673cef6783bca87a358f6399754 Mon Sep 17 00:00:00 2001
From: Laurent <laurent.thomas@open-cells.com>
Date: Thu, 17 Oct 2019 15:15:19 +0200
Subject: [PATCH] add cu and full loop measurements

---
 executables/main-fs6.c | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/executables/main-fs6.c b/executables/main-fs6.c
index 074b4c8770..42b016919c 100644
--- a/executables/main-fs6.c
+++ b/executables/main-fs6.c
@@ -1464,11 +1464,22 @@ void *cu_fs6(void *arg) {
 
   AssertFatal(createUDPsock(NULL, CU_PORT, remoteIP, DU_PORT, &sockFS6), "");
   uint64_t timeStamp=0;
+  initStaticTime(begingWait);
+  initStaticTime(begingWait2);
+  initRefTimes(waitDUAndProcessingUL);
+  initRefTimes(makeSendDL);
+    initRefTimes(fullLoop);
 
   while(1) {
     timeStamp+=ru->frame_parms.samples_per_tti;
+    updateTimes(begingWait, &fullLoop, 1000, "CU for full SubFrame (must be less 1ms)");
+    pickStaticTime(begingWait);
+    updateTimes(begingWait, &waitDUAndProcessingUL, 1000, "CU Time in wait Rx + Ul processing");
     UL_cu_fs6(ru, &timeStamp);
+    pickStaticTime(begingWait2);
     DL_cu_fs6(ru);
+    updateTimes(begingWait2, &makeSendDL, 1000, "CU Time in DL build+send");
+
   }
 
   return NULL;
@@ -1498,17 +1509,20 @@ void *du_fs6(void *arg) {
   } else LOG_I(PHY,"RU %d no rf device\n",ru->idx);
 
   initStaticTime(begingWait);
-  initRefTimes(waitRxAndProcessingUL);
+   initStaticTime(begingWait2);
+ initRefTimes(waitRxAndProcessingUL);
   initRefTimes(makeSendDL);
+  initRefTimes(fullLoop);
    
   while(1) {
     L1_proc_t *proc = &ru->eNB_list[0]->proc;
+    updateTimes(begingWait, &fullLoop, 1000, "DU for full SubFrame (must be less 1ms)");
     pickStaticTime(begingWait);
     UL_du_fs6(ru, proc->frame_rx,proc->subframe_rx);
     updateTimes(begingWait, &waitRxAndProcessingUL, 1000, "DU Time in wait Rx + Ul processing");
-    pickStaticTime(begingWait);
+    pickStaticTime(begingWait2);
     DL_du_fs6(ru);
-    updateTimes(begingWait, &makeSendDL, 1000, "DU Time in build and send Tx");
+    updateTimes(begingWait2, &makeSendDL, 1000, "DU Time in build and send Tx");
   }
 
   return NULL;
-- 
2.26.2