From 8758d3d4cfda284e5fcf6862b9fb45334db8e580 Mon Sep 17 00:00:00 2001
From: gabrielC <couturier.gabriel@gmail.com>
Date: Mon, 22 May 2017 17:26:03 +0200
Subject: [PATCH] --ue-no-log, add printf to verify attach is ok

---
 openair1/PHY/INIT/lte_parms.c               |  2 +-
 openair1/PHY/LTE_TRANSPORT/drs_modulation.c |  2 +-
 openair1/PHY/LTE_TRANSPORT/initial_sync.c   | 10 +++++-----
 openair2/UTIL/LOG/log.h                     | 20 ++++++++++----------
 targets/RT/USER/lte-ue.c                    |  4 ++--
 5 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/openair1/PHY/INIT/lte_parms.c b/openair1/PHY/INIT/lte_parms.c
index f0c63df9e6..900b5edfc7 100644
--- a/openair1/PHY/INIT/lte_parms.c
+++ b/openair1/PHY/INIT/lte_parms.c
@@ -44,7 +44,7 @@ int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf)
 
   uint8_t log2_osf;
 
-  LOG_I(PHY,"Initializing frame parms for N_RB_DL %d, Ncp %d, osf %d\n",frame_parms->N_RB_DL,frame_parms->Ncp,osf);
+  printf("Initializing frame parms for N_RB_DL %d, Ncp %d, osf %d\n",frame_parms->N_RB_DL,frame_parms->Ncp,osf);
 
   if (frame_parms->Ncp==EXTENDED) {
     frame_parms->nb_prefix_samples0=512;
diff --git a/openair1/PHY/LTE_TRANSPORT/drs_modulation.c b/openair1/PHY/LTE_TRANSPORT/drs_modulation.c
index 170ca4ce76..861a25fabb 100644
--- a/openair1/PHY/LTE_TRANSPORT/drs_modulation.c
+++ b/openair1/PHY/LTE_TRANSPORT/drs_modulation.c
@@ -87,7 +87,7 @@ int generate_drs_pusch(PHY_VARS_UE *ue,
   if (Msc_idx_ptr)
     Msc_RS_idx = Msc_idx_ptr - dftsizes;
   else {
-    printf("generate_drs_pusch: index for Msc_RS=%d not found\n",Msc_RS);
+    LOG_I(PHY,"generate_drs_pusch: index for Msc_RS=%d not found\n",Msc_RS);
     return(-1);
   }
 
diff --git a/openair1/PHY/LTE_TRANSPORT/initial_sync.c b/openair1/PHY/LTE_TRANSPORT/initial_sync.c
index c29562b6cd..46680d8de8 100644
--- a/openair1/PHY/LTE_TRANSPORT/initial_sync.c
+++ b/openair1/PHY/LTE_TRANSPORT/initial_sync.c
@@ -466,13 +466,13 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode)
   if( (abs(ue->common_vars.freq_offset) > 150) && (ret == 0) )
   {
 	  ret=-1;
-	  LOG_E(HW,"Ignore MIB with high freq offset [%d Hz] estimation \n",ue->common_vars.freq_offset);
+	  printf("Ignore MIB with high freq offset [%d Hz] estimation \n",ue->common_vars.freq_offset);
   }
 
   if (ret==0) {  // PBCH found so indicate sync to higher layers and configure frame parameters
 
     //#ifdef DEBUG_INITIAL_SYNCH
-    LOG_I(PHY,"[UE%d] In synch, rx_offset %d samples\n",ue->Mod_id, ue->rx_offset);
+    printf("[UE%d] In synch, rx_offset %d samples\n",ue->Mod_id, ue->rx_offset);
     //#endif
 
     if (ue->UE_scan_carrier == 0) {
@@ -503,7 +503,7 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode)
 
     }
 
-    LOG_I(PHY,"[UE %d] Frame %d RRC Measurements => rssi %3.1f dBm (dig %3.1f dB, gain %d), N0 %d dBm,  rsrp %3.1f dBm/RE, rsrq %3.1f dB\n",ue->Mod_id,
+    printf("[UE %d] Frame %d RRC Measurements => rssi %3.1f dBm (dig %3.1f dB, gain %d), N0 %d dBm,  rsrp %3.1f dBm/RE, rsrq %3.1f dB\n",ue->Mod_id,
 	  ue->proc.proc_rxtx[0].frame_rx,
 	  10*log10(ue->measurements.rssi)-ue->rx_total_gain_dB,
 	  10*log10(ue->measurements.rssi),
@@ -513,7 +513,7 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode)
 	  (10*log10(ue->measurements.rsrq[0])));
     
     
-    LOG_I(PHY,"[UE %d] Frame %d MIB Information => %s, %s, NidCell %d, N_RB_DL %d, PHICH DURATION %d, PHICH RESOURCE %s, TX_ANT %d\n",
+    printf("[UE %d] Frame %d MIB Information => %s, %s, NidCell %d, N_RB_DL %d, PHICH DURATION %d, PHICH RESOURCE %s, TX_ANT %d\n",
 	  ue->Mod_id,
 	  ue->proc.proc_rxtx[0].frame_rx,
 	  duplex_string[ue->frame_parms.frame_type],
@@ -525,7 +525,7 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode)
 	  ue->frame_parms.nb_antenna_ports_eNB);
 
 #if defined(OAI_USRP) || defined(EXMIMO) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
-    LOG_I(PHY,"[UE %d] Frame %d Measured Carrier Frequency %.0f Hz (offset %d Hz)\n",
+    printf("[UE %d] Frame %d Measured Carrier Frequency %.0f Hz (offset %d Hz)\n",
 	  ue->Mod_id,
 	  ue->proc.proc_rxtx[0].frame_rx,
 	  openair0_cfg[0].rx_freq[0]-ue->common_vars.freq_offset,
diff --git a/openair2/UTIL/LOG/log.h b/openair2/UTIL/LOG/log.h
index 9e6ab36adc..c266343725 100644
--- a/openair2/UTIL/LOG/log.h
+++ b/openair2/UTIL/LOG/log.h
@@ -316,16 +316,16 @@ void *log_thread_function(void * list);
 #    define LOG_F(c, x...) /* */
 #  else /* T_TRACER */
 #    if UE_NO_LOG
-#        define LOG_I(c, x...) ((void)0)
-#        define LOG_W(c, x...) ((void)0)
-#        define LOG_E(c, x...) ((void)0)
-#        define LOG_D(c, x...) ((void)0)
-#        define LOG_T(c, x...) ((void)0)
-#        define LOG_G(c, x...) ((void)0)
-#        define LOG_A(c, x...) ((void)0)
-#        define LOG_C(c, x...) ((void)0)
-#        define LOG_N(c, x...) ((void)0)
-#        define LOG_F(c, x...) ((void)0)
+#        define LOG_I(c, x...) /* */
+#        define LOG_W(c, x...) /* */
+#        define LOG_E(c, x...) /* */
+#        define LOG_D(c, x...) /* */
+#        define LOG_T(c, x...) /* */
+#        define LOG_G(c, x...) /* */
+#        define LOG_A(c, x...) /* */
+#        define LOG_C(c, x...) /* */
+#        define LOG_N(c, x...) /* */
+#        define LOG_F(c, x...) /* */
 #    else  /*UE_NO_LOG*/
 #        define LOG_G(c, x...) logIt(c, LOG_EMERG, x)
 #        define LOG_A(c, x...) logIt(c, LOG_ALERT, x)
diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c
index 5dd0e66da0..c1ef741fd2 100644
--- a/targets/RT/USER/lte-ue.c
+++ b/targets/RT/USER/lte-ue.c
@@ -311,7 +311,7 @@ static void *UE_thread_synch(void *arg) {
 
         case pbch:
 
-            LOG_I(PHY,"[UE thread Synch] Running Initial Synch (mode %d)\n",UE->mode);
+            printf("[UE thread Synch] Running Initial Synch (mode %d)\n",UE->mode);
             if (initial_sync( UE, UE->mode ) == 0) {
 
                 hw_slot_offset = (UE->rx_offset<<1) / UE->frame_parms.samples_per_tti;
@@ -432,7 +432,7 @@ static void *UE_thread_synch(void *arg) {
                         return &UE_thread_synch_retval; // not reached
                     }
                 }
-                LOG_I( PHY, "[initial_sync] trying carrier off %d Hz, rxgain %d (DL %u, UL %u)\n",
+                printf("[initial_sync] trying carrier off %d Hz, rxgain %d (DL %u, UL %u)\n",
                        freq_offset,
                        UE->rx_total_gain_dB,
                        downlink_frequency[0][0]+freq_offset,
-- 
GitLab