summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/tracedump/setup.pg34
-rw-r--r--src/plugins/tracedump/tracedump.c17
2 files changed, 51 insertions, 0 deletions
diff --git a/src/plugins/tracedump/setup.pg b/src/plugins/tracedump/setup.pg
new file mode 100644
index 00000000000..91d5ebe2d2a
--- /dev/null
+++ b/src/plugins/tracedump/setup.pg
@@ -0,0 +1,34 @@
+set term pag off
+
+packet-generator new {
+ name worker0
+ worker 0
+ limit 12
+ rate 1.2e7
+ size 128-128
+ interface local0
+ node ethernet-input
+ data { IP4: 1.2.40 -> 3cfd.fed0.b6c8
+ UDP: 192.168.40.1 - 192.168.40.100 -> 192.168.50.10
+ UDP: 1234 -> 2345
+ incrementing 114
+ }
+}
+
+packet-generator new {
+ name worker1
+ worker 1
+ limit 12
+ rate 1.2e7
+ size 128-128
+ interface local0
+ node ethernet-input
+ data { IP4: 1.2.4 -> 3cfd.fed0.b6c9
+ UDP: 192.168.41.1 - 192.168.41.100 -> 192.168.51.10
+ UDP: 1234 -> 2345
+ incrementing 114
+ }
+}
+
+trace add pg-input 20
+pa en
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)