Commit b0e50688 authored by Cedric Roux's avatar Cedric Roux

cleanup: introduce ticktime_filter()

parent f9843f46
...@@ -86,6 +86,17 @@ static void *gui_thread(void *_g) ...@@ -86,6 +86,17 @@ static void *gui_thread(void *_g)
return NULL; return NULL;
} }
static filter *ticktime_filter(void *database, char *event, int i)
{
/* filter is "harq_pid == i && UE_id == 0 && eNB_id == 0 */
return
filter_and(
filter_eq(filter_evarg(database, event, "harq_pid"), filter_int(i)),
filter_and(
filter_eq(filter_evarg(database, event, "UE_id"), filter_int(0)),
filter_eq(filter_evarg(database, event, "eNB_ID"), filter_int(0))));
}
static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database) static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database)
{ {
widget *main_window; widget *main_window;
...@@ -205,17 +216,7 @@ static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database) ...@@ -205,17 +216,7 @@ static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database)
logger_add_view(timelog, subview); logger_add_view(timelog, subview);
/* filter is "harq_pid == i && UE_id == 0 && eNB_id == 0 */ /* filter is "harq_pid == i && UE_id == 0 && eNB_id == 0 */
logger_set_filter(timelog, logger_set_filter(timelog,
filter_and( ticktime_filter(database, "ENB_DLSCH_UE_DCI", i));
filter_eq(
filter_evarg(database, "ENB_DLSCH_UE_DCI", "harq_pid"),
filter_int(i)),
filter_and(
filter_eq(
filter_evarg(database, "ENB_DLSCH_UE_DCI", "UE_id"),
filter_int(0)),
filter_eq(
filter_evarg(database, "ENB_DLSCH_UE_DCI", "eNB_ID"),
filter_int(0)))));
} }
/* DL ACK */ /* DL ACK */
for (i = 0; i < 8; i++) { for (i = 0; i < 8; i++) {
...@@ -226,17 +227,7 @@ static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database) ...@@ -226,17 +227,7 @@ static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database)
logger_add_view(timelog, subview); logger_add_view(timelog, subview);
/* filter is "harq_pid == i && UE_id == 0 && eNB_id == 0 */ /* filter is "harq_pid == i && UE_id == 0 && eNB_id == 0 */
logger_set_filter(timelog, logger_set_filter(timelog,
filter_and( ticktime_filter(database, "ENB_DLSCH_UE_ACK", i));
filter_eq(
filter_evarg(database, "ENB_DLSCH_UE_ACK", "harq_pid"),
filter_int(i)),
filter_and(
filter_eq(
filter_evarg(database, "ENB_DLSCH_UE_ACK", "UE_id"),
filter_int(0)),
filter_eq(
filter_evarg(database, "ENB_DLSCH_UE_ACK", "eNB_ID"),
filter_int(0)))));
} }
/* DL NACK */ /* DL NACK */
for (i = 0; i < 8; i++) { for (i = 0; i < 8; i++) {
...@@ -247,17 +238,7 @@ static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database) ...@@ -247,17 +238,7 @@ static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database)
logger_add_view(timelog, subview); logger_add_view(timelog, subview);
/* filter is "harq_pid == i && UE_id == 0 && eNB_id == 0 */ /* filter is "harq_pid == i && UE_id == 0 && eNB_id == 0 */
logger_set_filter(timelog, logger_set_filter(timelog,
filter_and( ticktime_filter(database, "ENB_DLSCH_UE_NACK", i));
filter_eq(
filter_evarg(database, "ENB_DLSCH_UE_NACK", "harq_pid"),
filter_int(i)),
filter_and(
filter_eq(
filter_evarg(database, "ENB_DLSCH_UE_NACK", "UE_id"),
filter_int(0)),
filter_eq(
filter_evarg(database, "ENB_DLSCH_UE_NACK", "eNB_ID"),
filter_int(0)))));
} }
/* UL harq pids */ /* UL harq pids */
for (i = 0; i < 8; i++) { for (i = 0; i < 8; i++) {
...@@ -269,17 +250,7 @@ static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database) ...@@ -269,17 +250,7 @@ static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database)
logger_add_view(timelog, subview); logger_add_view(timelog, subview);
/* filter is "harq_pid == i && UE_id == 0 && eNB_id == 0 */ /* filter is "harq_pid == i && UE_id == 0 && eNB_id == 0 */
logger_set_filter(timelog, logger_set_filter(timelog,
filter_and( ticktime_filter(database, "ENB_ULSCH_UE_DCI", i));
filter_eq(
filter_evarg(database, "ENB_ULSCH_UE_DCI", "harq_pid"),
filter_int(i)),
filter_and(
filter_eq(
filter_evarg(database, "ENB_ULSCH_UE_DCI", "UE_id"),
filter_int(0)),
filter_eq(
filter_evarg(database, "ENB_ULSCH_UE_DCI", "eNB_ID"),
filter_int(0)))));
/* retransmission */ /* retransmission */
timelog = new_ticklog(h, database, "ENB_ULSCH_UE_NO_DCI_RETRANSMISSION", timelog = new_ticklog(h, database, "ENB_ULSCH_UE_NO_DCI_RETRANSMISSION",
"frame", "subframe"); "frame", "subframe");
...@@ -288,20 +259,7 @@ static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database) ...@@ -288,20 +259,7 @@ static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database)
logger_add_view(timelog, subview); logger_add_view(timelog, subview);
/* filter is "harq_pid == i && UE_id == 0 && eNB_id == 0 */ /* filter is "harq_pid == i && UE_id == 0 && eNB_id == 0 */
logger_set_filter(timelog, logger_set_filter(timelog,
filter_and( ticktime_filter(database, "ENB_ULSCH_UE_NO_DCI_RETRANSMISSION", i));
filter_eq(
filter_evarg(database, "ENB_ULSCH_UE_NO_DCI_RETRANSMISSION",
"harq_pid"),
filter_int(i)),
filter_and(
filter_eq(
filter_evarg(database, "ENB_ULSCH_UE_NO_DCI_RETRANSMISSION",
"UE_id"),
filter_int(0)),
filter_eq(
filter_evarg(database, "ENB_ULSCH_UE_NO_DCI_RETRANSMISSION",
"eNB_ID"),
filter_int(0)))));
} }
/* UL ACK */ /* UL ACK */
for (i = 0; i < 8; i++) { for (i = 0; i < 8; i++) {
...@@ -312,17 +270,7 @@ static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database) ...@@ -312,17 +270,7 @@ static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database)
logger_add_view(timelog, subview); logger_add_view(timelog, subview);
/* filter is "harq_pid == i && UE_id == 0 && eNB_id == 0 */ /* filter is "harq_pid == i && UE_id == 0 && eNB_id == 0 */
logger_set_filter(timelog, logger_set_filter(timelog,
filter_and( ticktime_filter(database, "ENB_ULSCH_UE_ACK", i));
filter_eq(
filter_evarg(database, "ENB_ULSCH_UE_ACK", "harq_pid"),
filter_int(i)),
filter_and(
filter_eq(
filter_evarg(database, "ENB_ULSCH_UE_ACK", "UE_id"),
filter_int(0)),
filter_eq(
filter_evarg(database, "ENB_ULSCH_UE_ACK", "eNB_ID"),
filter_int(0)))));
} }
/* UL NACK */ /* UL NACK */
for (i = 0; i < 8; i++) { for (i = 0; i < 8; i++) {
...@@ -333,17 +281,7 @@ static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database) ...@@ -333,17 +281,7 @@ static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database)
logger_add_view(timelog, subview); logger_add_view(timelog, subview);
/* filter is "harq_pid == i && UE_id == 0 && eNB_id == 0 */ /* filter is "harq_pid == i && UE_id == 0 && eNB_id == 0 */
logger_set_filter(timelog, logger_set_filter(timelog,
filter_and( ticktime_filter(database, "ENB_ULSCH_UE_NACK", i));
filter_eq(
filter_evarg(database, "ENB_ULSCH_UE_NACK", "harq_pid"),
filter_int(i)),
filter_and(
filter_eq(
filter_evarg(database, "ENB_ULSCH_UE_NACK", "UE_id"),
filter_int(0)),
filter_eq(
filter_evarg(database, "ENB_ULSCH_UE_NACK", "eNB_ID"),
filter_int(0)))));
} }
/* phy/mac/rlc/pdcp/rrc textlog */ /* phy/mac/rlc/pdcp/rrc textlog */
......
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