aboutsummaryrefslogtreecommitdiffstats
path: root/vlib-api/vlibmemory
diff options
context:
space:
mode:
authorCalvin <calvin.ference@gmail.com>2016-07-28 13:52:05 -0400
committerDamjan Marion <dmarion.lists@gmail.com>2016-08-31 17:11:56 +0000
commit16649375fec0f313e0919c91addf3ad5d9f6ef17 (patch)
treef8e9c02d509f0ad854e57a85bf369308034d0902 /vlib-api/vlibmemory
parente0d802bc5356594d4e9621ca4cf8cfa8069d9e8e (diff)
VPP-210: Add "sh api status"
Change-Id: I164761bc2b242b6be527d057108dd09b99653ff5 Signed-off-by: Calvin <calvin.ference@gmail.com>
Diffstat (limited to 'vlib-api/vlibmemory')
-rw-r--r--vlib-api/vlibmemory/memory_vlib.c49
1 files changed, 46 insertions, 3 deletions
diff --git a/vlib-api/vlibmemory/memory_vlib.c b/vlib-api/vlibmemory/memory_vlib.c
index 32f0fbcc689..22ca0f3c889 100644
--- a/vlib-api/vlibmemory/memory_vlib.c
+++ b/vlib-api/vlibmemory/memory_vlib.c
@@ -644,9 +644,9 @@ vl_api_show_histogram_command (vlib_main_t * vm,
/* *INDENT-OFF* */
VLIB_CLI_COMMAND (cli_show_api_histogram_command, static) = {
- .path = "show api histogram",
- .short_help = "show api histogram",
- .function = vl_api_show_histogram_command,
+ .path = "show api histogram",
+ .short_help = "show api histogram",
+ .function = vl_api_show_histogram_command,
};
/* *INDENT-ON* */
@@ -907,6 +907,41 @@ socket_clients:
return 0;
}
+static clib_error_t *
+vl_api_status_command (vlib_main_t * vm,
+ unformat_input_t * input, vlib_cli_command_t * cli_cmd)
+{
+ api_main_t *am = &api_main;
+
+ // check if rx_trace and tx_trace are not null pointers
+
+ if (am->rx_trace == 0)
+ {
+ vlib_cli_output (vm, "RX Trace disabled\n");
+ }
+ else
+ {
+ if (am->rx_trace->enabled == 0)
+ vlib_cli_output (vm, "RX Trace disabled\n");
+ else
+ vlib_cli_output (vm, "RX Trace enabled\n");
+ }
+
+ if (am->tx_trace == 0)
+ {
+ vlib_cli_output (vm, "TX Trace disabled\n");
+ }
+ else
+ {
+ if (am->tx_trace->enabled == 0)
+ vlib_cli_output (vm, "TX Trace disabled\n");
+ else
+ vlib_cli_output (vm, "TX Trace enabled\n");
+ }
+
+ return 0;
+}
+
/* *INDENT-OFF* */
VLIB_CLI_COMMAND (cli_show_api_command, static) = {
.path = "show api",
@@ -930,6 +965,14 @@ VLIB_CLI_COMMAND (cli_show_api_clients_command, static) = {
};
/* *INDENT-ON* */
+/* *INDENT-OFF* */
+VLIB_CLI_COMMAND (cli_show_api_status_command, static) = {
+ .path = "show api status",
+ .short_help = "Show API trace status",
+ .function = vl_api_status_command,
+};
+/* *INDENT-ON* */
+
static clib_error_t *
vl_api_message_table_command (vlib_main_t * vm,
unformat_input_t * input,