aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Warnicke <eaw@cisco.com>2015-12-22 18:55:08 -0700
committerEd Warnicke <eaw@cisco.com>2015-12-22 18:55:08 -0700
commit81aa0e5bb88ce5323ac01b3c2a497e6a7cc0932a (patch)
treead18f6135e8f60724ea345e69e6b69488ee9d453
parent2c29d75021d684559146e656aac85f0c14ffb5ab (diff)
Fix to show trace output.
Change-Id: I0834eac9c17941d3d5b2aa5791d6deaabd8f6977 Signed-off-by: Ed Warnicke <eaw@cisco.com>
-rw-r--r--vlib/vlib/trace.c11
1 files changed, 7 insertions, 4 deletions
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;
}