diff options
author | Benoît Ganne <bganne@cisco.com> | 2024-06-06 10:46:50 +0200 |
---|---|---|
committer | Damjan Marion <dmarion@0xa5.net> | 2024-06-10 13:12:52 +0000 |
commit | fa500e98543989e4cdcbedac19a525d55a8558d5 (patch) | |
tree | 15e0a23186bb737b1d2bbc9fae3e8fa897c76a41 /src/vnet/unix | |
parent | 282f2ecd8e7d68b9930d6f1e2c62205c9dfe8285 (diff) |
vlib: fix gdb_show_traces()
When using gdb_show_traces() in debug mode, don't assert if workers are
not parked, as it is typically called from gdb.
Type: fix
Change-Id: Iabf175d96dc152da4d1abfbce9ccc9020d0b5d61
Signed-off-by: Benoît Ganne <bganne@cisco.com>
Diffstat (limited to 'src/vnet/unix')
-rw-r--r-- | src/vnet/unix/gdb_funcs.c | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/src/vnet/unix/gdb_funcs.c b/src/vnet/unix/gdb_funcs.c index d6fdc985bd9..a89b7202400 100644 --- a/src/vnet/unix/gdb_funcs.c +++ b/src/vnet/unix/gdb_funcs.c @@ -238,44 +238,44 @@ gdb_show_traces () /* Get active traces from pool. */ - foreach_vlib_main () - { - fmt = "------------------- Start of thread %d %s -------------------\n"; - s = format (s, fmt, index, vlib_worker_threads[index].name); + foreach_vlib_main__ (0 /* no checks */) + { + fmt = "------------------- Start of thread %d %s -------------------\n"; + s = format (s, fmt, index, vlib_worker_threads[index].name); - tm = &this_vlib_main->trace_main; + tm = &this_vlib_main->trace_main; - trace_apply_filter (this_vlib_main); + trace_apply_filter (this_vlib_main); - traces = 0; - pool_foreach (h, tm->trace_buffer_pool) - { - vec_add1 (traces, h[0]); - } + traces = 0; + pool_foreach (h, tm->trace_buffer_pool) + { + vec_add1 (traces, h[0]); + } - if (vec_len (traces) == 0) - { - s = format (s, "No packets in trace buffer\n"); - goto done; - } + if (vec_len (traces) == 0) + { + s = format (s, "No packets in trace buffer\n"); + goto done; + } - /* Sort them by increasing time. */ - vec_sort_with_function (traces, trace_cmp); + /* Sort them by increasing time. */ + vec_sort_with_function (traces, trace_cmp); - for (i = 0; i < vec_len (traces); i++) - { - if (i == max) - { - fformat (stderr, - "Limiting display to %d packets." - " To display more specify max.", - max); - goto done; - } - - s = format (s, "Packet %d\n%U\n\n", i + 1, format_vlib_trace, - vlib_get_first_main (), traces[i]); - } + for (i = 0; i < vec_len (traces); i++) + { + if (i == max) + { + fformat (stderr, + "Limiting display to %d packets." + " To display more specify max.", + max); + goto done; + } + + s = format (s, "Packet %d\n%U\n\n", i + 1, format_vlib_trace, + vlib_get_first_main (), traces[i]); + } done: vec_free (traces); |