From b2275c7b48a598c1d61785bdc754e428aa063a7e Mon Sep 17 00:00:00 2001 From: Wang Tsu-Han Date: Fri, 20 Sep 2019 15:39:17 +0200 Subject: [PATCH] adding time stats for ru --- executables/nr-ru.c | 8 ++++++-- openair1/PHY/defs_RU.h | 6 +++++- openair1/SCHED_NR/nr_ru_procedures.c | 21 ++++++++++++--------- 3 files changed, 23 insertions(+), 12 deletions(-) diff --git a/executables/nr-ru.c b/executables/nr-ru.c index 6d03172de3..2b2ae6530d 100644 --- a/executables/nr-ru.c +++ b/executables/nr-ru.c @@ -1214,12 +1214,16 @@ static void *ru_stats_thread(void *param) { if (opp_enabled == 1) { if (ru->feptx_prec) { - print_meas(&ru->total_precoding_stats,"feptx_prec",NULL,NULL); + print_meas(&ru->precoding_stats,"feptx_prec",NULL,NULL); } if (ru->feprx) print_meas(&ru->ofdm_demod_stats,"feprx",NULL,NULL); - if (ru->feptx_ofdm) print_meas(&ru->ofdm_mod_stats,"feptx_ofdm",NULL,NULL); + if (ru->feptx_ofdm){ + print_meas(&ru->txdataF_copy_stats,"txdataF_copy",NULL,NULL); + print_meas(&ru->ofdm_mod_stats,"feptx_ofdm",NULL,NULL); + print_meas(&ru->ofdm_total_stats,"feptx_total",NULL,NULL); + } if (ru->fh_north_asynch_in) print_meas(&ru->rx_fhaul,"rx_fhaul",NULL,NULL); diff --git a/openair1/PHY/defs_RU.h b/openair1/PHY/defs_RU.h index ec5b0f8fdc..48b4ee61b6 100644 --- a/openair1/PHY/defs_RU.h +++ b/openair1/PHY/defs_RU.h @@ -566,12 +566,16 @@ typedef struct RU_t_s{ void (*eNB_top)(struct PHY_VARS_eNB_s *eNB, int frame_rx, int subframe_rx, char *string, struct RU_t_s *ru); void (*gNB_top)(struct PHY_VARS_gNB_s *gNB, int frame_rx, int slot_rx, char *string, struct RU_t_s *ru); + /// Timing data copy statistics (TX) + time_stats_t txdataF_copy_stats; /// Timing statistics (TX) - time_stats_t total_precoding_stats; + time_stats_t precoding_stats; /// Timing statistics time_stats_t ofdm_demod_stats; /// Timing statistics (TX) time_stats_t ofdm_mod_stats; + /// Timing statistics (TX) + time_stats_t ofdm_total_stats; /// Timing wait statistics time_stats_t ofdm_demod_wait_stats; /// Timing wakeup statistics diff --git a/openair1/SCHED_NR/nr_ru_procedures.c b/openair1/SCHED_NR/nr_ru_procedures.c index 7fbe2e6552..7fff0af177 100644 --- a/openair1/SCHED_NR/nr_ru_procedures.c +++ b/openair1/SCHED_NR/nr_ru_procedures.c @@ -125,12 +125,12 @@ void nr_feptx_ofdm_2thread(RU_t *ru,int frame_tx,int tti_tx) { int nb_antenna_ports = 8; int ofdm_mask_full = (1<<(ru->nb_tx*2))-1; - start_meas(&ru->ofdm_mod_stats); + start_meas(&ru->ofdm_total_stats); for(j=0; jsymbols_per_slot; ++j){ VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC , 1); - start_meas(&ru->total_precoding_stats); + start_meas(&ru->txdataF_copy_stats); if (ru->num_gNB == 1){ gNB = ru->gNB_list[0]; cfg = &gNB->gNB_config; @@ -143,7 +143,7 @@ void nr_feptx_ofdm_2thread(RU_t *ru,int frame_tx,int tti_tx) { } }//num_gNB == 1 //printf("~~~~~~~~~~~memery copy index: nb_antenna_ports = %d, samples_per_slot_wCP = %d\n", nb_antenna_ports, fp->samples_per_slot_wCP); - stop_meas(&ru->total_precoding_stats); + stop_meas(&ru->txdataF_copy_stats); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC , 0); @@ -205,7 +205,7 @@ void nr_feptx_ofdm_2thread(RU_t *ru,int frame_tx,int tti_tx) { //write_output - stop_meas(&ru->ofdm_mod_stats); + stop_meas(&ru->ofdm_total_stats); } @@ -235,6 +235,7 @@ static void *nr_feptx_thread(void *param) { ofdm_mask_full = (1<<(ru->nb_tx*2))-1; bw = ru->beam_weights[0]; + start_meas(&ru->precoding_stats); nr_beam_precoding(ru->common.txdataF, ru->common.txdataF_BF, fp, @@ -243,9 +244,11 @@ static void *nr_feptx_thread(void *param) { l+start, aa, nb_antenna_ports); + stop_meas(&ru->precoding_stats); - + start_meas(&ru->ofdm_mod_stats); nr_feptx0(ru,slot,start,1,aa); + stop_meas(&ru->ofdm_mod_stats); if (release_thread(&feptx->mutex_feptx,&feptx->instance_cnt_feptx,"NR feptx thread")<0) break; @@ -363,7 +366,7 @@ void nr_feptx_prec_control(RU_t *ru,int frame,int tti_tx) { gNB = gNB_list[0]; - start_meas(&ru->total_precoding_stats); + start_meas(&ru->precoding_stats); for(i=0; icommon.txdataF[i], (void*)gNB->common_vars.txdataF[i], @@ -400,7 +403,7 @@ void nr_feptx_prec_control(RU_t *ru,int frame,int tti_tx) { if(i == 16) break; } - stop_meas(&ru->total_precoding_stats); + stop_meas(&ru->precoding_stats); } void nr_feptx_prec(RU_t *ru,int frame,int tti_tx) { @@ -412,7 +415,7 @@ void nr_feptx_prec(RU_t *ru,int frame,int tti_tx) { int32_t ***bw; int i=0; - start_meas(&ru->total_precoding_stats); + start_meas(&ru->precoding_stats); if (ru->num_gNB == 1){ gNB = gNB_list[0]; cfg = &gNB->gNB_config; @@ -455,7 +458,7 @@ void nr_feptx_prec(RU_t *ru,int frame,int tti_tx) { }// for (l=0;lsymbols_per_slot;l++) }// if (ru->nb_tx == 1) }// if (ru->num_gNB == 1) - stop_meas(&ru->total_precoding_stats); + stop_meas(&ru->precoding_stats); } void nr_init_feptx_prec_thread(RU_t *ru){