};
/* *INDENT-ON* */
+int vlib_enable_disable_pkt_trace_filter (int enable) __attribute__ ((weak));
+int
+vlib_enable_disable_pkt_trace_filter (int enable)
+{
+ return 0;
+}
+
static clib_error_t *
cli_add_trace_buffer (vlib_main_t * vm,
unformat_input_t * input, vlib_cli_command_t * cmd)
{
unformat_input_t _line_input, *line_input = &_line_input;
vlib_trace_main_t *tm;
+ vlib_node_t *node;
vlib_trace_node_t *tn;
u32 node_index, add;
u8 verbose = 0;
+ int filter = 0;
clib_error_t *error = 0;
if (!unformat_user (input, unformat_line_input, line_input))
;
else if (unformat (line_input, "verbose"))
verbose = 1;
+ else if (unformat (line_input, "filter"))
+ filter = 1;
else
{
error = clib_error_create ("expected NODE COUNT, got `%U'",
}
}
+ node = vlib_get_node (vm, node_index);
+
+ if ((node->flags & VLIB_NODE_FLAG_TRACE_SUPPORTED) == 0)
+ {
+ error = clib_error_create ("node '%U' doesn't support per-node "
+ "tracing. There may be another way to "
+ "initiate trace on this node.",
+ format_vlib_node_name, vm, node_index);
+ goto done;
+ }
+
+ if (filter)
+ {
+ if (vlib_enable_disable_pkt_trace_filter (1 /* enable */ ))
+ {
+ error = clib_error_create ("No packet trace filter configured...");
+ goto done;
+ }
+ }
+
/* *INDENT-OFF* */
foreach_vlib_main ((
{
};
/* *INDENT-ON* */
-
/*
* Configure a filter for packet traces.
*
cli_clear_trace_buffer (vlib_main_t * vm,
unformat_input_t * input, vlib_cli_command_t * cmd)
{
+ vlib_enable_disable_pkt_trace_filter (0 /* enable */ );
clear_trace_buffer ();
return 0;
}
{
}
+int
+vnet_is_packet_traced (vlib_buffer_t * b,
+ u32 classify_table_index, int func)
+__attribute__ ((weak));
+
+int
+vnet_is_packet_traced (vlib_buffer_t * b, u32 classify_table_index, int func)
+{
+ clib_warning ("BUG: STUB called");
+ return 1;
+}
+
/*
* fd.io coding-style-patch-verification: ON
*