aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session/session_cli.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_cli.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_cli.c')
-rw-r--r--src/vnet/session/session_cli.c79
1 files changed, 79 insertions, 0 deletions
diff --git a/src/vnet/session/session_cli.c b/src/vnet/session/session_cli.c
index 9f6d74c031d..563ee83c758 100644
--- a/src/vnet/session/session_cli.c
+++ b/src/vnet/session/session_cli.c
@@ -14,6 +14,7 @@
*/
#include <vnet/session/application.h>
#include <vnet/session/session.h>
+#include <vnet/session/session_debug.h>
u8 *
format_session_fifos (u8 * s, va_list * args)
@@ -879,6 +880,84 @@ VLIB_CLI_COMMAND (session_enable_disable_command, static) =
};
/* *INDENT-ON* */
+#if SESSION_DEBUG
+
+static clib_error_t *
+show_session_dbg_clock_cycles_fn (vlib_main_t * vm, unformat_input_t * input,
+ vlib_cli_command_t * cmd)
+{
+ u32 thread;
+
+ if (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
+ return clib_error_return (0, "unknown input `%U'", format_unformat_error,
+ input);
+
+ for (thread = 0; thread < vec_len (session_dbg_main.wrk); thread++)
+ {
+ vlib_cli_output (vm, "Threads %u:\n", thread);
+ session_dbg_evts_t *sdm = &session_dbg_main.wrk[thread];
+
+#define _(sym, disp, type, str) \
+ if(disp) \
+ { \
+ if (!type) \
+ vlib_cli_output (vm, "\t %25s : %12lu ", \
+ str, sdm->sess_dbg_evt_type[SESS_Q_##sym].u64);\
+ else \
+ vlib_cli_output (vm, "\t %25s : %12.3f ", \
+ str, sdm->sess_dbg_evt_type[SESS_Q_##sym].f64);\
+ }
+
+ foreach_session_events
+#undef _
+ }
+ return 0;
+}
+
+
+/* *INDENT-OFF* */
+VLIB_CLI_COMMAND (show_session_dbg_clock_cycles_command, static) =
+{
+ .path = "show session dbg clock_cycles",
+ .short_help = "show session dbg clock_cycles",
+ .function = show_session_dbg_clock_cycles_fn,
+};
+/* *INDENT-ON* */
+
+
+static clib_error_t *
+clear_session_dbg_clock_cycles_fn (vlib_main_t * vm, unformat_input_t * input,
+ vlib_cli_command_t * cmd)
+{
+ session_dbg_evts_t *sdb;
+ u32 thread;
+
+ if (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
+ return clib_error_return (0, "unknown input `%U'", format_unformat_error,
+ input);
+
+ for (thread = 0; thread < vec_len (session_dbg_main.wrk); thread++)
+ {
+ sdb = &session_dbg_main.wrk[thread];
+ clib_memset (sdb, 0, sizeof (session_dbg_evts_t));
+ sdb->last_time = vlib_time_now (vlib_mains[thread]);
+ }
+
+ return 0;
+}
+
+
+/* *INDENT-OFF* */
+VLIB_CLI_COMMAND (clear_session_clock_cycles_command, static) =
+{
+ .path = "clear session dbg clock_cycles",
+ .short_help = "clear session dbg clock_cycles",
+ .function = clear_session_dbg_clock_cycles_fn,
+};
+#endif /* #if SESSION_DEBUG */
+
+/* *INDENT-ON* */
+
/*
* fd.io coding-style-patch-verification: ON
*