FD.io VPP  v20.01-48-g3e0dafb74
Vector Packet Processing
cli.c File Reference

Debug CLI Implementation. More...

+ Include dependency graph for cli.c:

Go to the source code of this file.

Data Structures

struct  vlib_cli_walk_args_t
 

Functions

int vl_api_set_elog_trace_api_messages (int enable)
 
int vl_api_get_elog_trace_api_messages (void)
 
static uwordvlib_cli_sub_command_match (vlib_cli_command_t *c, unformat_input_t *input)
 
uword unformat_vlib_cli_sub_input (unformat_input_t *i, va_list *args)
 
static vlib_cli_command_tget_sub_command (vlib_cli_main_t *cm, vlib_cli_command_t *parent, u32 si)
 
static uword unformat_vlib_cli_sub_command (unformat_input_t *i, va_list *args)
 
static int vlib_cli_cmp_strings (void *a1, void *a2)
 
u8 ** vlib_cli_get_possible_completions (u8 *str)
 
static u8format_vlib_cli_command_help (u8 *s, va_list *args)
 
static u8format_vlib_cli_path (u8 *s, va_list *args)
 
static vlib_cli_command_tall_subs (vlib_cli_main_t *cm, vlib_cli_command_t *subs, u32 command_index)
 
static int vlib_cli_cmp_rule (void *a1, void *a2)
 
static int vlib_cli_cmp_command (void *a1, void *a2)
 
static clib_error_tvlib_cli_dispatch_sub_commands (vlib_main_t *vm, vlib_cli_main_t *cm, unformat_input_t *input, uword parent_command_index)
 
void vlib_unix_error_report (vlib_main_t *, clib_error_t *)
 
int vlib_cli_input (vlib_main_t *vm, unformat_input_t *input, vlib_cli_output_function_t *function, uword function_arg)
 
void vlib_cli_output (vlib_main_t *vm, char *fmt,...)
 
void * vl_msg_push_heap (void)
 
void vl_msg_pop_heap (void *oldheap)
 
void * vlib_stats_push_heap (void *)
 
