diff --git a/openair2/LAYER2/NR_MAC_gNB/main.c b/openair2/LAYER2/NR_MAC_gNB/main.c index 14c75deb26..5aa4f10a8c 100644 --- a/openair2/LAYER2/NR_MAC_gNB/main.c +++ b/openair2/LAYER2/NR_MAC_gNB/main.c @@ -166,21 +166,15 @@ size_t dump_mac_stats(gNB_MAC_INST *gNB, char *output, size_t strlen, bool reset UE->rnti, stats->ulsch_total_bytes_scheduled, stats->ul.total_bytes); - for (int lc_id = 0; lc_id < 63; lc_id++) { - if (stats->dl.lc_bytes[lc_id] > 0) - output += snprintf(output, - end - output, - "UE %04x: LCID %d: %"PRIu64" bytes TX\n", - UE->rnti, - lc_id, - stats->dl.lc_bytes[lc_id]); - if (stats->ul.lc_bytes[lc_id] > 0) - output += snprintf(output, - end - output, - "UE %04x: LCID %d: %"PRIu64" bytes RX\n", - UE->rnti, - lc_id, - stats->ul.lc_bytes[lc_id]); + for (int i = 0; i < sched_ctrl->dl_lc_num; i++) { + int lc_id = sched_ctrl->dl_lc_ids[i]; + output += snprintf(output, + end - output, + "UE %04x: LCID %d: TX %14"PRIu64" RX %14"PRIu64" bytes\n", + UE->rnti, + lc_id, + stats->dl.lc_bytes[lc_id], + stats->ul.lc_bytes[lc_id]); } } NR_SCHED_UNLOCK(&gNB->UE_info.mutex);