AF_XDP-interaction: Add option for debugging time

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
This commit is contained in:
Jesper Dangaard Brouer
2022-01-07 17:38:19 +01:00
parent 42ea6e7938
commit 2d86845b02
3 changed files with 14 additions and 4 deletions

View File

@@ -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;

View File

@@ -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) */

View File

@@ -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;