From 5ff4b7a32873e53e7aba3855be64b0c7bfc3c4c1 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Mon, 2 Dec 2024 11:47:07 +0100 Subject: [PATCH] T tracer: add macpdu traces for the NR UE MIB, SIB1, random access and regular scheduling are traced. At the beginning of a connection (rrc setup request and rrc setup), the RNTI is reported as 0. Might be fixed, somehow, if absolutely needed (not sure). --- common/utils/T/T_messages.txt | 20 ++ common/utils/T/tracer/macpdu2wireshark.c | 301 +++++++++++++++---- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 2 + openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 16 +- openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 7 + 5 files changed, 293 insertions(+), 53 deletions(-) diff --git a/common/utils/T/T_messages.txt b/common/utils/T/T_messages.txt index dc9080b158..0f306501f0 100644 --- a/common/utils/T/T_messages.txt +++ b/common/utils/T/T_messages.txt @@ -87,6 +87,10 @@ ID = ENB_PHY_INITIATE_RA_PROCEDURE DESC = eNodeB initiates a random access procedure after detecting enough energy for one of the preambles GROUP = ALL:PHY:ENB:WIRESHARK FORMAT = int,eNB_ID : int,frame : int,subframe : int,preamble : int,energy : int,delay +ID = UE_PHY_INITIATE_RA_PROCEDURE + DESC = UE initiates a random access procedure with a given preamble (can be used for both LTE and NR) + GROUP = ALL:PHY:UE:WIRESHARK + FORMAT = int,frame : int,subframe_or_slot : int,preamble : int,power ID = GNB_PHY_DL_TICK DESC = gNodeB downlink tick - one tick per ms at start of downlink processing GROUP = ALL:PHY:GRAPHIC:GNB @@ -99,6 +103,10 @@ ID = GNB_PHY_MIB DESC = NR MIB data GROUP = ALL:PHY:GNB:WIRESHARK FORMAT = int,gNB_ID : int,frame : int,slot : buffer,data +ID = NRUE_PHY_MIB + DESC = NR MIB data as received by an UE + GROUP = ALL:PHY:UE:WIRESHARK + FORMAT = int,frame : int,slot : int,ssb_index : buffer,data ID = GNB_PHY_PUCCH_PUSCH_IQ DESC = gNodeB input data in the frequency domain for a slot where some PUCCH or PUSCH detection was done GROUP = ALL:PHY:GRAPHIC:HEAVY:GNB @@ -181,6 +189,18 @@ ID = GNB_MAC_RETRANSMISSION_DL_PDU_WITH_DATA DESC = NR MAC downlink retransmitted PDU for an UE GROUP = ALL:MAC:GNB:WIRESHARK FORMAT = int,gNB_ID : int,CC_id : int,rnti : int,frame : int,slot : int,harq_pid : int,round : buffer,data +ID = NRUE_MAC_DL_PDU_WITH_DATA + DESC = NR MAC downlink PDU for an UE + GROUP = ALL:MAC:UE:WIRESHARK + FORMAT = int,rnti : int,frame : int,slot : int,harq_pid : buffer,data +ID = NRUE_MAC_UL_PDU_WITH_DATA + DESC = NR MAC uplink PDU for an UE + GROUP = ALL:MAC:UE:WIRESHARK + FORMAT = int,rnti : int,frame : int,slot : int,harq_pid : buffer,data +ID = NRUE_MAC_DL_RAR_PDU_WITH_DATA + DESC = NR MAC downlink PDU for RAR + GROUP = ALL:MAC:UE:WIRESHARK + FORMAT = int,rnti : int,frame : int,slot : buffer,data #RLC logs ID = ENB_RLC_DL diff --git a/common/utils/T/tracer/macpdu2wireshark.c b/common/utils/T/tracer/macpdu2wireshark.c index 3a33cf7327..607023db6a 100644 --- a/common/utils/T/tracer/macpdu2wireshark.c +++ b/common/utils/T/tracer/macpdu2wireshark.c @@ -44,6 +44,10 @@ typedef struct { int preamble_frame; int preamble_subframe; int preamble_preamble; + /* UE RA preamble */ + int ue_preamble_frame; + int ue_preamble_subframe; + int ue_preamble_preamble; /* RAR */ int rar_rnti; int rar_frame; @@ -82,6 +86,27 @@ typedef struct { int nr_rar_frame; int nr_rar_slot; int nr_rar_data; + /* NR UE mib */ + int nr_ue_mib_frame; + int nr_ue_mib_slot; + int nr_ue_mib_data; + /* NR UE ul */ + int nr_ue_ul_rnti; + int nr_ue_ul_frame; + int nr_ue_ul_slot; + int nr_ue_ul_harq_pid; + int nr_ue_ul_data; + /* NR UE dl */ + int nr_ue_dl_rnti; + int nr_ue_dl_frame; + int nr_ue_dl_slot; + int nr_ue_dl_harq_pid; + int nr_ue_dl_data; + /* NR UE RAR */ + int nr_ue_rar_rnti; + int nr_ue_rar_frame; + int nr_ue_rar_slot; + int nr_ue_rar_data; /* config */ int no_mib; @@ -235,6 +260,15 @@ void preamble(void *_d, event e) e.e[d->preamble_preamble].i, NO_SR_RNTI); } +void ue_preamble(void *_d, event e) +{ + ev_data *d = _d; + trace_lte(d, DIRECTION_UPLINK, NO_RNTI, 0, + e.e[d->ue_preamble_frame].i, e.e[d->ue_preamble_subframe].i, + NULL, 0, + e.e[d->ue_preamble_preamble].i, NO_SR_RNTI); +} + void rar(void *_d, event e) { ev_data *d = _d; @@ -387,6 +421,21 @@ void nr_mib(void *_d, event e) e.e[d->nr_mib_data].b, e.e[d->nr_mib_data].bsize, NO_PREAMBLE); } +void nr_ue_mib(void *_d, event e) +{ + ev_data *d = _d; + + if (d->no_mib) return; + + if (d->max_mib && d->cur_mib == d->max_mib) return; + + d->cur_mib++; + + trace_nr(d, NR_DIRECTION_DOWNLINK, NR_NO_RNTI, 0, + e.e[d->nr_ue_mib_frame].i, e.e[d->nr_ue_mib_slot].i, 0 /* harq pid */, + e.e[d->nr_ue_mib_data].b, e.e[d->nr_ue_mib_data].bsize, NO_PREAMBLE); +} + void nr_rar(void *_d, event e) { ev_data *d = _d; @@ -396,61 +445,120 @@ void nr_rar(void *_d, event e) e.e[d->nr_rar_data].b, e.e[d->nr_rar_data].bsize, NO_PREAMBLE); } +void nr_ue_ul(void *_d, event e) +{ + ev_data *d = _d; + + trace_nr(d, NR_DIRECTION_UPLINK, NR_C_RNTI, e.e[d->nr_ue_ul_rnti].i, + e.e[d->nr_ue_ul_frame].i, e.e[d->nr_ue_ul_slot].i, + e.e[d->nr_ue_ul_harq_pid].i, e.e[d->nr_ue_ul_data].b, + e.e[d->nr_ue_ul_data].bsize, NO_PREAMBLE); +} + +void nr_ue_dl(void *_d, event e) +{ + ev_data *d = _d; + + if (e.e[d->nr_ue_dl_rnti].i == 0xffff) { + if (d->no_sib) return; + + if (d->max_sib && d->cur_sib == d->max_sib) return; + + d->cur_sib++; + } + + trace_nr(d, NR_DIRECTION_DOWNLINK, + e.e[d->nr_ue_dl_rnti].i != 0xffff ? NR_C_RNTI : NR_SI_RNTI, + e.e[d->nr_ue_dl_rnti].i, e.e[d->nr_ue_dl_frame].i, + e.e[d->nr_ue_dl_slot].i, e.e[d->nr_ue_dl_harq_pid].i, + e.e[d->nr_ue_dl_data].b, e.e[d->nr_ue_dl_data].bsize, NO_PREAMBLE); +} + +void nr_ue_rar(void *_d, event e) +{ + ev_data *d = _d; + trace_nr(d, DIRECTION_DOWNLINK, RA_RNTI, e.e[d->nr_ue_rar_rnti].i, + e.e[d->nr_ue_rar_frame].i, e.e[d->nr_ue_rar_slot].i, 0, + e.e[d->nr_ue_rar_data].b, e.e[d->nr_ue_rar_data].bsize, + NO_PREAMBLE); +} + /****************************************************************************/ /****************************************************************************/ void setup_data(ev_data *d, void *database, int ul_id, int dl_id, int mib_id, - int preamble_id, int rar_id, int sr_id, + int preamble_id, int ue_preamble_id, int rar_id, int sr_id, int nr_ul_id, int nr_dl_id, int nr_dl_retx_id, int nr_mib_id, - int nr_rar_id) + int nr_rar_id, int nr_ue_mib_id, int nr_ue_ul_id, + int nr_ue_dl_id, int nr_ue_rar_id) { database_event_format f; int i; - d->ul_rnti = -1; - d->ul_frame = -1; - d->ul_subframe = -1; - d->ul_data = -1; - d->dl_rnti = -1; - d->dl_frame = -1; - d->dl_subframe = -1; - d->dl_data = -1; - d->mib_frame = -1; - d->mib_subframe = -1; - d->mib_data = -1; - d->preamble_frame = -1; - d->preamble_subframe = -1; - d->preamble_preamble = -1; - d->rar_rnti = -1; - d->rar_frame = -1; - d->rar_subframe = -1; - d->rar_data = -1; - d->sr_rnti = -1; - d->sr_frame = -1; - d->sr_subframe = -1; + d->ul_rnti = -1; + d->ul_frame = -1; + d->ul_subframe = -1; + d->ul_data = -1; + d->dl_rnti = -1; + d->dl_frame = -1; + d->dl_subframe = -1; + d->dl_data = -1; + d->mib_frame = -1; + d->mib_subframe = -1; + d->mib_data = -1; + d->preamble_frame = -1; + d->preamble_subframe = -1; + d->preamble_preamble = -1; + d->ue_preamble_frame = -1; + d->ue_preamble_subframe = -1; + d->ue_preamble_preamble = -1; + d->rar_rnti = -1; + d->rar_frame = -1; + d->rar_subframe = -1; + d->rar_data = -1; + d->sr_rnti = -1; + d->sr_frame = -1; + d->sr_subframe = -1; - d->nr_ul_rnti = -1; - d->nr_ul_frame = -1; - d->nr_ul_slot = -1; - d->nr_ul_harq_pid = -1; - d->nr_ul_data = -1; - d->nr_dl_rnti = -1; - d->nr_dl_frame = -1; - d->nr_dl_slot = -1; - d->nr_dl_harq_pid = -1; - d->nr_dl_data = -1; - d->nr_dl_retx_rnti = -1; - d->nr_dl_retx_frame = -1; - d->nr_dl_retx_slot = -1; - d->nr_dl_retx_harq_pid = -1; - d->nr_dl_retx_data = -1; - d->nr_mib_frame = -1; - d->nr_mib_slot = -1; - d->nr_mib_data = -1; - d->nr_rar_rnti = -1; - d->nr_rar_frame = -1; - d->nr_rar_slot = -1; - d->nr_rar_data = -1; + d->nr_ul_rnti = -1; + d->nr_ul_frame = -1; + d->nr_ul_slot = -1; + d->nr_ul_harq_pid = -1; + d->nr_ul_data = -1; + d->nr_dl_rnti = -1; + d->nr_dl_frame = -1; + d->nr_dl_slot = -1; + d->nr_dl_harq_pid = -1; + d->nr_dl_data = -1; + d->nr_dl_retx_rnti = -1; + d->nr_dl_retx_frame = -1; + d->nr_dl_retx_slot = -1; + d->nr_dl_retx_harq_pid = -1; + d->nr_dl_retx_data = -1; + d->nr_mib_frame = -1; + d->nr_mib_slot = -1; + d->nr_mib_data = -1; + d->nr_rar_rnti = -1; + d->nr_rar_frame = -1; + d->nr_rar_slot = -1; + d->nr_rar_data = -1; + d->nr_ue_mib_frame = -1; + d->nr_ue_mib_slot = -1; + d->nr_ue_mib_data = -1; + d->nr_ue_ul_rnti = -1; + d->nr_ue_ul_frame = -1; + d->nr_ue_ul_slot = -1; + d->nr_ue_ul_harq_pid = -1; + d->nr_ue_ul_data = -1; + d->nr_ue_dl_rnti = -1; + d->nr_ue_dl_frame = -1; + d->nr_ue_dl_slot = -1; + d->nr_ue_dl_harq_pid = -1; + d->nr_ue_dl_data = -1; + d->nr_ue_rar_rnti = -1; + d->nr_ue_rar_frame = -1; + d->nr_ue_rar_slot = -1; + d->nr_ue_rar_data = -1; #define G(var_name, var_type, var) \ if (!strcmp(f.name[i], var_name)) { \ @@ -508,6 +616,18 @@ void setup_data(ev_data *d, void *database, int ul_id, int dl_id, int mib_id, if (d->preamble_frame == -1 || d->preamble_subframe == -1 || d->preamble_preamble == -1) goto error; + /* ue preamble: frame, subframe, preamble */ + f = get_format(database, ue_preamble_id); + + for (i = 0; i < f.count; i++) { + G("frame", "int", d->ue_preamble_frame); + G("subframe_or_slot", "int", d->ue_preamble_subframe); + G("preamble", "int", d->ue_preamble_preamble); + } + + if (d->ue_preamble_frame == -1 || d->ue_preamble_subframe == -1 || + d->ue_preamble_preamble == -1) goto error; + /* rar: rnti, frame, subframe, data */ f = get_format(database, rar_id); @@ -605,6 +725,64 @@ void setup_data(ev_data *d, void *database, int ul_id, int dl_id, int mib_id, d->nr_rar_data == -1) goto error; + /* NR UE MIB: frame, slot, data */ + f = get_format(database, nr_ue_mib_id); + + for (i = 0; i < f.count; i++) { + G("frame", "int", d->nr_ue_mib_frame); + G("slot", "int", d->nr_ue_mib_slot); + G("data", "buffer", d->nr_ue_mib_data); + } + + if (d->nr_ue_mib_frame == -1 || d->nr_ue_mib_slot== -1 || + d->nr_ue_mib_data == -1) + goto error; + + /* NR UE ul: rnti, frame, slot, harq_pid, data */ + f = get_format(database, nr_ue_ul_id); + + for (i = 0; i < f.count; i++) { + G("rnti", "int", d->nr_ue_ul_rnti); + G("frame", "int", d->nr_ue_ul_frame); + G("slot", "int", d->nr_ue_ul_slot); + G("harq_pid", "int", d->nr_ue_ul_harq_pid); + G("data", "buffer", d->nr_ue_ul_data); + } + + if (d->nr_ue_ul_rnti == -1 || d->nr_ue_ul_frame == -1 || + d->nr_ue_ul_slot == -1 || d->nr_ue_ul_harq_pid == -1 || + d->nr_ue_ul_data == -1) + goto error; + + /* NR UE dl: rnti, frame, slot, harq_pid, data */ + f = get_format(database, nr_ue_dl_id); + + for (i = 0; i < f.count; i++) { + G("rnti", "int", d->nr_ue_dl_rnti); + G("frame", "int", d->nr_ue_dl_frame); + G("slot", "int", d->nr_ue_dl_slot); + G("harq_pid", "int", d->nr_ue_dl_harq_pid); + G("data", "buffer", d->nr_ue_dl_data); + } + + if (d->nr_ue_dl_rnti == -1 || d->nr_ue_dl_frame == -1 || + d->nr_ue_dl_slot == -1 || d->nr_ue_dl_harq_pid == -1 || + d->nr_ue_dl_data == -1) + goto error; + + /* NR UE rar: rnti, frame, slot, data */ + f = get_format(database, nr_ue_rar_id); + + for (i = 0; i < f.count; i++) { + G("rnti", "int", d->nr_ue_rar_rnti); + G("frame", "int", d->nr_ue_rar_frame); + G("slot", "int", d->nr_ue_rar_slot); + G("data", "buffer", d->nr_ue_rar_data); + } + + if (d->nr_ue_rar_rnti == -1 || d->nr_ue_rar_frame == -1 || + d->nr_ue_rar_slot == -1 || d->nr_ue_rar_data == -1) goto error; + #undef G return; error: @@ -672,8 +850,9 @@ int main(int n, char **v) event_handler *h; int in; int i; - int ul_id, dl_id, mib_id, preamble_id, rar_id; + int ul_id, dl_id, mib_id, preamble_id, ue_preamble_id, rar_id; int nr_ul_id, nr_dl_id, nr_dl_retx_id, nr_mib_id, nr_rar_id; + int nr_ue_mib_id, nr_ue_ul_id, nr_ue_dl_id, nr_ue_rar_id; int sr_id; ev_data d; char *ip = DEFAULT_IP; @@ -748,6 +927,7 @@ int main(int n, char **v) on_off(database, "ENB_MAC_UE_DL_PDU_WITH_DATA", is_on, 1); on_off(database, "ENB_PHY_MIB", is_on, 1); on_off(database, "ENB_PHY_INITIATE_RA_PROCEDURE", is_on, 1); + on_off(database, "UE_PHY_INITIATE_RA_PROCEDURE", is_on, 1); on_off(database, "ENB_MAC_UE_DL_RAR_PDU_WITH_DATA", is_on, 1); on_off(database, "ENB_MAC_SCHEDULING_REQUEST", is_on, 1); @@ -756,6 +936,10 @@ int main(int n, char **v) on_off(database, "GNB_MAC_RETRANSMISSION_DL_PDU_WITH_DATA", is_on, 1); on_off(database, "GNB_PHY_MIB", is_on, 1); on_off(database, "GNB_MAC_DL_RAR_PDU_WITH_DATA", is_on, 1); + on_off(database, "NRUE_PHY_MIB", is_on, 1); + on_off(database, "NRUE_MAC_UL_PDU_WITH_DATA", is_on, 1); + on_off(database, "NRUE_MAC_DL_PDU_WITH_DATA", is_on, 1); + on_off(database, "NRUE_MAC_DL_RAR_PDU_WITH_DATA", is_on, 1); /* activate selected traces */ if (socket_send(in, &mt, 1) == -1 || @@ -772,6 +956,7 @@ int main(int n, char **v) dl_id = event_id_from_name(database, "ENB_MAC_UE_DL_PDU_WITH_DATA"); mib_id = event_id_from_name(database, "ENB_PHY_MIB"); preamble_id = event_id_from_name(database, "ENB_PHY_INITIATE_RA_PROCEDURE"); + ue_preamble_id = event_id_from_name(database, "UE_PHY_INITIATE_RA_PROCEDURE"); rar_id = event_id_from_name(database, "ENB_MAC_UE_DL_RAR_PDU_WITH_DATA"); sr_id = event_id_from_name(database, "ENB_MAC_SCHEDULING_REQUEST"); @@ -780,14 +965,20 @@ int main(int n, char **v) nr_dl_retx_id = event_id_from_name(database, "GNB_MAC_RETRANSMISSION_DL_PDU_WITH_DATA"); nr_mib_id = event_id_from_name(database, "GNB_PHY_MIB"); nr_rar_id = event_id_from_name(database, "GNB_MAC_DL_RAR_PDU_WITH_DATA"); + nr_ue_mib_id = event_id_from_name(database, "NRUE_PHY_MIB"); + nr_ue_ul_id = event_id_from_name(database, "NRUE_MAC_UL_PDU_WITH_DATA"); + nr_ue_dl_id = event_id_from_name(database, "NRUE_MAC_DL_PDU_WITH_DATA"); + nr_ue_rar_id = event_id_from_name(database, "NRUE_MAC_DL_RAR_PDU_WITH_DATA"); - setup_data(&d, database, ul_id, dl_id, mib_id, preamble_id, rar_id, sr_id, - nr_ul_id, nr_dl_id, nr_dl_retx_id, nr_mib_id, nr_rar_id); + setup_data(&d, database, ul_id, dl_id, mib_id, preamble_id, ue_preamble_id, + rar_id, sr_id, nr_ul_id, nr_dl_id, nr_dl_retx_id, nr_mib_id, + nr_rar_id, nr_ue_mib_id, nr_ue_ul_id, nr_ue_dl_id, nr_ue_rar_id); register_handler_function(h, ul_id, ul, &d); register_handler_function(h, dl_id, dl, &d); register_handler_function(h, mib_id, mib, &d); register_handler_function(h, preamble_id, preamble, &d); + register_handler_function(h, ue_preamble_id, ue_preamble, &d); register_handler_function(h, rar_id, rar, &d); register_handler_function(h, sr_id, sr, &d); @@ -796,6 +987,10 @@ int main(int n, char **v) register_handler_function(h, nr_dl_retx_id, nr_dl_retx, &d); register_handler_function(h, nr_mib_id, nr_mib, &d); register_handler_function(h, nr_rar_id, nr_rar, &d); + register_handler_function(h, nr_ue_mib_id, nr_ue_mib, &d); + register_handler_function(h, nr_ue_ul_id, nr_ue_ul, &d); + register_handler_function(h, nr_ue_dl_id, nr_ue_dl, &d); + register_handler_function(h, nr_ue_rar_id, nr_ue_rar, &d); d.socket = socket(AF_INET, SOCK_DGRAM, 0); @@ -817,11 +1012,15 @@ int main(int n, char **v) if (e.type == -1) break; - if (!(e.type == ul_id || e.type == dl_id || e.type == mib_id || - e.type == preamble_id || e.type == rar_id || e.type == sr_id || + if (!(e.type == ul_id || e.type == dl_id || + e.type == mib_id || + e.type == preamble_id || e.type == ue_preamble_id || + e.type == rar_id || e.type == sr_id || e.type == nr_ul_id || e.type == nr_dl_id || e.type == nr_dl_retx_id || e.type == nr_mib_id || - e.type == nr_rar_id)) continue; + e.type == nr_rar_id || e.type == nr_ue_mib_id || + e.type == nr_ue_ul_id || e.type == nr_ue_dl_id || + e.type == nr_ue_rar_id)) continue; handle_event(h, e); } diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index a737b5246e..9ff278c30e 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -407,6 +407,8 @@ static int nr_ue_pbch_procedures(PHY_VARS_NR_UE *ue, rxdataF); if (ret==0) { + T(T_NRUE_PHY_MIB, T_INT(frame_rx), T_INT(nr_slot_rx), + T_INT(ssb_index), T_BUFFER(result.decoded_output, 3)); #ifdef DEBUG_PHY_PROC LOG_D(PHY, diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index 5376d85ef8..5808cf3dcb 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -301,6 +301,12 @@ int8_t nr_ue_decode_BCCH_DL_SCH(NR_UE_MAC_INST_t *mac, nr_mac_rrc_data_ind_ue(mac->ue_id, cc_id, gNB_index, 0, 0, 0, mac->physCellId, 0, NR_BCCH_DL_SCH, (uint8_t *) pduP, pdu_len); mac->get_sib1 = false; mac->get_otherSI = false; + T(T_NRUE_MAC_DL_PDU_WITH_DATA, + T_INT(SI_RNTI), + T_INT(-1 /* frame, unavailable here */), + T_INT(-1 /* slot, unavailable here */), + T_INT(0 /* harq_pid */), + T_BUFFER(pduP, pdu_len)); } else LOG_E(NR_MAC, "Got NACK on NR-BCCH-DL-SCH-Message (%s)\n", mac->get_sib1 ? "SIB1" : "other SI"); @@ -3588,8 +3594,9 @@ void nr_ue_process_mac_pdu(NR_UE_MAC_INST_t *mac, nr_downlink_indication_t *dl_i { frame_t frameP = dl_info->frame; int slot = dl_info->slot; - uint8_t *pduP = (dl_info->rx_ind->rx_indication_body + pdu_id)->pdsch_pdu.pdu; - int32_t pdu_len = (int32_t)(dl_info->rx_ind->rx_indication_body + pdu_id)->pdsch_pdu.pdu_length; + fapi_nr_pdsch_pdu_t *pdsch_pdu = &(dl_info->rx_ind->rx_indication_body + pdu_id)->pdsch_pdu; + uint8_t *pduP = pdsch_pdu->pdu; + int32_t pdu_len = (int32_t)pdsch_pdu->pdu_length; uint8_t gNB_index = dl_info->gNB_index; uint8_t CC_id = dl_info->cc_id; uint8_t done = 0; @@ -3599,6 +3606,8 @@ void nr_ue_process_mac_pdu(NR_UE_MAC_INST_t *mac, nr_downlink_indication_t *dl_i return; } + T(T_NRUE_MAC_DL_PDU_WITH_DATA, T_INT(mac->crnti), T_INT(frameP), T_INT(slot), T_INT(pdsch_pdu->harq_pid), T_BUFFER(pduP, pdu_len)); + LOG_D(MAC, "[%d.%d]: processing PDU %d (with length %d) of %d total number of PDUs...\n", frameP, @@ -3964,6 +3973,9 @@ static void nr_ue_process_rar(NR_UE_MAC_INST_t *mac, nr_downlink_indication_t *d uint8_t preamble_index = ra->ra_PreambleIndex; uint16_t rnti = mac->ra.ra_rnti; + T(T_NRUE_MAC_DL_RAR_PDU_WITH_DATA, T_INT(rnti), T_INT(frame), T_INT(slot), + T_BUFFER(dlsch_buffer, dl_info->rx_ind->rx_indication_body[pdu_id].pdsch_pdu.pdu_length)); + LOG_D(NR_MAC, "[%d.%d]: [UE %d][RAPROC] invoking MAC for received RAR (current preamble %d)\n", frame, slot, mac->ue_id, preamble_index); while (1) { diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index 65597bd3dd..0e9b26c773 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -1599,6 +1599,8 @@ void nr_ue_ul_scheduler(NR_UE_MAC_INST_t *mac, nr_uplink_indication_t *ul_info) pdu->tx_request_body.fapiTxPdu = ulsch_input_buffer; pdu->tx_request_body.pdu_length = TBS_bytes; number_of_pdus++; + T(T_NRUE_MAC_UL_PDU_WITH_DATA, T_INT(mac->crnti), T_INT(frame_tx), T_INT(slot_tx), + T_INT(ulcfg_pdu->pusch_config_pdu.pusch_data.harq_process_id), T_BUFFER(ulsch_input_buffer, TBS_bytes)); } else { if (ulcfg_pdu->pusch_config_pdu.pusch_data.new_data_indicator && (mac->state == UE_CONNECTED || (ra->ra_state == nrRA_WAIT_RAR && ra->cfra))) { @@ -1626,6 +1628,8 @@ void nr_ue_ul_scheduler(NR_UE_MAC_INST_t *mac, nr_uplink_indication_t *ul_info) pdu->tx_request_body.fapiTxPdu = ulsch_input_buffer; pdu->tx_request_body.pdu_length = TBS_bytes; number_of_pdus++; + T(T_NRUE_MAC_UL_PDU_WITH_DATA, T_INT(mac->crnti), T_INT(frame_tx), T_INT(slot_tx), + T_INT(ulcfg_pdu->pusch_config_pdu.pusch_data.harq_process_id), T_BUFFER(ulsch_input_buffer, TBS_bytes)); // start or restart dataInactivityTimer if any MAC entity transmits a MAC SDU for DTCH logical channel, // or DCCH logical channel if (mac->data_inactivity_timer) @@ -2965,6 +2969,9 @@ static void nr_ue_prach_scheduler(NR_UE_MAC_INST_t *mac, frame_t frameP, sub_fra if(mac->if_module != NULL && mac->if_module->scheduled_response != NULL) mac->if_module->scheduled_response(&scheduled_response); + T(T_UE_PHY_INITIATE_RA_PROCEDURE, T_INT(frameP), T_INT(pdu->prach_config_pdu.prach_slot), + T_INT(pdu->prach_config_pdu.ra_PreambleIndex), T_INT(pdu->prach_config_pdu.prach_tx_power)); + if (ra->ra_type == RA_4_STEP) { nr_Msg1_transmitted(mac); } else if (ra->ra_type == RA_2_STEP) {