]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib, vtysh: make debug memstats work in vtysh 4426/head
authorMark Stapp <mjs@voltanet.io>
Thu, 30 May 2019 20:14:25 +0000 (16:14 -0400)
committerMark Stapp <mjs@voltanet.io>
Thu, 30 May 2019 20:14:25 +0000 (16:14 -0400)
Allow vtysh to send the 'debug memstats-on-exit' command
to the running daemons.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
lib/command.c
vtysh/vtysh.c

index 29f41a712c0f9f40e19e31635a0759bfa3e122e8..5335969fbcbee9c36d9d3efc67dc0ba09530901b 100644 (file)
@@ -2803,9 +2803,10 @@ void cmd_init(int terminal)
        /* Each node's basic commands. */
        install_element(VIEW_NODE, &show_version_cmd);
        install_element(ENABLE_NODE, &show_startup_config_cmd);
-       install_element(ENABLE_NODE, &debug_memstats_cmd);
 
        if (terminal) {
+               install_element(ENABLE_NODE, &debug_memstats_cmd);
+
                install_element(VIEW_NODE, &config_list_cmd);
                install_element(VIEW_NODE, &config_exit_cmd);
                install_element(VIEW_NODE, &config_quit_cmd);
@@ -2839,9 +2840,10 @@ void cmd_init(int terminal)
        install_element(CONFIG_NODE, &domainname_cmd);
        install_element(CONFIG_NODE, &no_domainname_cmd);
        install_element(CONFIG_NODE, &frr_version_defaults_cmd);
-       install_element(CONFIG_NODE, &debug_memstats_cmd);
 
        if (terminal > 0) {
+               install_element(CONFIG_NODE, &debug_memstats_cmd);
+
                install_element(CONFIG_NODE, &password_cmd);
                install_element(CONFIG_NODE, &no_password_cmd);
                install_element(CONFIG_NODE, &enable_password_cmd);
index 51d5e4291507ef25afe96d3be0e8aecc9685439d..1ab70eeed223a694191e43b4fd9274c5d6c4337c 100644 (file)
@@ -2553,6 +2553,15 @@ DEFUNSH(VTYSH_ALL, vtysh_log_timestamp_precision,
        return CMD_SUCCESS;
 }
 
+DEFUNSH(VTYSH_ALL, vtysh_debug_memstats,
+       vtysh_debug_memstats_cmd, "[no] debug memstats-at-exit",
+       NO_STR
+       "Debug\n"
+       "Print memory statistics at exit\n")
+{
+       return CMD_SUCCESS;
+}
+
 DEFUNSH(VTYSH_ALL, no_vtysh_log_timestamp_precision,
        no_vtysh_log_timestamp_precision_cmd, "no log timestamp precision",
        NO_STR
@@ -3849,6 +3858,8 @@ void vtysh_init_vty(void)
        install_element(VIEW_NODE, &vtysh_show_debugging_hashtable_cmd);
        install_element(ENABLE_NODE, &vtysh_debug_all_cmd);
        install_element(CONFIG_NODE, &vtysh_debug_all_cmd);
+       install_element(ENABLE_NODE, &vtysh_debug_memstats_cmd);
+       install_element(CONFIG_NODE, &vtysh_debug_memstats_cmd);
 
        /* misc lib show commands */
        install_element(VIEW_NODE, &vtysh_show_memory_cmd);