+static clib_error_t *
+show_session_fifo_trace_command_fn (vlib_main_t * vm,
+ unformat_input_t * input,
+ vlib_cli_command_t * cmd)
+{
+ session_t *s = 0;
+ u8 is_rx = 0, *str = 0;
+
+ while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
+ {
+ if (unformat (input, "%U", unformat_session, &s))
+ ;
+ else if (unformat (input, "rx"))
+ is_rx = 1;
+ else if (unformat (input, "tx"))
+ is_rx = 0;
+ else
+ return clib_error_return (0, "unknown input `%U'",
+ format_unformat_error, input);
+ }
+
+ if (!SVM_FIFO_TRACE)
+ {
+ vlib_cli_output (vm, "fifo tracing not enabled");
+ return 0;
+ }
+
+ if (!s)
+ {
+ vlib_cli_output (vm, "could not find session");
+ return 0;
+ }
+
+ str = is_rx ?
+ svm_fifo_dump_trace (str, s->rx_fifo) :
+ svm_fifo_dump_trace (str, s->tx_fifo);
+
+ vlib_cli_output (vm, "%v", str);
+ return 0;
+}
+
+/* *INDENT-OFF* */
+VLIB_CLI_COMMAND (show_session_fifo_trace_command, static) =
+{
+ .path = "show session fifo trace",
+ .short_help = "show session fifo trace <session>",
+ .function = show_session_fifo_trace_command_fn,
+};
+/* *INDENT-ON* */
+
+static clib_error_t *
+session_replay_fifo_command_fn (vlib_main_t * vm, unformat_input_t * input,
+ vlib_cli_command_t * cmd)
+{
+ session_t *s = 0;
+ u8 is_rx = 0, *str = 0;
+
+ while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
+ {
+ if (unformat (input, "%U", unformat_session, &s))
+ ;
+ else if (unformat (input, "rx"))
+ is_rx = 1;
+ else
+ return clib_error_return (0, "unknown input `%U'",
+ format_unformat_error, input);
+ }
+
+ if (!SVM_FIFO_TRACE)
+ {
+ vlib_cli_output (vm, "fifo tracing not enabled");
+ return 0;
+ }
+
+ if (!s)
+ {
+ vlib_cli_output (vm, "could not find session");
+ return 0;
+ }
+
+ str = is_rx ?
+ svm_fifo_replay (str, s->rx_fifo, 0, 1) :
+ svm_fifo_replay (str, s->tx_fifo, 0, 1);
+
+ vlib_cli_output (vm, "%v", str);
+ return 0;
+}
+
+/* *INDENT-OFF* */
+VLIB_CLI_COMMAND (session_replay_fifo_trace_command, static) =
+{
+ .path = "session replay fifo",
+ .short_help = "session replay fifo <session>",
+ .function = session_replay_fifo_command_fn,
+};
+/* *INDENT-ON* */
+