From f7bb1367f5533a74b6323f06cabab45cd1d95f59 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 19 Dec 2024 14:31:35 +0100 Subject: [PATCH 1/2] print UE statistics only in connected mode --- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index 44118704a4..03071d9cf4 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -70,6 +70,8 @@ static void save_pdsch_pdu_for_crnti(nfapi_nr_dl_tti_request_t *dl_tti_request); void print_ue_mac_stats(const module_id_t mod, const int frame_rx, const int slot_rx) { NR_UE_MAC_INST_t *mac = get_mac_inst(mod); + if (mac->state != UE_CONNECTED) + return; int ret = pthread_mutex_lock(&mac->if_mutex); AssertFatal(!ret, "mutex failed %d\n", ret); From 7b499f5081594d3ba43ca6265e81557da3925f13 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 19 Dec 2024 14:46:53 +0100 Subject: [PATCH 2/2] print UE statistics also in FDD --- executables/nr-ue.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 78abb7b081..07e6b54db7 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -641,8 +641,9 @@ static int UE_dl_preprocessing(PHY_VARS_NR_UE *UE, } } + bool dl_slot = false; if (proc->rx_slot_type == NR_DOWNLINK_SLOT || proc->rx_slot_type == NR_MIXED_SLOT) { - + dl_slot = true; if(UE->if_inst != NULL && UE->if_inst->dl_indication != NULL) { nr_downlink_indication_t dl_indication; nr_fill_dl_indication(&dl_indication, NULL, NULL, proc, UE, phy_data); @@ -655,7 +656,8 @@ static int UE_dl_preprocessing(PHY_VARS_NR_UE *UE, const int ack_nack_slot = (proc->nr_slot_rx + phy_data->dlsch[0].dlsch_config.k1_feedback) % UE->frame_parms.slots_per_frame; tx_wait_for_dlsch[ack_nack_slot]++; } - } else { + } + if (fp->frame_type == FDD || !dl_slot) { // good time to print statistics, we don't have to spend time to decode DCI if (proc->frame_rx % 128 == 0) { if (*stats_printed == false) {