From 81aa0e5bb88ce5323ac01b3c2a497e6a7cc0932a Mon Sep 17 00:00:00 2001 From: Ed Warnicke Date: Tue, 22 Dec 2015 18:55:08 -0700 Subject: Fix to show trace output. Change-Id: I0834eac9c17941d3d5b2aa5791d6deaabd8f6977 Signed-off-by: Ed Warnicke --- vlib/vlib/trace.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'vlib') diff --git a/vlib/vlib/trace.c b/vlib/vlib/trace.c index 43c000f4ccf..d133ca4c627 100644 --- a/vlib/vlib/trace.c +++ b/vlib/vlib/trace.c @@ -188,6 +188,7 @@ cli_show_trace_buffer (vlib_main_t * vm, vlib_trace_header_t ** h, ** traces; u32 i, index = 0; char * fmt; + u8 * s = 0; /* Get active traces from pool. */ @@ -195,8 +196,8 @@ cli_show_trace_buffer (vlib_main_t * vm, ({ void *mainheap; - fmt = "------------------- Start of thread %d %v -------------------"; - vlib_cli_output (vm, fmt, index, vlib_worker_threads[index].name); + fmt = "------------------- Start of thread %d %s -------------------\n"; + s = format (s, fmt, index, vlib_worker_threads[index].name); tm = &this_vlib_main->trace_main; @@ -210,7 +211,7 @@ cli_show_trace_buffer (vlib_main_t * vm, if (vec_len (traces) == 0) { clib_mem_set_heap (mainheap); - vlib_cli_output (vm, "No packets in trace buffer"); + s = format (s, "No packets in trace buffer\n"); goto done; } @@ -221,7 +222,7 @@ cli_show_trace_buffer (vlib_main_t * vm, { clib_mem_set_heap (mainheap); - vlib_cli_output (vm, "Packet %d\n%U\n\n", i + 1, + s = format (s, "Packet %d\n%U\n\n", i + 1, format_vlib_trace, vm, traces[i]); mainheap = clib_mem_set_heap (this_vlib_main->heap_base); @@ -234,6 +235,8 @@ cli_show_trace_buffer (vlib_main_t * vm, index++; })); + vlib_cli_output (vm, s); + vec_free (s); return 0; } -- cgit 1.2.3-korg