summaryrefslogtreecommitdiffstats
path: root/vlib
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2016-06-09 16:16:27 +0200
committerChris Luke <chris_luke@cable.comcast.com>2016-06-09 20:03:34 +0000
commitdb7b2697360dbcc6198ec0518db817050876fef2 (patch)
treec71920d41b1992028b890f8d9505958fa8631f8c /vlib
parenta7e83ceeacccb20516ffdd8e1beb9695c1e977b1 (diff)
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 <damarion@cisco.com>
Diffstat (limited to 'vlib')
-rw-r--r--vlib/vlib/trace.c17
-rw-r--r--vlib/vlib/trace.h3
2 files changed, 15 insertions, 5 deletions
diff --git a/vlib/vlib/trace.c b/vlib/vlib/trace.c
index d430460be32..86a04aa64d1 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 fe5d7377861..6e9ed495734 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 */