From 409eadc9379ebe0d078ab235b99e69646a359e94 Mon Sep 17 00:00:00 2001
From: Wang Tsu-Han <wangts@eurecom.fr>
Date: Thu, 14 Dec 2017 17:17:31 +0100
Subject: [PATCH] measuring time for coding worker

---
 openair1/PHY/LTE_TRANSPORT/dlsch_coding.c | 10 ++++------
 targets/RT/USER/lte-enb.c                 |  9 +++++++--
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c b/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c
index c9b1683cb2..fc087679c9 100644
--- a/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c
+++ b/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c
@@ -560,14 +560,13 @@ void *te_thread(void *param) {
 
   PHY_VARS_eNB *eNB              = ((te_params *)param)->eNB;
   eNB_proc_t *proc               = &eNB->proc;
-  time_stats_t *te_wakeup_stats0 = &eNB->dlsch_turbo_encoding_wakeup_stats0;
   while (!oai_exit) {
 
     if (wait_on_condition(&proc->mutex_te[0],&proc->cond_te[0],&proc->instance_cnt_te[0],"te thread")<0) break;
 
-    //stop_meas(te_wakeup_stats0);
+    start_meas(&eNB->dlsch_turbo_encoding_wakeup_stats0);
     dlsch_encoding_2threads0((te_params*)param);
-
+    stop_meas(&eNB->dlsch_turbo_encoding_wakeup_stats0);
 
     if (release_thread(&proc->mutex_te[0],&proc->instance_cnt_te[0],"te thread")<0) break;
 
@@ -598,15 +597,14 @@ void *te_thread1(void *param) {
 
   PHY_VARS_eNB *eNB              = ((te_params *)param)->eNB;
   eNB_proc_t *proc               = &eNB->proc;
-  time_stats_t *te_wakeup_stats1 = &eNB->dlsch_turbo_encoding_wakeup_stats1;
   while (!oai_exit) {
 
 
     if (wait_on_condition(&proc->mutex_te[1],&proc->cond_te[1],&proc->instance_cnt_te[1],"te thread 1")<0) break;
 
-    //stop_meas(te_wakeup_stats1);
+    start_meas(&eNB->dlsch_turbo_encoding_wakeup_stats1);
     dlsch_encoding_2threads1((te_params*)param);
-
+    stop_meas(&eNB->dlsch_turbo_encoding_wakeup_stats1);
 
     if (release_thread(&proc->mutex_te[1],&proc->instance_cnt_te[1],"te thread 1")<0) break;
 
diff --git a/targets/RT/USER/lte-enb.c b/targets/RT/USER/lte-enb.c
index 636fa9d9cf..0f69f7be7b 100644
--- a/targets/RT/USER/lte-enb.c
+++ b/targets/RT/USER/lte-enb.c
@@ -704,8 +704,13 @@ static void* process_stats_thread(void* param) {
      sleep(1);
      if (opp_enabled == 1) {
        if (eNB->td) print_meas(&eNB->ulsch_decoding_stats,"ulsch_decoding",NULL,NULL);
-       if (eNB->te) print_meas(&eNB->dlsch_encoding_stats,"dlsch_encoding",NULL,NULL);
-	   print_meas(&eNB->dlsch_modulation_stats,"dlsch_modulation",NULL,NULL);
+       if (eNB->te)
+       {
+         print_meas(&eNB->dlsch_encoding_stats,"dlsch_encoding",NULL,NULL);
+         print_meas(&eNB->dlsch_turbo_encoding_wakeup_stats0,"coding_worker_0",NULL,NULL);
+         print_meas(&eNB->dlsch_turbo_encoding_wakeup_stats1,"coding_worker_1",NULL,NULL);
+	   }
+       print_meas(&eNB->dlsch_modulation_stats,"dlsch_modulation",NULL,NULL);
      }
   }
   return(NULL);
-- 
GitLab