Commit d4c4fdf7 authored by Cedric Roux's avatar Cedric Roux

T tracer: add harq pid in nr ul/dl/dl retx traces

parent b65b0e2e
...@@ -59,16 +59,19 @@ typedef struct { ...@@ -59,16 +59,19 @@ typedef struct {
int nr_ul_rnti; int nr_ul_rnti;
int nr_ul_frame; int nr_ul_frame;
int nr_ul_slot; int nr_ul_slot;
int nr_ul_harq_pid;
int nr_ul_data; int nr_ul_data;
/* NR dl */ /* NR dl */
int nr_dl_rnti; int nr_dl_rnti;
int nr_dl_frame; int nr_dl_frame;
int nr_dl_slot; int nr_dl_slot;
int nr_dl_harq_pid;
int nr_dl_data; int nr_dl_data;
/* NR dl retx */ /* NR dl retx */
int nr_dl_retx_rnti; int nr_dl_retx_rnti;
int nr_dl_retx_frame; int nr_dl_retx_frame;
int nr_dl_retx_slot; int nr_dl_retx_slot;
int nr_dl_retx_harq_pid;
int nr_dl_retx_data; int nr_dl_retx_data;
/* NR mib */ /* NR mib */
int nr_mib_frame; int nr_mib_frame;
...@@ -259,6 +262,7 @@ void sr(void *_d, event e) ...@@ -259,6 +262,7 @@ void sr(void *_d, event e)
#define MAC_NR_PAYLOAD_TAG 0x01 #define MAC_NR_PAYLOAD_TAG 0x01
#define MAC_NR_RNTI_TAG 0x02 #define MAC_NR_RNTI_TAG 0x02
#define MAC_NR_UEID_TAG 0x03 #define MAC_NR_UEID_TAG 0x03
#define MAC_NR_HARQID 0x06
#define MAC_NR_FRAME_SLOT_TAG 0x07 #define MAC_NR_FRAME_SLOT_TAG 0x07
#define NR_FDD_RADIO 1 #define NR_FDD_RADIO 1
...@@ -272,7 +276,8 @@ void sr(void *_d, event e) ...@@ -272,7 +276,8 @@ void sr(void *_d, event e)
#define NR_C_RNTI 3 #define NR_C_RNTI 3
void trace_nr(ev_data *d, int direction, int rnti_type, int rnti, void trace_nr(ev_data *d, int direction, int rnti_type, int rnti,
int frame, int slot, void *buf, int bufsize, int preamble) int frame, int slot, int harq_pid, void *buf, int bufsize,
int preamble)
{ {
ssize_t ret; ssize_t ret;
int i; int i;
...@@ -312,6 +317,8 @@ void trace_nr(ev_data *d, int direction, int rnti_type, int rnti, ...@@ -312,6 +317,8 @@ void trace_nr(ev_data *d, int direction, int rnti_type, int rnti,
PUTC(&d->buf, frame & 255); PUTC(&d->buf, frame & 255);
PUTC(&d->buf, (slot>>8) & 255); PUTC(&d->buf, (slot>>8) & 255);
PUTC(&d->buf, slot & 255); PUTC(&d->buf, slot & 255);
PUTC(&d->buf, MAC_NR_HARQID);
PUTC(&d->buf, harq_pid);
#endif #endif
PUTC(&d->buf, MAC_NR_PAYLOAD_TAG); PUTC(&d->buf, MAC_NR_PAYLOAD_TAG);
...@@ -331,7 +338,8 @@ void nr_ul(void *_d, event e) ...@@ -331,7 +338,8 @@ void nr_ul(void *_d, event e)
trace_nr(d, NR_DIRECTION_UPLINK, NR_C_RNTI, e.e[d->nr_ul_rnti].i, trace_nr(d, NR_DIRECTION_UPLINK, NR_C_RNTI, e.e[d->nr_ul_rnti].i,
e.e[d->nr_ul_frame].i, e.e[d->nr_ul_slot].i, e.e[d->nr_ul_frame].i, e.e[d->nr_ul_slot].i,
e.e[d->nr_ul_data].b, e.e[d->nr_ul_data].bsize, NO_PREAMBLE); e.e[d->nr_ul_harq_pid].i, e.e[d->nr_ul_data].b,
e.e[d->nr_ul_data].bsize, NO_PREAMBLE);
} }
void nr_dl(void *_d, event e) void nr_dl(void *_d, event e)
...@@ -340,7 +348,8 @@ void nr_dl(void *_d, event e) ...@@ -340,7 +348,8 @@ void nr_dl(void *_d, event e)
trace_nr(d, NR_DIRECTION_DOWNLINK, NR_C_RNTI, e.e[d->nr_dl_rnti].i, trace_nr(d, NR_DIRECTION_DOWNLINK, NR_C_RNTI, e.e[d->nr_dl_rnti].i,
e.e[d->nr_dl_frame].i, e.e[d->nr_dl_slot].i, e.e[d->nr_dl_frame].i, e.e[d->nr_dl_slot].i,
e.e[d->nr_dl_data].b, e.e[d->nr_dl_data].bsize, NO_PREAMBLE); e.e[d->nr_dl_harq_pid].i, e.e[d->nr_dl_data].b,
e.e[d->nr_dl_data].bsize, NO_PREAMBLE);
} }
void nr_dl_retx(void *_d, event e) void nr_dl_retx(void *_d, event e)
...@@ -349,8 +358,8 @@ void nr_dl_retx(void *_d, event e) ...@@ -349,8 +358,8 @@ void nr_dl_retx(void *_d, event e)
trace_nr(d, NR_DIRECTION_DOWNLINK, NR_C_RNTI, e.e[d->nr_dl_retx_rnti].i, trace_nr(d, NR_DIRECTION_DOWNLINK, NR_C_RNTI, e.e[d->nr_dl_retx_rnti].i,
e.e[d->nr_dl_retx_frame].i, e.e[d->nr_dl_retx_slot].i, e.e[d->nr_dl_retx_frame].i, e.e[d->nr_dl_retx_slot].i,
e.e[d->nr_dl_retx_data].b, e.e[d->nr_dl_retx_data].bsize, e.e[d->nr_dl_retx_harq_pid].i, e.e[d->nr_dl_retx_data].b,
NO_PREAMBLE); e.e[d->nr_dl_retx_data].bsize, NO_PREAMBLE);
} }
void nr_mib(void *_d, event e) void nr_mib(void *_d, event e)
...@@ -364,7 +373,7 @@ void nr_mib(void *_d, event e) ...@@ -364,7 +373,7 @@ void nr_mib(void *_d, event e)
d->cur_mib++; d->cur_mib++;
trace_nr(d, NR_DIRECTION_DOWNLINK, NR_NO_RNTI, 0, trace_nr(d, NR_DIRECTION_DOWNLINK, NR_NO_RNTI, 0,
e.e[d->nr_mib_frame].i, e.e[d->nr_mib_slot].i, e.e[d->nr_mib_frame].i, e.e[d->nr_mib_slot].i, 0 /* harq pid */,
e.e[d->nr_mib_data].b, e.e[d->nr_mib_data].bsize, NO_PREAMBLE); e.e[d->nr_mib_data].b, e.e[d->nr_mib_data].bsize, NO_PREAMBLE);
} }
...@@ -373,7 +382,7 @@ void nr_rar(void *_d, event e) ...@@ -373,7 +382,7 @@ void nr_rar(void *_d, event e)
ev_data *d = _d; ev_data *d = _d;
trace_nr(d, NR_DIRECTION_DOWNLINK, NR_RA_RNTI, e.e[d->nr_rar_rnti].i, trace_nr(d, NR_DIRECTION_DOWNLINK, NR_RA_RNTI, e.e[d->nr_rar_rnti].i,
e.e[d->nr_rar_frame].i, e.e[d->nr_rar_slot].i, e.e[d->nr_rar_frame].i, e.e[d->nr_rar_slot].i, 0 /* harq pid */,
e.e[d->nr_rar_data].b, e.e[d->nr_rar_data].bsize, NO_PREAMBLE); e.e[d->nr_rar_data].b, e.e[d->nr_rar_data].bsize, NO_PREAMBLE);
} }
...@@ -387,47 +396,50 @@ void setup_data(ev_data *d, void *database, int ul_id, int dl_id, int mib_id, ...@@ -387,47 +396,50 @@ void setup_data(ev_data *d, void *database, int ul_id, int dl_id, int mib_id,
{ {
database_event_format f; database_event_format f;
int i; int i;
d->ul_rnti = -1; d->ul_rnti = -1;
d->ul_frame = -1; d->ul_frame = -1;
d->ul_subframe = -1; d->ul_subframe = -1;
d->ul_data = -1; d->ul_data = -1;
d->dl_rnti = -1; d->dl_rnti = -1;
d->dl_frame = -1; d->dl_frame = -1;
d->dl_subframe = -1; d->dl_subframe = -1;
d->dl_data = -1; d->dl_data = -1;
d->mib_frame = -1; d->mib_frame = -1;
d->mib_subframe = -1; d->mib_subframe = -1;
d->mib_data = -1; d->mib_data = -1;
d->preamble_frame = -1; d->preamble_frame = -1;
d->preamble_subframe = -1; d->preamble_subframe = -1;
d->preamble_preamble = -1; d->preamble_preamble = -1;
d->rar_rnti = -1; d->rar_rnti = -1;
d->rar_frame = -1; d->rar_frame = -1;
d->rar_subframe = -1; d->rar_subframe = -1;
d->rar_data = -1; d->rar_data = -1;
d->sr_rnti = -1; d->sr_rnti = -1;
d->sr_frame = -1; d->sr_frame = -1;
d->sr_subframe = -1; d->sr_subframe = -1;
d->nr_ul_rnti = -1; d->nr_ul_rnti = -1;
d->nr_ul_frame = -1; d->nr_ul_frame = -1;
d->nr_ul_slot = -1; d->nr_ul_slot = -1;
d->nr_ul_data = -1; d->nr_ul_harq_pid = -1;
d->nr_dl_rnti = -1; d->nr_ul_data = -1;
d->nr_dl_frame = -1; d->nr_dl_rnti = -1;
d->nr_dl_slot = -1; d->nr_dl_frame = -1;
d->nr_dl_data = -1; d->nr_dl_slot = -1;
d->nr_dl_retx_rnti = -1; d->nr_dl_harq_pid = -1;
d->nr_dl_retx_frame = -1; d->nr_dl_data = -1;
d->nr_dl_retx_slot = -1; d->nr_dl_retx_rnti = -1;
d->nr_dl_retx_data = -1; d->nr_dl_retx_frame = -1;
d->nr_mib_frame = -1; d->nr_dl_retx_slot = -1;
d->nr_mib_slot = -1; d->nr_dl_retx_harq_pid = -1;
d->nr_mib_data = -1; d->nr_dl_retx_data = -1;
d->nr_rar_rnti = -1; d->nr_mib_frame = -1;
d->nr_rar_frame = -1; d->nr_mib_slot = -1;
d->nr_rar_slot = -1; d->nr_mib_data = -1;
d->nr_rar_data = -1; d->nr_rar_rnti = -1;
d->nr_rar_frame = -1;
d->nr_rar_slot = -1;
d->nr_rar_data = -1;
#define G(var_name, var_type, var) \ #define G(var_name, var_type, var) \
if (!strcmp(f.name[i], var_name)) { \ if (!strcmp(f.name[i], var_name)) { \
...@@ -510,46 +522,50 @@ void setup_data(ev_data *d, void *database, int ul_id, int dl_id, int mib_id, ...@@ -510,46 +522,50 @@ void setup_data(ev_data *d, void *database, int ul_id, int dl_id, int mib_id,
if (d->sr_rnti == -1 || d->sr_frame == -1 || d->sr_subframe == -1) if (d->sr_rnti == -1 || d->sr_frame == -1 || d->sr_subframe == -1)
goto error; goto error;
/* NR ul: rnti, frame, slot, data */ /* NR ul: rnti, frame, slot, harq_pid, data */
f = get_format(database, nr_ul_id); f = get_format(database, nr_ul_id);
for (i = 0; i < f.count; i++) { for (i = 0; i < f.count; i++) {
G("rnti", "int", d->nr_ul_rnti); G("rnti", "int", d->nr_ul_rnti);
G("frame", "int", d->nr_ul_frame); G("frame", "int", d->nr_ul_frame);
G("slot", "int", d->nr_ul_slot); G("slot", "int", d->nr_ul_slot);
G("data", "buffer", d->nr_ul_data); G("harq_pid", "int", d->nr_ul_harq_pid);
G("data", "buffer", d->nr_ul_data);
} }
if (d->nr_ul_rnti == -1 || d->nr_ul_frame == -1 || d->nr_ul_slot == -1 || if (d->nr_ul_rnti == -1 || d->nr_ul_frame == -1 || d->nr_ul_slot == -1 ||
d->nr_ul_data == -1) d->nr_ul_harq_pid == -1 || d->nr_ul_data == -1)
goto error; goto error;
/* NR dl: rnti, frame, slot, data */ /* NR dl: rnti, frame, slot, harq_pid, data */
f = get_format(database, nr_dl_id); f = get_format(database, nr_dl_id);
for (i = 0; i < f.count; i++) { for (i = 0; i < f.count; i++) {
G("rnti", "int", d->nr_dl_rnti); G("rnti", "int", d->nr_dl_rnti);
G("frame", "int", d->nr_dl_frame); G("frame", "int", d->nr_dl_frame);
G("slot", "int", d->nr_dl_slot); G("slot", "int", d->nr_dl_slot);
G("data", "buffer", d->nr_dl_data); G("harq_pid", "int", d->nr_dl_harq_pid);
G("data", "buffer", d->nr_dl_data);
} }
if (d->nr_dl_rnti == -1 || d->nr_dl_frame == -1 || d->nr_dl_slot == -1 || if (d->nr_dl_rnti == -1 || d->nr_dl_frame == -1 || d->nr_dl_slot == -1 ||
d->nr_dl_data == -1) d->nr_dl_harq_pid == -1 || d->nr_dl_data == -1)
goto error; goto error;
/* NR dl retx: rnti, frame, slot, data */ /* NR dl retx: rnti, frame, slot, harq_pid, data */
f = get_format(database, nr_dl_retx_id); f = get_format(database, nr_dl_retx_id);
for (i = 0; i < f.count; i++) { for (i = 0; i < f.count; i++) {
G("rnti", "int", d->nr_dl_retx_rnti); G("rnti", "int", d->nr_dl_retx_rnti);
G("frame", "int", d->nr_dl_retx_frame); G("frame", "int", d->nr_dl_retx_frame);
G("slot", "int", d->nr_dl_retx_slot); G("slot", "int", d->nr_dl_retx_slot);
G("data", "buffer", d->nr_dl_retx_data); G("harq_pid", "int", d->nr_dl_retx_harq_pid);
G("data", "buffer", d->nr_dl_retx_data);
} }
if (d->nr_dl_retx_rnti == -1 || d->nr_dl_retx_frame == -1 || if (d->nr_dl_retx_rnti == -1 || d->nr_dl_retx_frame == -1 ||
d->nr_dl_retx_slot == -1 || d->nr_dl_retx_data == -1) d->nr_dl_retx_slot == -1 || d->nr_dl_retx_harq_pid == -1 ||
d->nr_dl_retx_data == -1)
goto error; goto error;
/* NR MIB: frame, slot, data */ /* NR MIB: frame, slot, data */
......
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