diff options
Diffstat (limited to 'src/vlib')
-rw-r--r-- | src/vlib/main.h | 3 | ||||
-rw-r--r-- | src/vlib/trace.c | 15 | ||||
-rw-r--r-- | src/vlib/trace.h | 1 | ||||
-rw-r--r-- | src/vlib/trace_funcs.h | 2 |
4 files changed, 11 insertions, 10 deletions
diff --git a/src/vlib/main.h b/src/vlib/main.h index 766c9ec3756..adfdc87bf7c 100644 --- a/src/vlib/main.h +++ b/src/vlib/main.h @@ -77,8 +77,7 @@ typedef struct typedef struct { u8 trace_filter_enable; - u32 trace_classify_table_index; - u32 trace_filter_set_index; + u32 classify_table_index; } vlib_trace_filter_t; typedef enum diff --git a/src/vlib/trace.c b/src/vlib/trace.c index 152744432c5..156378af8e3 100644 --- a/src/vlib/trace.c +++ b/src/vlib/trace.c @@ -39,6 +39,7 @@ #include <vlib/vlib.h> #include <vlib/threads.h> +#include <vnet/classify/vnet_classify.h> u8 *vnet_trace_placeholder; @@ -110,7 +111,7 @@ vlib_trace_frame_buffers_only (vlib_main_t * vm, } /* Free up all trace buffer memory. */ -always_inline void +void clear_trace_buffer (void) { int i; @@ -416,6 +417,8 @@ trace_update_capture_options (u32 add, u32 node_index, u32 filter, u8 verbose) tm->trace_enable = 1; })); /* *INDENT-ON* */ + + vlib_enable_disable_pkt_trace_filter (! !filter); } static clib_error_t * @@ -464,13 +467,11 @@ cli_add_trace_buffer (vlib_main_t * vm, goto done; } - if (filter) + u32 filter_table = classify_get_trace_chain (); + if (filter && filter_table == ~0) { - if (vlib_enable_disable_pkt_trace_filter (1 /* enable */ )) - { - error = clib_error_create ("No packet trace filter configured..."); - goto done; - } + error = clib_error_create ("No packet trace filter configured..."); + goto done; } trace_update_capture_options (add, node_index, filter, verbose); diff --git a/src/vlib/trace.h b/src/vlib/trace.h index ae9bd6913d3..d045271f853 100644 --- a/src/vlib/trace.h +++ b/src/vlib/trace.h @@ -120,6 +120,7 @@ int vlib_enable_disable_pkt_trace_filter (int enable) __attribute__ ((weak)); void trace_update_capture_options (u32 add, u32 node_index, u32 filter, u8 verbose); void trace_filter_set (u32 node_index, u32 flag, u32 count); +void clear_trace_buffer (void); #endif /* included_vlib_trace_h */ diff --git a/src/vlib/trace_funcs.h b/src/vlib/trace_funcs.h index 8dd5310ae76..357079c4e3d 100644 --- a/src/vlib/trace_funcs.h +++ b/src/vlib/trace_funcs.h @@ -154,7 +154,7 @@ vlib_trace_buffer (vlib_main_t * vm, { /* See if we're supposed to trace this packet... */ if (vnet_is_packet_traced - (b, vlib_global_main.trace_filter.trace_classify_table_index, + (b, vlib_global_main.trace_filter.classify_table_index, 0 /* full classify */ ) != 1) return 0; } |