static clib_error_tshow_memory_usage (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tshow_cpu (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tenable_disable_memory_trace (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_ttest_heap_validate (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_trestart_cmd_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static uword vlib_cli_normalize_path (char *input, char **result)
 
static uword parent_path_len (char *path)
 
static void add_sub_command (vlib_cli_main_t *cm, uword parent_index, uword child_index)
 
static void vlib_cli_make_parent (vlib_cli_main_t *cm, uword ci)
 
static uword vlib_cli_command_is_empty (vlib_cli_command_t *c)
 
clib_error_tvlib_cli_register (vlib_main_t *vm, vlib_cli_command_t *c)
 
static clib_error_telog_trace_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tsuspend_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static int sort_cmds_by_path (void *a1, void *a2)
 
static void cli_recursive_walk (vlib_cli_walk_args_t *aa)
 
static u8format_mp_safe (u8 *s, va_list *args)
 
static clib_error_tshow_cli_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tvlib_cli_init (vlib_main_t *vm)
 

Variables

static void * current_traced_heap
 
static vlib_cli_command_t vlib_cli_show_command
 (constructor) VLIB_CLI_COMMAND (vlib_cli_show_command) More...
 
static vlib_cli_command_t vlib_cli_clear_command
 (constructor) VLIB_CLI_COMMAND (vlib_cli_clear_command) More...
 
static vlib_cli_command_t vlib_cli_set_command
 (constructor) VLIB_CLI_COMMAND (vlib_cli_set_command) More...
 
static vlib_cli_command_t vlib_cli_test_command
 (constructor) VLIB_CLI_COMMAND (vlib_cli_test_command) More...
 
static vlib_cli_command_t show_memory_usage_command
 (constructor) VLIB_CLI_COMMAND (show_memory_usage_command) More...
 
static vlib_cli_command_t show_cpu_command
 (constructor) VLIB_CLI_COMMAND (show_cpu_command) More...
 
static vlib_cli_command_t enable_disable_memory_trace_command
 (constructor) VLIB_CLI_COMMAND (enable_disable_memory_trace_command) More...
 
static vlib_cli_command_t cmd_test_heap_validate
 (constructor) VLIB_CLI_COMMAND (cmd_test_heap_validate) More...
 
static vlib_cli_command_t restart_cmd
 (constructor) VLIB_CLI_COMMAND (restart_cmd) More...
 
static vlib_cli_command_t elog_trace_command
 (constructor) VLIB_CLI_COMMAND (elog_trace_command) More...
 
static vlib_cli_command_t suspend_command
 (constructor) VLIB_CLI_COMMAND (suspend_command) More...
 
static vlib_cli_command_t show_cli_command
 (constructor) VLIB_CLI_COMMAND (show_cli_command) More...
 

Detailed Description

Debug CLI Implementation.

Definition in file cli.c.

Function Documentation

◆ add_sub_command()

static void add_sub_command ( vlib_cli_main_t cm,
uword  parent_index,
uword  child_index 
)
static

Definition at line 1176 of file cli.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ all_subs()

static vlib_cli_command_t* all_subs ( vlib_cli_main_t cm,
vlib_cli_command_t subs,
u32  command_index 
)
static

Definition at line 353 of file cli.c.

+ Here is the caller graph for this function:

◆ cli_recursive_walk()

static void cli_recursive_walk ( vlib_cli_walk_args_t aa)
static

Definition at line 1632 of file cli.c.

+ Here is the caller graph for this function:

◆ elog_trace_command_fn()

static clib_error_t* elog_trace_command_fn ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 1467 of file cli.c.

+ Here is the call graph for this function:

◆ enable_disable_memory_trace()

static clib_error_t* enable_disable_memory_trace ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 899 of file cli.c.

+ Here is the call graph for this function:

◆ format_mp_safe()

static u8* format_mp_safe ( u8 s,
va_list *  args 
)
static

Definition at line 1668 of file cli.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ format_vlib_cli_command_help()

static u8* format_vlib_cli_command_help ( u8 s,
va_list *  args 
)
static

Definition at line 329 of file cli.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ format_vlib_cli_path()

static u8* format_vlib_cli_path ( u8 s,
va_list *  args 
)
static

Definition at line 343 of file cli.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_sub_command()

static vlib_cli_command_t* get_sub_command ( vlib_cli_main_t cm,
vlib_cli_command_t parent,
u32  si 
)
static

Definition at line 198 of file cli.c.

+ Here is the caller graph for this function:

◆ parent_path_len()

static uword parent_path_len ( char *  path)
inlinestatic

Definition at line 1164 of file cli.c.

+ Here is the caller graph for this function:

◆ restart_cmd_fn()

static clib_error_t* restart_cmd_fn ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 1056 of file cli.c.

◆ show_cli_command_fn()

static clib_error_t* show_cli_command_fn ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 1707 of file cli.c.

+ Here is the call graph for this function:

◆ show_cpu()

static clib_error_t* show_cpu ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 866 of file cli.c.

◆ show_memory_usage()

static clib_error_t* show_memory_usage ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 732 of file cli.c.

+ Here is the call graph for this function:

◆ sort_cmds_by_path()

static int sort_cmds_by_path ( void *  a1,
void *  a2 
)
static

Definition at line 1595 of file cli.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ suspend_command_fn()

static clib_error_t* suspend_command_fn ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 1576 of file cli.c.

+ Here is the call graph for this function:

◆ test_heap_validate()

static clib_error_t* test_heap_validate ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 991 of file cli.c.

+ Here is the call graph for this function:

◆ unformat_vlib_cli_sub_command()

static uword unformat_vlib_cli_sub_command ( unformat_input_t i,
va_list *  args 
)
static

Definition at line 205 of file cli.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unformat_vlib_cli_sub_input()

uword unformat_vlib_cli_sub_input ( unformat_input_t i,
va_list *  args 
)

Definition at line 162 of file cli.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vl_api_get_elog_trace_api_messages()

int vl_api_get_elog_trace_api_messages ( void  )

Definition at line 1163 of file api_shared.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vl_api_set_elog_trace_api_messages()

int vl_api_set_elog_trace_api_messages ( int  enable)

Definition at line 1152 of file api_shared.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vl_msg_pop_heap()

void vl_msg_pop_heap ( void *  oldheap)

Definition at line 720 of file cli.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vl_msg_push_heap()

void* vl_msg_push_heap ( void  )

Definition at line 713 of file cli.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_cli_cmp_command()

static int vlib_cli_cmp_command ( void *  a1,
void *  a2 
)
static

Definition at line 376 of file cli.c.

+ Here is the caller graph for this function:

◆ vlib_cli_cmp_rule()

static int vlib_cli_cmp_rule ( void *  a1,
void *  a2 
)
static

Definition at line 367 of file cli.c.

+ Here is the caller graph for this function:

◆ vlib_cli_cmp_strings()

static int vlib_cli_cmp_strings ( void *  a1,
void *  a2 
)
static

Definition at line 227 of file cli.c.

+ Here is the caller graph for this function:

◆ vlib_cli_command_is_empty()

static uword vlib_cli_command_is_empty ( vlib_cli_command_t c)
inlinestatic

Definition at line 1317 of file cli.c.

+ Here is the caller graph for this function:

◆ vlib_cli_dispatch_sub_commands()

static clib_error_t* vlib_cli_dispatch_sub_commands ( vlib_main_t vm,
vlib_cli_main_t cm,
unformat_input_t input,
uword  parent_command_index 
)
static

Definition at line 385 of file cli.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_cli_get_possible_completions()

u8** vlib_cli_get_possible_completions ( u8 str)

Definition at line 236 of file cli.c.

+ Here is the call graph for this function:

◆ vlib_cli_init()

static clib_error_t* vlib_cli_init ( vlib_main_t vm)
static

Definition at line 1792 of file cli.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_cli_input()

int vlib_cli_input ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_output_function_t function,
uword  function_arg 
)

Definition at line 649 of file cli.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_cli_make_parent()

static void vlib_cli_make_parent ( vlib_cli_main_t cm,
uword  ci 
)
static

Definition at line 1269 of file cli.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_cli_normalize_path()

static uword vlib_cli_normalize_path ( char *  input,
char **  result 
)
static

Definition at line 1122 of file cli.c.

+ Here is the caller graph for this function:

◆ vlib_cli_output()

void vlib_cli_output ( vlib_main_t vm,
char *  fmt,
  ... 
)

Definition at line 689 of file cli.c.

◆ vlib_cli_register()

clib_error_t* vlib_cli_register ( vlib_main_t vm,
vlib_cli_command_t c 
)

Definition at line 1323 of file cli.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_cli_sub_command_match()

static uword* vlib_cli_sub_command_match ( vlib_cli_command_t c,
unformat_input_t input 
)
static

Definition at line 89 of file cli.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_stats_push_heap()

void* vlib_stats_push_heap ( void *  notused)

Definition at line 726 of file cli.c.

+ Here is the caller graph for this function:

◆ vlib_unix_error_report()

void vlib_unix_error_report ( vlib_main_t vm,
clib_error_t error 
)

Definition at line 643 of file cli.c.

+ Here is the caller graph for this function:

Variable Documentation

◆ cmd_test_heap_validate

vlib_cli_command_t cmd_test_heap_validate
static
Initial value:
= {
.path = "test heap-validate",
.short_help = "<on/off/now> validate heap on future allocs/frees or right now",
.function = test_heap_validate,
}
static clib_error_t * test_heap_validate(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: cli.c:991

(constructor) VLIB_CLI_COMMAND (cmd_test_heap_validate)

Definition at line 1048 of file cli.c.

◆ current_traced_heap

void* current_traced_heap
static

Definition at line 53 of file cli.c.

◆ elog_trace_command

vlib_cli_command_t elog_trace_command
static
Initial value:
=
{
.path = "elog trace",
.short_help = "elog trace [api][cli][barrier][dispatch]\n"
"[circuit-node <name> e.g. ethernet-input][disable]",
.function = elog_trace_command_fn,
}
static clib_error_t * elog_trace_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: cli.c:1467

(constructor) VLIB_CLI_COMMAND (elog_trace_command)

Definition at line 1566 of file cli.c.

◆ enable_disable_memory_trace_command

vlib_cli_command_t enable_disable_memory_trace_command
static
Initial value:
= {
.path = "memory-trace",
.short_help = "memory-trace on|off [api-segment][stats-segment][main-heap]\n",
}
static clib_error_t * enable_disable_memory_trace(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: cli.c:899

(constructor) VLIB_CLI_COMMAND (enable_disable_memory_trace_command)

Definition at line 982 of file cli.c.

◆ restart_cmd

vlib_cli_command_t restart_cmd
static
Initial value:
= {
.path = "restart",
.short_help = "restart process",
.function = restart_cmd_fn,
}
static clib_error_t * restart_cmd_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: cli.c:1056

(constructor) VLIB_CLI_COMMAND (restart_cmd)

Definition at line 1081 of file cli.c.

◆ show_cli_command

vlib_cli_command_t show_cli_command
static
Initial value:
=
{
.path = "show cli",
.short_help = "show cli [mp-safe][not-mp-safe][hit][clear-hit]",
.function = show_cli_command_fn,
.is_mp_safe = 1,
}
static clib_error_t * show_cli_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: cli.c:1707

(constructor) VLIB_CLI_COMMAND (show_cli_command)

Definition at line 1782 of file cli.c.

◆ show_cpu_command

vlib_cli_command_t show_cpu_command
static
Initial value:
= {
.path = "show cpu",
.short_help = "Show cpu information",
.function = show_cpu,
}
static clib_error_t * show_cpu(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: cli.c:866

(constructor) VLIB_CLI_COMMAND (show_cpu_command)

Definition at line 891 of file cli.c.

◆ show_memory_usage_command

vlib_cli_command_t show_memory_usage_command
static
Initial value:
= {
.path = "show memory",
.short_help = "show memory [api-segment][stats-segment][verbose]",
.function = show_memory_usage,
}
static clib_error_t * show_memory_usage(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: cli.c:732

(constructor) VLIB_CLI_COMMAND (show_memory_usage_command)

Definition at line 858 of file cli.c.

◆ suspend_command

vlib_cli_command_t suspend_command
static
Initial value:
=
{
.path = "suspend",
.short_help = "suspend debug CLI for 30ms",
.function = suspend_command_fn,
.is_mp_safe = 1,
}
static clib_error_t * suspend_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: cli.c:1576

(constructor) VLIB_CLI_COMMAND (suspend_command)

Definition at line 1584 of file cli.c.

◆ vlib_cli_clear_command

vlib_cli_command_t vlib_cli_clear_command
static
Initial value:
= {
.path = "clear",
.short_help = "Clear commands",
}

(constructor) VLIB_CLI_COMMAND (vlib_cli_clear_command)

Definition at line 65 of file cli.c.

◆ vlib_cli_set_command

vlib_cli_command_t vlib_cli_set_command
static
Initial value:
= {
.path = "set",
.short_help = "Set commands",
}

(constructor) VLIB_CLI_COMMAND (vlib_cli_set_command)

Definition at line 73 of file cli.c.

◆ vlib_cli_show_command

vlib_cli_command_t vlib_cli_show_command
static
Initial value:
= {
.path = "show",
.short_help = "Show commands",
}

(constructor) VLIB_CLI_COMMAND (vlib_cli_show_command)

Definition at line 57 of file cli.c.

◆ vlib_cli_test_command

vlib_cli_command_t vlib_cli_test_command
static
Initial value:
= {
.path = "test",
.short_help = "Test commands",
}

(constructor) VLIB_CLI_COMMAND (vlib_cli_test_command)

Definition at line 81 of file cli.c.