From a9c72222dd7bf2e833ed833eef6216c2c92126ae Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 3 Oct 2024 12:25:13 +0200 Subject: [PATCH] minor: adding two logs for debugging --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c | 1 + openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c index bcd5cfb26c..80bb00cfac 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c @@ -116,6 +116,7 @@ void clear_beam_information(NR_beam_info_t *beam_info, int frame, int slot, int idx_to_clear = (idx_to_clear + beam_info->beam_allocation_size - 1) % beam_info->beam_allocation_size; if (slot % beam_info->beam_duration == 0) { // resetting previous period allocation + LOG_D(NR_MAC, "%d.%d Clear beam information for index %d\n", frame, slot, idx_to_clear); for (int i = 0; i < beam_info->beams_per_period; i++) beam_info->beam_allocation[i][idx_to_clear] = -1; } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 1b6998ed83..004a0394f6 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -3194,8 +3194,10 @@ NR_beam_alloc_t beam_allocation_procedure(NR_beam_info_t *beam_info, int frame, beam_struct.new_beam = true; *beam = beam_index; } - if (*beam == beam_index) + if (*beam == beam_index) { + LOG_D(NR_MAC, "%d.%d Using beam structure with index %d for beam %d (%s)\n", frame, slot, beam_struct.idx, beam_index, beam_struct.new_beam ? "new beam" : "old beam"); return beam_struct; + } } return (NR_beam_alloc_t) {.new_beam = false, .idx = -1}; @@ -3220,7 +3222,7 @@ void beam_selection_procedures(gNB_MAC_INST *mac, NR_UE_info_t *UE) if (UE->UE_beam_index == new_bf_index) return; // no beam change needed - LOG_I(NR_MAC, "Switching to beam with ID %d corresponding to SSB %d\n", new_bf_index, rsrp_report->resource_id[0]); + LOG_I(NR_MAC, "[UE %x] Switching to beam with ID %d (SSB number %d)\n", UE->rnti, new_bf_index, rsrp_report->resource_id[0]); UE->UE_beam_index = new_bf_index; }