aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session/session_debug.h
diff options
context:
space:
mode:
authorSteven Luong <sluong@cisco.com>2022-10-25 13:09:11 -0700
committerFlorin Coras <florin.coras@gmail.com>2022-10-26 18:03:30 +0000
commitd810a6e218e9af3c3bccd58c9a2d925a7f12242e (patch)
tree66ee520bbe6c31be2c893a9dc1d0717204dfbe79 /src/vnet/session/session_debug.h
parent5efc0cdf48e45ff457c5ddead157165b725e78f3 (diff)
session: add session event log for session state
To aid sesipon debug, add session event log in SM debug to track the session state. Type: improvement Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: I6909cf969cd5b6a3ea5a06d08ae32c2f1d48f686
Diffstat (limited to 'src/vnet/session/session_debug.h')
-rw-r--r--src/vnet/session/session_debug.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/vnet/session/session_debug.h b/src/vnet/session/session_debug.h
index 588d58c790c..614ffc95a7b 100644
--- a/src/vnet/session/session_debug.h
+++ b/src/vnet/session/session_debug.h
@@ -28,6 +28,7 @@
_ (DISPATCH_START, CLOCKS_EVT_DBG, 1, "dispatch start") \
_ (DISPATCH_END, CLOCKS_EVT_DBG, 1, "dispatch end") \
_ (DSP_CNTRS, CLOCKS_EVT_DBG, 1, "dispatch counters") \
+ _ (STATE_CHANGE, SM, 1, "session state change") \
_ (FREE, SM, 1, "session free") \
_ (IO_EVT_COUNTS, COUNTS_EVT_DBG, 1, "io evt counts") \
_ (COUNTS, COUNTS_EVT_DBG, 1, "ctrl evt counts")
@@ -165,6 +166,32 @@ extern session_dbg_main_t session_dbg_main;
ed = ELOG_DATA (&vlib_global_main.elog_main, _e)
#if SESSION_SM
+#define SESSION_EVT_STATE_CHANGE_HANDLER(_s) \
+ { \
+ ELOG_TYPE_DECLARE (_e) = { \
+ .format = "%s: idx %u", \
+ .format_args = "t4i4", \
+ .n_enum_strings = 12, \
+ .enum_strings = { \
+ "created", \
+ "listening", \
+ "connecting", \
+ "accepting", \
+ "ready", \
+ "opened", \
+ "transport closing", \
+ "closing", \
+ "app closed", \
+ "transport closed", \
+ "closed", \
+ "transport deleted", \
+ }, \
+ }; \
+ DEC_SESSION_ETD (_s, _e, 2); \
+ ed->data[0] = _s->session_state; \
+ ed->data[1] = _s->session_index; \
+ }
+
#define SESSION_EVT_FREE_HANDLER(_s) \
{ \
ELOG_TYPE_DECLARE (_e) = { \
@@ -175,6 +202,7 @@ extern session_dbg_main_t session_dbg_main;
ed->data[0] = _s->session_index; \
}
#else
+#define SESSION_EVT_STATE_CHANGE_HANDLER(_s)
#define SESSION_EVT_FREE_HANDLER(_s)
#endif