diff options
author | Manoj Naragund <mnaragund@vmware.com> | 2023-03-31 12:47:17 +0200 |
---|---|---|
committer | Manoj Naragund <mnaragund@vmware.com> | 2023-03-31 12:47:17 +0200 |
commit | 689e1d447ae5c774efd7ba32faccd6595cdd35ac (patch) | |
tree | 10284e9b0491d0277134bd67eb0f080fadb890ba /mgmtd | |
parent | Merge pull request #13148 from samanvithab/bgp_mem_leak_fix (diff) | |
download | frr-689e1d447ae5c774efd7ba32faccd6595cdd35ac.tar.xz frr-689e1d447ae5c774efd7ba32faccd6595cdd35ac.zip |
mgmtd: Fix for issue 13154.
The changes involve adding show debuggin command for MGMTd which resolves
command incomplete issue.
issue #13154
Signed-off-by: Manoj Naragund <mnaragund@vmware.com>
Diffstat (limited to 'mgmtd')
-rw-r--r-- | mgmtd/mgmt_vty.c | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/mgmtd/mgmt_vty.c b/mgmtd/mgmt_vty.c index 79fa54a79..898eb4391 100644 --- a/mgmtd/mgmt_vty.c +++ b/mgmtd/mgmt_vty.c @@ -386,12 +386,14 @@ static struct cmd_node debug_node = { .config_write = config_write_mgmt_debug, }; -static int config_write_mgmt_debug(struct vty *vty) +static int config_write_mgmt_debug_helper(struct vty *vty, bool config) { int n = mgmt_debug_be + mgmt_debug_fe + mgmt_debug_ds + mgmt_debug_txn; if (!n) return 0; - if (n == 4) { + + if (config && mgmt_debug_be && mgmt_debug_fe && mgmt_debug_ds && + mgmt_debug_txn) { vty_out(vty, "debug mgmt all\n"); return 0; } @@ -411,12 +413,26 @@ static int config_write_mgmt_debug(struct vty *vty) return 0; } -DEFPY(debug_mgmt, - debug_mgmt_cmd, +static int config_write_mgmt_debug(struct vty *vty) +{ + return config_write_mgmt_debug_helper(vty, true); +} + +DEFUN_NOSH(show_debugging_mgmt, show_debugging_mgmt_cmd, + "show debugging [mgmt]", SHOW_STR DEBUG_STR "MGMT Information\n") +{ + vty_out(vty, "MGMT debugging status:\n"); + + config_write_mgmt_debug_helper(vty, false); + + cmd_show_lib_debugs(vty); + + return CMD_SUCCESS; +} + +DEFPY(debug_mgmt, debug_mgmt_cmd, "[no$no] debug mgmt <all$all|{backend$be|datastore$ds|frontend$fe|transaction$txn}>", - NO_STR - DEBUG_STR - MGMTD_STR + NO_STR DEBUG_STR MGMTD_STR "All debug\n" "Back-end debug\n" "Datastore debug\n" @@ -479,6 +495,8 @@ void mgmt_vty_init(void) install_element(ENABLE_NODE, &mgmt_performance_measurement_cmd); install_element(ENABLE_NODE, &mgmt_reset_performance_stats_cmd); + install_element(ENABLE_NODE, &show_debugging_mgmt_cmd); + /* * TODO: Register and handlers for auto-completion here. */ |