summaryrefslogtreecommitdiffstats
path: root/src/plugins/dispatch-trace
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2021-03-26 11:38:01 +0100
committerDamjan Marion <damarion@cisco.com>2021-03-26 16:35:22 +0100
commit92ccf9bcd2692b4b415f31044560c735d639a35c (patch)
treef5308e25329d6853921b7ea4a74d5c3b6f149b25 /src/plugins/dispatch-trace
parentfd8deb48c7ad63b47c5d7465ceefcadef0316f93 (diff)
vlib: convert foreach_vlib_main macro to be more gdb and clang-format friendly
Type: improvement Change-Id: I1152e58d7bfcb3c4347147f87a834d45ad51cdfe Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/plugins/dispatch-trace')
-rw-r--r--src/plugins/dispatch-trace/main.c48
1 files changed, 25 insertions, 23 deletions
diff --git a/src/plugins/dispatch-trace/main.c b/src/plugins/dispatch-trace/main.c
index 0650997889d..ce662dc0eea 100644
--- a/src/plugins/dispatch-trace/main.c
+++ b/src/plugins/dispatch-trace/main.c
@@ -257,23 +257,24 @@ vlib_pcap_dispatch_trace_configure (vlib_pcap_dispatch_trace_args_t *a)
/* Independent of enable/disable, to allow buffer trace multi nodes */
if (a->buffer_trace_node_index != ~0)
{
- foreach_vlib_main (({
- tm = &this_vlib_main->trace_main;
- tm->verbose = 0; /* not sure this ever did anything... */
- vec_validate (tm->nodes, a->buffer_trace_node_index);
- tn = tm->nodes + a->buffer_trace_node_index;
- tn->limit += a->buffer_traces_to_capture;
- if (a->post_mortem)
- {
- tm->filter_flag = FILTER_FLAG_POST_MORTEM;
- tm->filter_count = ~0;
- }
- tm->trace_enable = 1;
- if (vlib_node_set_dispatch_wrapper (this_vlib_main,
- dispatch_pcap_trace))
- clib_warning (0, "Dispatch wrapper already in use on thread %u",
- this_vlib_main->thread_index);
- }));
+ foreach_vlib_main ()
+ {
+ tm = &this_vlib_main->trace_main;
+ tm->verbose = 0; /* not sure this ever did anything... */
+ vec_validate (tm->nodes, a->buffer_trace_node_index);
+ tn = tm->nodes + a->buffer_trace_node_index;
+ tn->limit += a->buffer_traces_to_capture;
+ if (a->post_mortem)
+ {
+ tm->filter_flag = FILTER_FLAG_POST_MORTEM;
+ tm->filter_count = ~0;
+ }
+ tm->trace_enable = 1;
+ if (vlib_node_set_dispatch_wrapper (this_vlib_main,
+ dispatch_pcap_trace))
+ clib_warning (0, "Dispatch wrapper already in use on thread %u",
+ this_vlib_main->thread_index);
+ }
vec_add1 (dtm->dispatch_buffer_trace_nodes, a->buffer_trace_node_index);
}
@@ -301,12 +302,13 @@ vlib_pcap_dispatch_trace_configure (vlib_pcap_dispatch_trace_args_t *a)
else
{
dtm->enable = 0;
- foreach_vlib_main (({
- tm = &this_vlib_main->trace_main;
- tm->filter_flag = 0;
- tm->filter_count = 0;
- vlib_node_set_dispatch_wrapper (this_vlib_main, 0);
- }));
+ foreach_vlib_main ()
+ {
+ tm = &this_vlib_main->trace_main;
+ tm->filter_flag = 0;
+ tm->filter_count = 0;
+ vlib_node_set_dispatch_wrapper (this_vlib_main, 0);
+ }
vec_reset_length (dtm->dispatch_buffer_trace_nodes);
if (pm->n_packets_captured)
{