aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session/session_cli.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2020-02-09 20:03:12 +0000
committerFlorin Coras <florin.coras@gmail.com>2020-02-11 20:30:11 +0000
commit16d974ec59776f0103ad62d0d04dc57989eef7ed (patch)
tree616dbcea0b086002e1245b92adea4a75b879d110 /src/vnet/session/session_cli.c
parent90d28846f963a86d760b4a6b83aed62b862f1c61 (diff)
session: avoid scanning new io list under load
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Idaa7cc26ad941be86daec4ed5920727237712f4a
Diffstat (limited to 'src/vnet/session/session_cli.c')
-rw-r--r--src/vnet/session/session_cli.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/vnet/session/session_cli.c b/src/vnet/session/session_cli.c
index 4d4141da375..aba1c610e18 100644
--- a/src/vnet/session/session_cli.c
+++ b/src/vnet/session/session_cli.c
@@ -439,6 +439,39 @@ session_cli_show_session_filter (vlib_main_t * vm, u32 thread_index,
count);
}
+void
+session_cli_show_events_thread (vlib_main_t * vm, u32 thread_index)
+{
+ session_worker_t *wrk;
+
+ wrk = session_main_get_worker_if_valid (thread_index);
+ if (!wrk)
+ {
+ vlib_cli_output (vm, "invalid thread index %u", thread_index);
+ return;
+ }
+
+ vlib_cli_output (vm, "Thread %d:\n", thread_index);
+ vlib_cli_output (vm, " evt elements alloc: %u",
+ pool_elts (wrk->event_elts));
+ vlib_cli_output (vm, " ctrl evt elt data alloc: %d",
+ pool_elts (wrk->ctrl_evts_data));
+}
+
+static void
+session_cli_show_events (vlib_main_t * vm, u32 thread_index)
+{
+ session_main_t *smm = &session_main;
+ if (!thread_index)
+ {
+ session_cli_show_events_thread (vm, thread_index);
+ return;
+ }
+
+ for (thread_index = 0; thread_index < vec_len (smm->wrk); thread_index++)
+ session_cli_show_events_thread (vm, thread_index);
+}
+
static void
session_cli_print_transport_protos (vlib_main_t * vm)
{
@@ -469,6 +502,7 @@ show_session_command_fn (vlib_main_t * vm, unformat_input_t * input,
app_worker_t *app_wrk;
u32 transport_index;
const u8 *app_name;
+ u8 do_events = 0;
int verbose = 0;
session_t *s;
@@ -559,6 +593,8 @@ show_session_command_fn (vlib_main_t * vm, unformat_input_t * input,
session_cli_print_session_states (vm);
goto done;
}
+ else if (unformat (line_input, "events"))
+ do_events = 1;
else
{
error = clib_error_return (0, "unknown input `%U'",
@@ -607,6 +643,12 @@ show_session_command_fn (vlib_main_t * vm, unformat_input_t * input,
goto done;
}
+ if (do_events)
+ {
+ session_cli_show_events (vm, thread_index);
+ goto done;
+ }
+
if (do_filter)
{
if (end < start)