From 04c6c34d24a7d3834a8751796ad61b14a606de62 Mon Sep 17 00:00:00 2001 From: Luis Pereira Date: Thu, 25 Jan 2024 09:49:08 +0100 Subject: [PATCH] NR MAC stats: make more compact, update CI checker - show MAC bytes in one line - add MCS table idx - show ulsch errors before ulsch DTX (as in DL) - show if UE in-sync/out-of-sync - show CU UE ID next to RNTI to stats Since we modify the format of the statistics, fix the format in the retx checkers of the CI. --- ci-scripts/ran.py | 4 ++-- openair2/LAYER2/NR_MAC_gNB/main.c | 33 ++++++++++++++++++------------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index fc6bf1b42f..17a8b54d6d 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -992,7 +992,7 @@ class RANManagement(): NSA_RAPROC_PUSCH_check = 1 # Collect information on UE DLSCH and ULSCH statistics - keys = {'dlsch_rounds','dlsch_total_bytes','ulsch_rounds','ulsch_total_bytes_scheduled'} + keys = {'dlsch_rounds','ulsch_rounds'} for k in keys: result = re.search(k, line) if result is None: @@ -1161,7 +1161,7 @@ class RANManagement(): dlcheckers = [] if 'd_retx_th' not in checkers else checkers['d_retx_th'] retx_status[ue]['dl'] = self._analyzeUeRetx(dlulstat['dlsch_rounds'], dlcheckers, r'^.*dlsch_rounds\s+(\d+)\/(\d+)\/(\d+)\/(\d+),\s+dlsch_errors\s+(\d+)') ulcheckers = [] if 'u_retx_th' not in checkers else checkers['u_retx_th'] - retx_status[ue]['ul'] = self._analyzeUeRetx(dlulstat['ulsch_rounds'], ulcheckers, r'^.*ulsch_rounds\s+(\d+)\/(\d+)\/(\d+)\/(\d+),\s+.*,\s+ulsch_errors\s+(\d+)') + retx_status[ue]['ul'] = self._analyzeUeRetx(dlulstat['ulsch_rounds'], ulcheckers, r'^.*ulsch_rounds\s+(\d+)\/(\d+)\/(\d+)\/(\d+),\s+ulsch_errors\s+(\d+)') #real time statistics diff --git a/openair2/LAYER2/NR_MAC_gNB/main.c b/openair2/LAYER2/NR_MAC_gNB/main.c index a1e8af3e5f..72689dd90d 100644 --- a/openair2/LAYER2/NR_MAC_gNB/main.c +++ b/openair2/LAYER2/NR_MAC_gNB/main.c @@ -85,7 +85,6 @@ void clear_mac_stats(gNB_MAC_INST *gNB) { size_t dump_mac_stats(gNB_MAC_INST *gNB, char *output, size_t strlen, bool reset_rsrp) { - int num = 1; const char *begin = output; const char *end = output + strlen; @@ -99,11 +98,19 @@ size_t dump_mac_stats(gNB_MAC_INST *gNB, char *output, size_t strlen, bool reset NR_mac_stats_t *stats = &UE->mac_stats; const int avg_rsrp = stats->num_rsrp_meas > 0 ? stats->cumul_rsrp / stats->num_rsrp_meas : 0; + output += snprintf(output, end - output, "UE RNTI %04x CU-UE-ID ", UE->rnti); + if (du_exists_f1_ue_data(UE->rnti)) { + f1_ue_data_t ued = du_get_f1_ue_data(UE->rnti); + output += snprintf(output, end - output, "%d", ued.secondary_ue); + } else { + output += snprintf(output, end-output, "(none)"); + } + + bool in_sync = !sched_ctrl->ul_failure; output += snprintf(output, end - output, - "UE RNTI %04x (%d) PH %d dB PCMAX %d dBm, average RSRP %d (%d meas)\n", - UE->rnti, - num++, + " %s PH %d dB PCMAX %d dBm, average RSRP %d (%d meas)\n", + in_sync ? "in-sync" : "out-of-sync", sched_ctrl->ph, sched_ctrl->pcmax, avg_rsrp, @@ -132,19 +139,16 @@ size_t dump_mac_stats(gNB_MAC_INST *gNB, char *output, size_t strlen, bool reset output += snprintf(output, end - output, - ", dlsch_errors %"PRIu64", pucch0_DTX %d, BLER %.5f MCS %d\n", + ", dlsch_errors %"PRIu64", pucch0_DTX %d, BLER %.5f MCS (%d) %d\n", stats->dl.errors, stats->pucch0_DTX, sched_ctrl->dl_bler_stats.bler, + UE->current_DL_BWP.mcsTableIdx, sched_ctrl->dl_bler_stats.mcs); if (reset_rsrp) { stats->num_rsrp_meas = 0; stats->cumul_rsrp = 0; } - output += snprintf(output, - end - output, - "UE %04x: dlsch_total_bytes %"PRIu64"\n", - UE->rnti, stats->dl.total_bytes); output += snprintf(output, end - output, "UE %04x: ulsch_rounds ", UE->rnti); @@ -154,16 +158,17 @@ size_t dump_mac_stats(gNB_MAC_INST *gNB, char *output, size_t strlen, bool reset output += snprintf(output, end - output, - ", ulsch_DTX %d, ulsch_errors %"PRIu64", BLER %.5f MCS %d\n", - stats->ulsch_DTX, + ", ulsch_errors %"PRIu64", ulsch_DTX %d, BLER %.5f MCS (%d) %d\n", stats->ul.errors, + stats->ulsch_DTX, sched_ctrl->ul_bler_stats.bler, + UE->current_UL_BWP.mcs_table, sched_ctrl->ul_bler_stats.mcs); + output += snprintf(output, end - output, - "UE %04x: ulsch_total_bytes_scheduled %"PRIu64", ulsch_total_bytes_received %"PRIu64"\n", - UE->rnti, - stats->ulsch_total_bytes_scheduled, stats->ul.total_bytes); + "UE %04x: MAC: TX %14"PRIu64" RX %14"PRIu64" bytes\n", + UE->rnti, stats->dl.total_bytes, stats->ul.total_bytes); for (int i = 0; i < sched_ctrl->dl_lc_num; i++) { int lc_id = sched_ctrl->dl_lc_ids[i];