summaryrefslogtreecommitdiffstats
path: root/src/vlib
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2019-10-18 14:44:05 -0400
committerDave Barach <dave@barachs.net>2019-10-18 14:44:34 -0400
commit349cd1af77a27962e9475e9fa9c0ed15e2af23de (patch)
treed2e2b4b0faf935ab9a16d5773d3fdbecf6addf6a /src/vlib
parent55cc4c4f0aaee3314d7cc105a173ff920c92e767 (diff)
vlib: enable worker-thread dispatch pcap trace
Needed a bit of foreach_vlib_main(...) action to turn on/off all instances of vm->dispatch_pcap_enable, and to pick up the pcap_main_t pointer from vlib_global_main. Type: fix Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I49b69b87934c7dc7a9835cd07aa2c5c4d3c79f18
Diffstat (limited to 'src/vlib')
-rw-r--r--src/vlib/main.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/vlib/main.c b/src/vlib/main.c
index dc11128476b..90ce53de5a0 100644
--- a/src/vlib/main.c
+++ b/src/vlib/main.c
@@ -1023,7 +1023,7 @@ dispatch_pcap_trace (vlib_main_t * vm,
{
int i;
vlib_buffer_t *bufs[VLIB_FRAME_SIZE], **bufp, *b;
- pcap_main_t *pm = &vm->dispatch_pcap_main;
+ pcap_main_t *pm = &vlib_global_main.dispatch_pcap_main;
vlib_trace_main_t *tm = &vm->trace_main;
u32 capture_size;
vlib_node_t *n;
@@ -2243,12 +2243,16 @@ vlib_pcap_dispatch_trace_configure (vlib_pcap_dispatch_trace_args_t * a)
pm->file_name = (char *) a->filename;
pm->n_packets_captured = 0;
pm->packet_type = PCAP_PACKET_TYPE_vpp;
- vm->dispatch_pcap_enable = 1;
pm->n_packets_to_capture = a->packets_to_capture;
+ /* *INDENT-OFF* */
+ foreach_vlib_main (({this_vlib_main->dispatch_pcap_enable = 1;}));
+ /* *INDENT-ON* */
}
else
{
- vm->dispatch_pcap_enable = 0;
+ /* *INDENT-OFF* */
+ foreach_vlib_main (({this_vlib_main->dispatch_pcap_enable = 0;}));
+ /* *INDENT-ON* */
vec_reset_length (vm->dispatch_buffer_trace_nodes);
if (pm->n_packets_captured)
{