From db7b2697360dbcc6198ec0518db817050876fef2 Mon Sep 17 00:00:00 2001 From: Damjan Marion Date: Thu, 9 Jun 2016 16:16:27 +0200 Subject: Add verbose flag for packet trace, show hexdump in verbose dpdk input trace Verbose trace can be enabled with: trace add dpdk-input 1 verbose Change-Id: If58cfc561143d5a44f7d11e61d54b6835692a0e3 Signed-off-by: Damjan Marion --- vlib/vlib/trace.c | 17 ++++++++++++----- vlib/vlib/trace.h | 3 +++ 2 files changed, 15 insertions(+), 5 deletions(-) (limited to 'vlib') diff --git a/vlib/vlib/trace.c b/vlib/vlib/trace.c index d430460b..86a04aa6 100644 --- a/vlib/vlib/trace.c +++ b/vlib/vlib/trace.c @@ -359,12 +359,18 @@ cli_add_trace_buffer (vlib_main_t * vm, vlib_trace_main_t * tm; vlib_trace_node_t * tn; u32 node_index, add; + u8 verbose = 0; - if (unformat (input, "%U %d", unformat_vlib_node, vm, &node_index, &add)) - ; - else - return clib_error_create ("expected NODE COUNT, got `%U'", - format_unformat_error, input); + while (unformat_check_input(input) != (uword)UNFORMAT_END_OF_INPUT) + { + if (unformat (input, "%U %d", unformat_vlib_node, vm, &node_index, &add)) + ; + else if (unformat (input, "verbose")) + verbose = 1; + else + return clib_error_create ("expected NODE COUNT, got `%U'", + format_unformat_error, input); + } foreach_vlib_main ( ({ @@ -372,6 +378,7 @@ cli_add_trace_buffer (vlib_main_t * vm, tm = &this_vlib_main->trace_main; tm->trace_active_hint = 1; + tm->verbose = verbose; oldheap = clib_mem_set_heap (this_vlib_main->heap_base); diff --git a/vlib/vlib/trace.h b/vlib/vlib/trace.h index fe5d7377..6e9ed495 100644 --- a/vlib/vlib/trace.h +++ b/vlib/vlib/trace.h @@ -81,6 +81,9 @@ typedef struct { /* Per node trace counts. */ vlib_trace_node_t * nodes; + + /* verbosity */ + int verbose; } vlib_trace_main_t; #endif /* included_vlib_trace_h */ -- cgit 1.2.3-korg