From 10e5b4a016061f2d9485ff309d1239abb012aae0 Mon Sep 17 00:00:00 2001 From: Steven Luong Date: Mon, 10 Oct 2022 11:37:57 -0700 Subject: session: make session code compile with SESSION_DEBUG enable Session debug code does not compile anymore due to vlib_mains global variable disappearing over time. Replace it with vlib_get_main_by_index call. Add a cmake variable and pass it from make command line to enable session debug. Notice transport debug is required for session debug. make rebuild VPP_EXTRA_CMAKE_ARGS=-DVPP_TCP_DEBUG_ALWAYS=ON VPP_EXTRA_CMAKE_ARGS+=-DVPP_SESSION_DEBUG=ON Type: fix Signed-off-by: Steven Luong Change-Id: Ic2e887c6b10b77cbabd56934f4931fcfa04a6751 --- src/vnet/session/session_debug.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/vnet/session/session_debug.h') 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 #include +#include #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) -- cgit 1.2.3-korg