diff options
author | 2015-12-23 11:10:48 +0000 | |
---|---|---|
committer | 2015-12-23 11:10:49 +0000 | |
commit | bd2e9ba2b497e56b5476f23e6a84b52080944915 (patch) | |
tree | aed4173457f0d135c7a9099d7d0a5e99add44832 | |
parent | 613c17266680c65bdcf4449b787e46714861e061 (diff) | |
parent | 81aa0e5bb88ce5323ac01b3c2a497e6a7cc0932a (diff) |
Merge "Fix to show trace output."
-rw-r--r-- | vlib/vlib/trace.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/vlib/vlib/trace.c b/vlib/vlib/trace.c index 43c000f4..d133ca4c 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; } |