X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvlib%2Ftrace.h;h=d045271f85337111fd56db3c5456f8cc0eb138c5;hb=refs%2Fchanges%2F10%2F35810%2F4;hp=0560913c588349165fbb8849f3e14e50f19e6ea4;hpb=f8b8586b699bae9e786726f2697c3e642d904c61;p=vpp.git diff --git a/src/vlib/trace.h b/src/vlib/trace.h index 0560913c588..d045271f853 100644 --- a/src/vlib/trace.h +++ b/src/vlib/trace.h @@ -66,6 +66,20 @@ typedef struct u32 limit; } vlib_trace_node_t; +/* Callback type for post-processing the vlib trace buffer */ +struct vlib_main_t; +struct vlib_trace_main_t; +typedef void (vlib_trace_buffer_callback_t) (struct vlib_main_t *, + struct vlib_trace_main_t *); + +/* Callback type for alternate handling of vlib_add_trace internals */ +struct vlib_node_runtime_t; +struct vlib_buffer_t; +typedef void *(vlib_add_trace_callback_t) (struct vlib_main_t *, + struct vlib_node_runtime_t * r, + struct vlib_buffer_t * b, + u32 n_data_bytes); + typedef struct { /* Pool of trace buffers. */ @@ -77,6 +91,7 @@ typedef struct #define FILTER_FLAG_NONE 0 #define FILTER_FLAG_INCLUDE 1 #define FILTER_FLAG_EXCLUDE 2 +#define FILTER_FLAG_POST_MORTEM 3 u32 filter_count; /* set on trace add, cleared on clear trace */ @@ -87,8 +102,26 @@ typedef struct /* verbosity */ int verbose; + + /* a callback to enable customized consumption of the trace buffer content */ + vlib_trace_buffer_callback_t *trace_buffer_callback; + + /* a callback to enable customized addition of a new trace */ + vlib_add_trace_callback_t *add_trace_callback; + } vlib_trace_main_t; +format_function_t format_vlib_trace; + +void trace_apply_filter (struct vlib_main_t *vm); +int trace_time_cmp (void *a1, void *a2); +void vlib_trace_stop_and_clear (void); +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 */ /*