From c0b195450b31f7092834c0f14a27ca929faf8bca Mon Sep 17 00:00:00 2001 From: Jon Loeliger Date: Mon, 11 May 2020 08:43:51 -0500 Subject: feature: Add packet trace API Also spiffed up the vpp_api_test plugin loader so it executes VLIB_INIT_FUNCTIONs and VLIB_API_INIT_FUNCTIONs. Type: feature Change-Id: Id9a4f455d73738c41bcfea220df2112bb9679681 Signed-off-by: Jon Loeliger Signed-off-by: Ole Troan Signed-off-by: Dave Barach --- src/plugins/tracedump/tracedump.api | 69 ++++++++++++++++++++++++++++++++++++- 1 file changed, 68 insertions(+), 1 deletion(-) (limited to 'src/plugins/tracedump/tracedump.api') diff --git a/src/plugins/tracedump/tracedump.api b/src/plugins/tracedump/tracedump.api index 81e6725abc8..540b0664074 100644 --- a/src/plugins/tracedump/tracedump.api +++ b/src/plugins/tracedump/tracedump.api @@ -1,3 +1,4 @@ +/* Hey Emacs use -*- mode: C -*- */ /* * tracedump.api - streaming packet trace dump API * @@ -23,10 +24,73 @@ * called through a shared memory interface. */ -/* Version and type recitations */ option version = "0.1.0"; +enum trace_filter_flag : u32 +{ + TRACE_FF_NONE = 0, + TRACE_FF_INCLUDE_NODE = 1, + TRACE_FF_EXCLUDE_NODE = 2, + TRACE_FF_INCLUDE_CLASSIFIER = 3, + TRACE_FF_EXCLUDE_CLASSIFIER = 4, +}; + + +/** \brief trace_set_filters + @param client_index - opaque cookie to identify the sender + @param context - sender context, to match reply w/ request + @param flag - One of the trace_filter_flag values + @param node_index = The node-index to include/exclude + @param classifier_table_index = The include/exclude classifier table + @param count = The number of packets to include/exclude +*/ +autoreply define trace_set_filters +{ + u32 client_index; + u32 context; + vl_api_trace_filter_flag_t flag; /* TRACE_FF_* */ + u32 count; + u32 node_index [default = 0xffffffff]; + u32 classifier_table_index [default = 0xffffffff]; + option vat_help = "trace_set_filters [none] | [(include_node|exclude_node) ] | [(include_classifier|exclude_classifier) ] [count ]"; +}; + + +/** \brief trace_capture_packets + @param client_index - opaque cookie to identify the sender + @param context - sender context, to match reply w/ request + @param node_index - graph input node whose packets are captured + @param max_packets - maximum number of packets to capture + @param use_filter - if true, apply filters to select/reject packets + @param verbose - if true, set verbose packet capture flag + @param pre_capture_clear - if true, clear buffer before capture begins +*/ +autoreply define trace_capture_packets +{ + u32 client_index; + u32 context; + u32 node_index; + u32 max_packets; + bool use_filter; + bool verbose; + bool pre_capture_clear; + option vat_help = "trace_capture_packets [node_index ] [max ] [pre_capture_clear] [use_filter] [verbose]"; +}; + + +/** \brief trace_clear_capture + @param client_index - opaque cookie to identify the sender + @param context - sender context, to match reply w/ request +*/ +autoreply define trace_clear_capture +{ + u32 client_index; + u32 context; + option vat_help = "trace_clear_capture"; +}; + + service { rpc trace_dump returns trace_dump_reply stream trace_details; @@ -48,6 +112,8 @@ define trace_dump { /* Max number of replies per burst */ u32 max_records; + + option vat_help = "trace_dump [thread_id ] [position ] [max ]"; }; define trace_dump_reply { @@ -78,5 +144,6 @@ define trace_details { /* Needed when set ends in the middle of a batch */ u8 done; + u32 packet_number; string trace_data[]; }; -- cgit 1.2.3-korg