mirror of
https://github.com/xdp-project/bpf-examples.git
synced 2024-05-06 15:54:53 +00:00
AF_XDP-interaction: Add option for debugging time
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
This commit is contained in:
@@ -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;
|
||||
|
@@ -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) */
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user