summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/vnet/session/session_debug.c11
-rw-r--r--src/vnet/session/session_debug.h6
-rw-r--r--src/vpp/vnet/config.h.in1
3 files changed, 16 insertions, 2 deletions
diff --git a/src/vnet/session/session_debug.c b/src/vnet/session/session_debug.c
index 8e4588ecd0b..e4efe1b244e 100644
--- a/src/vnet/session/session_debug.c
+++ b/src/vnet/session/session_debug.c
@@ -61,6 +61,13 @@ VLIB_CLI_COMMAND (show_session_dbg_clock_cycles_command, static) =
};
/* *INDENT-ON* */
+static_always_inline f64
+session_dbg_time_now (u32 thread)
+{
+ vlib_main_t *vm = vlib_get_main_by_index (thread);
+
+ return clib_time_now (&vm->clib_time) + vm->time_offset;
+}
static clib_error_t *
clear_session_dbg_clock_cycles_fn (vlib_main_t * vm, unformat_input_t * input,
@@ -77,7 +84,7 @@ clear_session_dbg_clock_cycles_fn (vlib_main_t * vm, unformat_input_t * input,
{
sde = &session_dbg_main.wrk[thread];
clib_memset (sde, 0, sizeof (session_dbg_evts_t));
- sde->last_time = vlib_time_now (vlib_mains[thread]);
+ sde->last_time = session_dbg_time_now (thread);
sde->start_time = sde->last_time;
}
@@ -107,7 +114,7 @@ session_debug_init (void)
for (thread = 0; thread < num_threads; thread++)
{
clib_memset (&sdm->wrk[thread], 0, sizeof (session_dbg_evts_t));
- sdm->wrk[thread].start_time = vlib_time_now (vlib_mains[thread]);
+ sdm->wrk[thread].start_time = session_dbg_time_now (thread);
}
}
#else
diff --git a/src/vnet/session/session_debug.h b/src/vnet/session/session_debug.h
index 9e49a35dbe6..4f49ea1d2f2 100644
--- a/src/vnet/session/session_debug.h
+++ b/src/vnet/session/session_debug.h
@@ -17,6 +17,7 @@
#include <vnet/session/transport.h>
#include <vlib/vlib.h>
+#include <vpp/vnet/config.h>
#define foreach_session_dbg_evt \
_(ENQ, "enqueue") \
@@ -94,7 +95,12 @@ typedef struct session_dbg_main_
extern session_dbg_main_t session_dbg_main;
+#ifdef VPP_SESSION_DEBUG
+#define SESSION_DEBUG 1 * (TRANSPORT_DEBUG > 0)
+#else
#define SESSION_DEBUG 0 * (TRANSPORT_DEBUG > 0)
+#endif
+
#define SESSION_DEQ_EVTS (0)
#define SESSION_DISPATCH_DBG (0)
#define SESSION_EVT_POLL_DBG (0)
diff --git a/src/vpp/vnet/config.h.in b/src/vpp/vnet/config.h.in
index ccf157197ba..e8548c9b492 100644
--- a/src/vpp/vnet/config.h.in
+++ b/src/vpp/vnet/config.h.in
@@ -19,5 +19,6 @@
#define VPP_SANITIZE_ADDR_OPTIONS "@VPP_SANITIZE_ADDR_OPTIONS@"
#cmakedefine VPP_IP_FIB_MTRIE_16
#cmakedefine VPP_TCP_DEBUG_ALWAYS
+#cmakedefine VPP_SESSION_DEBUG
#endif