diff --git a/common/utils/threadPool/thread-pool.h b/common/utils/threadPool/thread-pool.h index da4e9cb04c..6df98e2ba4 100644 --- a/common/utils/threadPool/thread-pool.h +++ b/common/utils/threadPool/thread-pool.h @@ -169,6 +169,18 @@ static inline notifiedFIFO_elt_t *pollNotifiedFIFO(notifiedFIFO_t *nf) { return ret; } +static inline time_stats_t exec_time_stats_NotifiedFIFO(const notifiedFIFO_elt_t* elt) +{ + time_stats_t ts = {0}; + ts.in = elt->startProcessingTime; + ts.diff = elt->endProcessingTime - ts.in; + ts.p_time = ts.diff; + ts.diff_square = ts.diff * ts.diff; + ts.max = ts.diff; + ts.trials = 1; + return ts; +} + // This function aborts all messages matching the key // If the queue is used in thread pools, it doesn't cancels already running processing // because the message has already been picked diff --git a/common/utils/time_meas.h b/common/utils/time_meas.h index 98c4b3fe8a..81a1a893cd 100644 --- a/common/utils/time_meas.h +++ b/common/utils/time_meas.h @@ -178,7 +178,7 @@ static inline void copy_meas(time_stats_t *dst_ts,time_stats_t *src_ts) { } } -static inline void merge_meas(time_stats_t *dst_ts, time_stats_t *src_ts) +static inline void merge_meas(time_stats_t *dst_ts, const time_stats_t *src_ts) { if (!opp_enabled) return; diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c index cf48a1c3fd..9f3f2e36bf 100644 --- a/executables/nr-gnb.c +++ b/executables/nr-gnb.c @@ -423,7 +423,7 @@ void init_gNB_Tpool(int inst) { s_offset += 3; } if (getenv("noThreads")) strcpy(pool, "n"); - initTpool(pool, gNB->threadPool, false); + initTpool(pool, gNB->threadPool, true); // ULSCH decoder result FIFO gNB->respDecode = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t)); initNotifiedFIFO(gNB->respDecode); diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index 7d5cb285b5..78ed890aef 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -973,7 +973,6 @@ typedef struct processingData_L1tx { uint16_t num_pdsch_slot; int num_dl_pdcch; int num_ul_pdcch; - time_stats_t phy_proc_tx; } processingData_L1tx_t; #endif diff --git a/openair1/SCHED_NR/fapi_nr_l1.c b/openair1/SCHED_NR/fapi_nr_l1.c index 78e722c4b5..4b9f9534f0 100644 --- a/openair1/SCHED_NR/fapi_nr_l1.c +++ b/openair1/SCHED_NR/fapi_nr_l1.c @@ -165,8 +165,8 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){ notifiedFIFO_elt_t *res; res = pullTpool(gNB->L1_tx_free, gNB->threadPool); processingData_L1tx_t *msgTx = (processingData_L1tx_t *)NotifiedFifoData(res); - - merge_meas(&gNB->phy_proc_tx, &msgTx->phy_proc_tx); + const time_stats_t ts = exec_time_stats_NotifiedFIFO(res); + merge_meas(&gNB->phy_proc_tx, &ts); msgTx->num_pdsch_slot=0; msgTx->num_dl_pdcch=0; diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index bc4493cd1c..1ddf4b0d07 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -134,11 +134,6 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_gNB_TX+offset,1); - if (do_meas==1) { - reset_meas(&msgTx->phy_proc_tx); - start_meas(&msgTx->phy_proc_tx); - } - // clear the transmit data array and beam index for the current slot for (aa=0; aacarrier_config.num_tx_ant.value; aa++) { memset(&gNB->common_vars.txdataF[aa][txdataF_offset],0,fp->samples_per_slot_wCP*sizeof(int32_t)); @@ -196,8 +191,6 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx, } VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_gNB_TX+offset,0); - - if (do_meas==1) stop_meas(&msgTx->phy_proc_tx); } void nr_postDecode(PHY_VARS_gNB *gNB, notifiedFIFO_elt_t *req) { diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 7363d1abd5..98b9e03a7e 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -999,7 +999,6 @@ int main(int argc, char **argv) msgDataTx->slot = slot; msgDataTx->frame = frame; memset(msgDataTx->ssb, 0, 64*sizeof(NR_gNB_SSB_t)); - reset_meas(&msgDataTx->phy_proc_tx); for (SNR = snr0; SNR < snr1; SNR += .2) {