summaryrefslogtreecommitdiffstats
path: root/src/vnet/session/session.c
diff options
context:
space:
mode:
authorSrikanth Akula <srakula@cisco.com>2020-04-06 19:19:49 -0700
committerFlorin Coras <florin.coras@gmail.com>2020-04-13 00:34:05 +0000
commit7357043d2abc8d3811362f256e7c9086e7b0d378 (patch)
treef8180ff9c606d256e9751974361be15df9d52e99 /src/vnet/session/session.c
parentc39150df4d39f73aad8126db61715ccc73155cee (diff)
session: adding debug events
Type: feature Enhancing the debugging capability of tcp session layer by measing time spent for various events. This is meant only for debugging purpose Signed-off-by: Srikanth Akula <srakula@cisco.com> Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I9f401881b345bcae5f7d8050338637fd47b3723b Signed-off-by: Srikanth Akula <srakula@cisco.com>
Diffstat (limited to 'src/vnet/session/session.c')
-rw-r--r--src/vnet/session/session.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c
index d2dc85efa4e..caa362e1f1d 100644
--- a/src/vnet/session/session.c
+++ b/src/vnet/session/session.c
@@ -25,6 +25,10 @@
session_main_t session_main;
+#if SESSION_DEBUG
+session_dbg_main_t session_dbg_main;
+#endif
+
static inline int
session_send_evt_to_thread (void *data, void *args, u32 thread_index,
session_evt_type_t evt_type)
@@ -1705,6 +1709,17 @@ session_manager_main_enable (vlib_main_t * vm)
/* Enable transports */
transport_enable_disable (vm, 1);
+
+#if SESSION_DEBUG
+ session_dbg_main_t *sdm = &session_dbg_main;
+ vec_validate_aligned (sdm->wrk, num_threads - 1, CLIB_CACHE_LINE_BYTES);
+ int thread;
+ for (thread = 0; thread < num_threads; thread++)
+ {
+ clib_memset (&sdm->wrk[thread], 0, sizeof (session_dbg_evts_t));
+ }
+#endif /* SESSION_DEBUG */
+
return 0;
}