aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/tracedump/tracedump.api
diff options
context:
space:
mode:
authorMaxime Peim <mpeim@cisco.com>2023-04-11 15:45:59 +0000
committerBeno�t Ganne <bganne@cisco.com>2023-05-23 11:40:29 +0000
commit02063b985ac2fd3ce24a42fe9e27f434ea088053 (patch)
tree601ee00fac0d921105d9e190ec19efa4745ffc42 /src/plugins/tracedump/tracedump.api
parenteed42b0efa576a6a0efa93df7c3e96ce3296f7af (diff)
misc: fix tracedump API to match CLI behavior
When dumping packets from multiple threads using the API, first all packets from thread 0 are dumped then all ones from thread 1, etc Until we reach the limit specified by the API call, so we could never get packets trace from threads with higher ids. However, the tracedump CLI dump a maximum number of packets from all threads, which we can expect from the API to do. We also add a trace_clear_cache API so the client gets an answer when he only wants to clear its packet cache. Type: improvement Change-Id: I0d4df8f6210a298ac3f22cd651eb4d8f445e1034 Signed-off-by: Maxime Peim <mpeim@cisco.com>
Diffstat (limited to 'src/plugins/tracedump/tracedump.api')
-rw-r--r--src/plugins/tracedump/tracedump.api48
1 files changed, 47 insertions, 1 deletions
diff --git a/src/plugins/tracedump/tracedump.api b/src/plugins/tracedump/tracedump.api
index 540b0664074..ed6dd3f13bd 100644
--- a/src/plugins/tracedump/tracedump.api
+++ b/src/plugins/tracedump/tracedump.api
@@ -25,7 +25,7 @@
*/
-option version = "0.1.0";
+option version = "0.2.0";
enum trace_filter_flag : u32
{
@@ -147,3 +147,49 @@ define trace_details {
u32 packet_number;
string trace_data[];
};
+
+/** \brief trace_clear_cache
+ @param client_index - opaque cookie to identify the sender
+ @param context - sender context, to match reply w/ request
+*/
+autoreply define trace_clear_cache {
+ u32 client_index;
+ u32 context;
+};
+
+/** \brief trace_v2_dump
+ @param client_index - opaque cookie to identify the sender
+ @param context - sender context, to match reply w/ request
+ @param thread_id - specific thread to dump from, ~0 to dump from all
+ @param position - position of the first packet to dump in the per thread cache, ~0 to only clear the cache
+ @param max - maximum of packets to dump from each thread
+ @param clear_cache - dispose of any cached data before we begin
+*/
+define trace_v2_dump {
+ u32 client_index;
+ u32 context;
+
+ u32 thread_id [default=0xffffffff];
+ u32 position;
+ u32 max [default=50];
+ bool clear_cache;
+
+ option vat_help = "trace_v2_dump [thread_id <tid>] [position <pos>] [max <max>]";
+};
+
+/** \brief trace_v2_details
+ @param context - sender context, to match reply w/ request
+ @param thread_id - thread index from which the packet come from
+ @param position - position of the packet in its thread cache
+ @param more - true if there is still more packets to dump for this thread
+ @param trace_data - string packet data
+*/
+define trace_v2_details {
+ u32 context;
+
+ u32 thread_id;
+ u32 position;
+ bool more;
+
+ string trace_data[];
+}; \ No newline at end of file