Commit 96dfb44a authored by Robert Schmidt's avatar Robert Schmidt

Print DU information in periodic RRC stats printing

parent 59a25c48
...@@ -2212,12 +2212,23 @@ static void write_rrc_stats(const gNB_RRC_INST *rrc) ...@@ -2212,12 +2212,23 @@ static void write_rrc_stats(const gNB_RRC_INST *rrc)
fprintf(f, " PDU session %d ID %d status %s\n", nb_pdu, pdu->param.pdusession_id, get_pdusession_status_text(pdu->status)); fprintf(f, " PDU session %d ID %d status %s\n", nb_pdu, pdu->param.pdusession_id, get_pdusession_status_text(pdu->status));
} }
fprintf(f, " associated DU: ");
if (ue_data.du_assoc_id == -1)
fprintf(f, " (local/integrated CU-DU)");
else if (ue_data.du_assoc_id == 0)
fprintf(f, " DU offline/unavailable");
else
fprintf(f, " DU assoc ID %d", ue_data.du_assoc_id);
fprintf(f, "\n");
if (ue_ctxt->measResults) if (ue_ctxt->measResults)
print_rrc_meas(f, ue_ctxt->measResults); print_rrc_meas(f, ue_ctxt->measResults);
++i; ++i;
} }
fprintf(f, "\n");
dump_du_info(rrc, f);
fclose(f); fclose(f);
} }
......
...@@ -257,3 +257,22 @@ nr_rrc_du_container_t *get_du_by_assoc_id(gNB_RRC_INST *rrc, sctp_assoc_t assoc_ ...@@ -257,3 +257,22 @@ nr_rrc_du_container_t *get_du_by_assoc_id(gNB_RRC_INST *rrc, sctp_assoc_t assoc_
nr_rrc_du_container_t e = {.assoc_id = assoc_id}; nr_rrc_du_container_t e = {.assoc_id = assoc_id};
return RB_FIND(rrc_du_tree, &rrc->dus, &e); return RB_FIND(rrc_du_tree, &rrc->dus, &e);
} }
void dump_du_info(const gNB_RRC_INST *rrc, FILE *f)
{
fprintf(f, "%ld connected DUs \n", rrc->num_dus);
int i = 1;
nr_rrc_du_container_t *du = NULL;
/* cast is necessary to eliminate warning "discards ‘const’ qualifier" */
RB_FOREACH(du, rrc_du_tree, &((gNB_RRC_INST *)rrc)->dus) {
const f1ap_setup_req_t *sr = du->setup_req;
fprintf(f, "[%d] DU ID %ld (%s) ", i++, sr->gNB_DU_id, sr->gNB_DU_name);
if (du->assoc_id == -1) {
fprintf(f, "integrated DU-CU");
} else {
fprintf(f, "assoc_id %d", du->assoc_id);
}
const f1ap_served_cell_info_t *info = &sr->cell[0].info;
fprintf(f, ": nrCellID %ld, PCI %d\n", info->nr_cellid, info->nr_pci);
}
}
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include <netinet/in.h> #include <netinet/in.h>
#include <netinet/sctp.h> #include <netinet/sctp.h>
#include <stdint.h> #include <stdint.h>
#include <stdio.h>
struct f1ap_setup_req_s; struct f1ap_setup_req_s;
struct f1ap_lost_connection_t; struct f1ap_lost_connection_t;
...@@ -37,4 +38,6 @@ void rrc_CU_process_f1_lost_connection(struct gNB_RRC_INST_s *rrc, struct f1ap_l ...@@ -37,4 +38,6 @@ void rrc_CU_process_f1_lost_connection(struct gNB_RRC_INST_s *rrc, struct f1ap_l
struct nr_rrc_du_container_t *get_du_for_ue(struct gNB_RRC_INST_s *rrc, uint32_t ue_id); struct nr_rrc_du_container_t *get_du_for_ue(struct gNB_RRC_INST_s *rrc, uint32_t ue_id);
struct nr_rrc_du_container_t *get_du_by_assoc_id(struct gNB_RRC_INST_s *rrc, sctp_assoc_t assoc_id); struct nr_rrc_du_container_t *get_du_by_assoc_id(struct gNB_RRC_INST_s *rrc, sctp_assoc_t assoc_id);
void dump_du_info(const struct gNB_RRC_INST_s *rrc, FILE *f);
#endif /* RRC_GNB_DU_H_ */ #endif /* RRC_GNB_DU_H_ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment