summaryrefslogtreecommitdiffstats
path: root/src/plugins/tracedump/tracedump.c
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2020-07-17 17:16:34 -0400
committerDamjan Marion <dmarion@me.com>2020-07-19 13:06:06 +0000
commit38ca6e62d725ab81d304fb1af4ec8aae2fd78ba6 (patch)
tree9a05b8ba3d19b167e4cf613c9911eb5abcf55a2c /src/plugins/tracedump/tracedump.c
parent2e64b5a934a6e014c161e6f73aa461db1e4c7449 (diff)
api: call api reaper callbacks for socket clients
Add a callback to clear the per-client packet trace buffer cache. Save the packet trace dump pg setup script. Type: improvement Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I252be911b5f937ece0da5dca152263ece3d52963
Diffstat (limited to 'src/plugins/tracedump/tracedump.c')
-rw-r--r--src/plugins/tracedump/tracedump.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/plugins/tracedump/tracedump.c b/src/plugins/tracedump/tracedump.c
index 87e6cf6ac5f..21a0c3d0379 100644
--- a/src/plugins/tracedump/tracedump.c
+++ b/src/plugins/tracedump/tracedump.c
@@ -61,6 +61,23 @@ toss_client_cache (tracedump_main_t * tdmp, u32 client_index,
tdmp->traces[client_index] = client_trace_cache;
}
+static clib_error_t *
+tracedump_cache_reaper (u32 client_index)
+{
+ tracedump_main_t *tdmp = &tracedump_main;
+ vlib_trace_header_t ***client_trace_cache;
+
+ /* Its likely that we won't have a cache entry */
+ if (client_index >= vec_len (tdmp->traces))
+ return 0;
+
+ client_trace_cache = tdmp->traces[client_index];
+ toss_client_cache (tdmp, client_index, client_trace_cache);
+ return 0;
+}
+
+VL_MSG_API_REAPER_FUNCTION (tracedump_cache_reaper);
+
/* API message handler */
static void
vl_api_trace_dump_t_handler (vl_api_trace_dump_t * mp)