diff --git a/AF_XDP-interaction/af_xdp_user.c b/AF_XDP-interaction/af_xdp_user.c index c6eca93..7cda3d8 100644 --- a/AF_XDP-interaction/af_xdp_user.c +++ b/AF_XDP-interaction/af_xdp_user.c @@ -279,6 +279,9 @@ static const struct option_wrapper long_options[] = { {{"metainfo", no_argument, NULL, 'm' }, "Print XDP metadata info output mode (debug)"}, + {{"timedebug", no_argument, NULL, 't' }, + "Print timestamps info for wakeup accuracy (debug)"}, + {{"debug", no_argument, NULL, 'D' }, "Debug info output mode (debug)"}, @@ -1289,9 +1292,11 @@ static void tx_cyclic_and_rx_process(struct config *cfg, stat.curr - stat.prev, diff_interval); - print_timespec(&now, "now"); - print_timespec(&next_adj, "next_adj"); - print_timespec(&next, "next"); + if (debug_time) { + print_timespec(&now, "now"); + print_timespec(&next_adj, "next_adj"); + print_timespec(&next, "next"); + } /* Calculate next time to wakeup */ next.tv_sec += interval.tv_sec; diff --git a/AF_XDP-interaction/common_defines.h b/AF_XDP-interaction/common_defines.h index 7638632..56e075d 100644 --- a/AF_XDP-interaction/common_defines.h +++ b/AF_XDP-interaction/common_defines.h @@ -37,6 +37,7 @@ extern int verbose; extern int debug; extern int debug_pkt; extern int debug_meta; +extern int debug_time; /* Exit return codes */ #define EXIT_OK 0 /* == EXIT_SUCCESS (stdlib.h) man exit(3) */ diff --git a/AF_XDP-interaction/common_params.c b/AF_XDP-interaction/common_params.c index b93eef5..d54255a 100644 --- a/AF_XDP-interaction/common_params.c +++ b/AF_XDP-interaction/common_params.c @@ -17,6 +17,7 @@ int verbose = 1; int debug = 0; int debug_pkt = 0; int debug_meta = 0; +int debug_time = 0; #define BUFSIZE 30 @@ -96,7 +97,7 @@ void parse_cmdline_args(int argc, char **argv, } /* Parse commands line args */ - while ((opt = getopt_long(argc, argv, "hd:r:L:R:BASNFUMQ:G:H:czqp:", + while ((opt = getopt_long(argc, argv, "hd:r:L:R:BASNFUMQ:G:H:czqp:t", long_options, &longindex)) != -1) { switch (opt) { case 'd': @@ -196,6 +197,9 @@ void parse_cmdline_args(int argc, char **argv, case 'm': debug_meta = true; break; + case 't': + debug_time = true; + break; case 'Q': cfg->xsk_if_queue = atoi(optarg); break;