nr-ip-over-LTE: Debug logs rearrangements

This commit is contained in:
Raymond Knopp
2019-09-26 19:45:28 +02:00
parent 175c813faf
commit 024a41424c
9 changed files with 47 additions and 44 deletions
+2 -2
View File
@@ -41,7 +41,7 @@
#include <stdio.h>
#include <math.h>
#define ENABLE_MAC_PAYLOAD_DEBUG 1
//#define ENABLE_MAC_PAYLOAD_DEBUG 1
extern void mac_rlc_data_ind (
const module_id_t module_idP,
@@ -228,7 +228,7 @@ int8_t nr_ue_decode_mib(
void *pduP,
uint16_t cell_id ){
LOG_D(MAC,"[L2][MAC] decode mib\n");
LOG_I(MAC,"[L2][MAC] decode mib\n");
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
@@ -35,6 +35,7 @@
#include "PHY/NR_TRANSPORT/nr_dci.h"
#include "executables/nr-softmodem.h"
extern RAN_CONTEXT_t RC;
//#define ENABLE_MAC_PAYLOAD_DEBUG 1
/*Scheduling of DLSCH with associated DCI in common search space
* current version has only a DCI for type 1 PDCCH for C_RNTI*/
@@ -459,10 +460,12 @@ void nr_schedule_uss_dlsch_phytest(module_id_t module_idP,
TBS_bytes = configure_fapi_dl_Tx(dl_req, TX_req, cfg, &nr_mac->coreset[CC_id][1], &nr_mac->search_space[CC_id][1], nr_mac->pdu_index[CC_id]);
LOG_I(MAC, "Printing first 10 payload bytes at the gNB side, Frame: %d, slot: %d, , TBS size: %d \n \n", frameP, slotP, TBS_bytes);
for(int i = 0; i < 10; i++) { // TBS_bytes dlsch_pdu_rel15->transport_block_size/8 6784/8
LOG_I(MAC, "%x. ", ((uint8_t *)nr_mac->UE_list.DLSCH_pdu[CC_id][0][0].payload[0])[i]);
}
#if defined(ENABLE_MAC_PAYLOAD_DEBUG)
LOG_I(MAC, "Printing first 10 payload bytes at the gNB side, Frame: %d, slot: %d, , TBS size: %d \n \n", frameP, slotP, TBS_bytes);
for(int i = 0; i < 10; i++) { // TBS_bytes dlsch_pdu_rel15->transport_block_size/8 6784/8
LOG_I(MAC, "%x. ", ((uint8_t *)nr_mac->UE_list.DLSCH_pdu[CC_id][0][0].payload[0])[i]);
}
#endif
//TX_req->segments[0].segment_length = 8;
TX_req->segments[0].segment_length = TBS_bytes +2;
@@ -487,12 +490,14 @@ void nr_schedule_uss_dlsch_phytest(module_id_t module_idP,
((uint8_t *)nr_mac->UE_list.DLSCH_pdu[CC_id][0][0].payload[0])[i] = (unsigned char) rand();
//LOG_I(MAC, "%x. ", ((uint8_t *)nr_mac->UE_list.DLSCH_pdu[CC_id][0][0].payload[0])[i]);
}
if (frameP%100 == 0){
LOG_I(MAC, "Printing first 10 payload bytes at the gNB side, Frame: %d, slot: %d, TBS size: %d \n", frameP, slotP, TBS_bytes);
for(int i = 0; i < 10; i++) {
LOG_I(MAC, "%x. ", ((uint8_t *)nr_mac->UE_list.DLSCH_pdu[CC_id][0][0].payload[0])[i]);
}
}
#if defined(ENABLE_MAC_PAYLOAD_DEBUG)
if (frameP%100 == 0){
LOG_I(MAC, "Printing first 10 payload bytes at the gNB side, Frame: %d, slot: %d, TBS size: %d \n", frameP, slotP, TBS_bytes);
for(int i = 0; i < 10; i++) {
LOG_I(MAC, "%x. ", ((uint8_t *)nr_mac->UE_list.DLSCH_pdu[CC_id][0][0].payload[0])[i]);
}
}
#endif
//TX_req->segments[0].segment_length = 8;
TX_req->segments[0].segment_length = TBS_bytes +2;
+5 -3
View File
@@ -1053,10 +1053,12 @@ pdcp_data_ind(
&sdu_buffer_pP->data[payload_offset],
sdu_buffer_sizeP - payload_offset);
LOG_I(PDCP, "Printing PDCP SDU before adding it to the list: \n");
for (int i=0; i<30; i++){
#if defined(ENABLE_PDCP_PAYLOAD_DEBUG)
LOG_I(PDCP, "Printing first bytes of PDCP SDU before adding it to the list: \n");
for (int i=0; i<30; i++){
LOG_I(PDCP, "%x", sdu_buffer_pP->data[i]);
}
}
#endif
list_add_tail_eurecom (new_sdu_p, sdu_list_p);
}
+2
View File
@@ -93,6 +93,8 @@ extern int pdcp_instance_cnt;
#define PROTOCOL_PDCP_CTXT_ARGS(CTXT_Pp, pDCP_Pp) PROTOCOL_CTXT_ARGS(CTXT_Pp),\
(pDCP_Pp->is_srb) ? "SRB" : "DRB",\
pDCP_Pp->rb_id
//#define ENABLE_PDCP_PAYLOAD_DEBUG 1
int init_pdcp_thread(void);
void cleanup_pdcp_thread(void);
+4 -1
View File
@@ -135,10 +135,13 @@ int pdcp_fifo_flush_sdus(const protocol_ctxt_t *const ctxt_pP) {
} // PDCP_USE_NETLINK
AssertFatal(ret >= 0,"[PDCP_FIFOS] pdcp_fifo_flush_sdus (errno: %d %s)\n", errno, strerror(errno));
LOG_I(PDCP, "Printing PDCP SDU before removing it from the list: \n");
#if defined(ENABLE_PDCP_PAYLOAD_DEBUG)
LOG_I(PDCP, "Printing first bytes of PDCP SDU before removing it from the list: \n");
for (int i=0; i<30; i++){
LOG_I(PDCP, "%x", sdu_p->data[i]);
}
#endif
list_remove_head (&pdcp_sdu_list);
free_mem_block (sdu_p, __func__);
pdcp_nb_sdu_sent ++;
+1 -14
View File
@@ -726,7 +726,6 @@ void rlc_um_check_timer_dar_time_out(
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RLC_UM_CHECK_TIMER_DAR_TIME_OUT,VCD_FUNCTION_IN);
if ((rlc_pP->t_reordering.running)) {
//LOG_I(RLC, "[rlc_um_check_timer_dar_time_out] 2 \n");
if (
// CASE 1: start time out
// +-----------+------------------+----------+
@@ -787,7 +786,6 @@ void rlc_um_check_timer_dar_time_out(
LOG_D(RLC, " %d", rlc_pP->vr_ur);
LOG_D(RLC, "\n");
#endif
LOG_I(RLC, "[rlc_um_check_timer_dar_time_out] 3 \n");
rlc_um_try_reassembly(ctxt_pP, rlc_pP ,old_vr_ur, rlc_pP->vr_ur);
in_window = rlc_um_in_window(ctxt_pP, rlc_pP, rlc_pP->vr_ur, rlc_pP->vr_uh, rlc_pP->vr_uh);
@@ -1040,7 +1038,6 @@ rlc_um_receive_process_dar (
} else {
free_mem_block(pdu_mem_pP, __func__);
pdu_mem_pP = NULL;
//LOG_I(RLC, "[rlc_um_receive_process_dar] Problematic case 1 \n");
return;
}
@@ -1067,7 +1064,6 @@ rlc_um_receive_process_dar (
rlc_pP->stat_rx_data_pdu_out_of_window += 1;
rlc_pP->stat_rx_data_bytes_out_of_window += tb_sizeP;
free_mem_block(pdu_mem_pP, __func__);
//LOG_I(RLC, "[rlc_um_receive_process_dar] Problematic case 2 \n");
pdu_mem_pP = NULL;
RLC_UM_MUTEX_UNLOCK(&rlc_pP->lock_dar_buffer);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RLC_UM_RECEIVE_PROCESS_DAR, VCD_FUNCTION_OUT);
@@ -1086,7 +1082,6 @@ rlc_um_receive_process_dar (
//discard the PDU
rlc_pP->stat_rx_data_pdus_duplicate += 1;
rlc_pP->stat_rx_data_bytes_duplicate += tb_sizeP;
//LOG_I(RLC, "[rlc_um_receive_process_dar] Problematic case 3 \n");
free_mem_block(pdu_mem_pP, __func__);
pdu_mem_pP = NULL;
RLC_UM_MUTEX_UNLOCK(&rlc_pP->lock_dar_buffer);
@@ -1119,7 +1114,6 @@ rlc_um_receive_process_dar (
// -if VR(UR) falls outside of the reordering window:
// -set VR(UR) to (VR(UH) – UM_Window_Size);
if (rlc_um_in_reordering_window(ctxt_pP, rlc_pP, sn) < 0) {
LOG_I(RLC, "[rlc_um_receive_process_dar] Before calling rlc_um_try_reassembly() 1 \n");
#if TRACE_RLC_UM_DAR
LOG_D(RLC, PROTOCOL_RLC_UM_CTXT_FMT" RX PDU SN %d OUTSIDE REORDERING WINDOW VR(UH)=%d UM_Window_Size=%d\n",
PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP, rlc_pP),
@@ -1135,7 +1129,6 @@ rlc_um_receive_process_dar (
if (in_window < 0) {
in_window = in_window + rlc_pP->rx_sn_modulo;
}
LOG_I(RLC, "[rlc_um_receive_process_dar] Before calling rlc_um_try_reassembly() 2 \n");
rlc_um_try_reassembly(ctxt_pP, rlc_pP, rlc_pP->vr_ur, in_window);
}
@@ -1160,18 +1153,12 @@ rlc_um_receive_process_dar (
// SDUs to upper layer in ascending order of the RLC SN if not
// delivered before;
if ((sn == rlc_pP->vr_ur) && rlc_um_get_pdu_from_dar_buffer(ctxt_pP, rlc_pP, rlc_pP->vr_ur)) {
LOG_I(RLC, "[rlc_um_receive_process_dar] Before calling rlc_um_try_reassembly() 3 \n");
//sn_tmp = rlc_pP->vr_ur;
do {
rlc_pP->vr_ur = (rlc_pP->vr_ur+1) % rlc_pP->rx_sn_modulo;
} while (rlc_um_get_pdu_from_dar_buffer(ctxt_pP, rlc_pP, rlc_pP->vr_ur) && (rlc_pP->vr_ur != rlc_pP->vr_uh));
LOG_I(RLC, "[rlc_um_receive_process_dar] Before calling rlc_um_try_reassembly() 4 \n");
rlc_um_try_reassembly(ctxt_pP, rlc_pP, sn, rlc_pP->vr_ur);
}
else if (sn != rlc_pP->vr_ur)
LOG_I(RLC, "[rlc_um_receive_process_dar] Problematic case 5, sn: %d, rlc_pP->vr_ur: %d \n",sn, rlc_pP->vr_ur);
else if(!rlc_um_get_pdu_from_dar_buffer(ctxt_pP, rlc_pP, rlc_pP->vr_ur))
//LOG_I(RLC, "[rlc_um_receive_process_dar] Problematic case 6 \n");
}
// -if t-Reordering is running:
// -if VR(UX) <= VR(UR); or