From 9b97fd9b62010f09ef19df161f183c92dab127a2 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 23 Oct 2025 19:27:15 +0200 Subject: [PATCH] Measure tx_func()/rx_func() job duration --- executables/nr-gnb.c | 8 ++++++++ openair1/PHY/defs_gNB.h | 3 +++ 2 files changed, 11 insertions(+) diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c index 505adf825c..2be0ee80ad 100644 --- a/executables/nr-gnb.c +++ b/executables/nr-gnb.c @@ -147,7 +147,9 @@ void *L1_rx_thread(void *arg) if (res == NULL) break; processingData_L1_t *info = (processingData_L1_t *)NotifiedFifoData(res); + start_meas(&gNB->l1_rx_proc); rx_func(info); + stop_meas(&gNB->l1_rx_proc); delNotifiedFIFO_elt(res); } return NULL; @@ -161,7 +163,9 @@ void *L1_tx_thread(void *arg) { if (res == NULL) // stopping condition, happens only when queue is freed break; processingData_L1tx_t *info = (processingData_L1tx_t *)NotifiedFifoData(res); + start_meas(&gNB->l1_tx_proc); tx_func(info); + stop_meas(&gNB->l1_tx_proc); delNotifiedFIFO_elt(res); } return NULL; @@ -226,6 +230,8 @@ static void rx_func(processingData_L1_t *info) static size_t dump_L1_meas_stats(PHY_VARS_gNB *gNB, RU_t *ru, char *output, size_t outputlen) { const char *begin = output; const char *end = output + outputlen; + output += print_meas_log(&gNB->l1_tx_proc, "L1 Tx job", NULL, NULL, output, end - output); + output += print_meas_log(&gNB->l1_rx_proc, "L1 Rx job", NULL, NULL, output, end - output); output += print_meas_log(&gNB->phy_proc_tx, "L1 Tx processing", NULL, NULL, output, end - output); output += print_meas_log(&gNB->dlsch_encoding_stats, "DLSCH encoding", NULL, NULL, output, end - output); output += print_meas_log(&gNB->dlsch_scrambling_stats, "DLSCH scrambling", NULL, NULL, output, end-output); @@ -290,6 +296,8 @@ void *nrL1_stats_thread(void *param) { return NULL; } + reset_meas(&gNB->l1_tx_proc); + reset_meas(&gNB->l1_rx_proc); reset_meas(&gNB->phy_proc_tx); reset_meas(&gNB->dlsch_encoding_stats); reset_meas(&gNB->phy_proc_rx); diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index fb549d4734..aec28272ef 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -494,6 +494,9 @@ typedef struct PHY_VARS_gNB_s { bool enable_analog_das; + time_stats_t l1_tx_proc; + time_stats_t l1_rx_proc; + time_stats_t phy_proc_tx; time_stats_t phy_proc_rx; time_stats_t rx_prach;