pim6d: Add 'debug pimv6 trace' and 'debug pimv6 trace detail'

Implementing debugs pimv6 trace and trace detail for tracing pim code
and how it is running.

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
This commit is contained in:
Sai Gomathi N 2022-03-27 23:28:06 -07:00
parent d05746d48d
commit 904dbf5310
3 changed files with 49 additions and 34 deletions

View File

@ -2114,6 +2114,37 @@ DEFPY (debug_pimv6_packetdump_recv,
return CMD_SUCCESS;
}
DEFPY (debug_pimv6_trace,
debug_pimv6_trace_cmd,
"[no] debug pimv6 trace",
NO_STR
DEBUG_STR
DEBUG_PIMV6_STR
DEBUG_PIMV6_TRACE_STR)
{
if (!no)
PIM_DO_DEBUG_PIM_TRACE;
else
PIM_DONT_DEBUG_PIM_TRACE;
return CMD_SUCCESS;
}
DEFPY (debug_pimv6_trace_detail,
debug_pimv6_trace_detail_cmd,
"[no] debug pimv6 trace detail",
NO_STR
DEBUG_STR
DEBUG_PIMV6_STR
DEBUG_PIMV6_TRACE_STR
"Detailed Information\n")
{
if (!no)
PIM_DO_DEBUG_PIM_TRACE_DETAIL;
else
PIM_DONT_DEBUG_PIM_TRACE_DETAIL;
return CMD_SUCCESS;
}
void pim_cmd_init(void)
{
if_cmd_init(pim_interface_config_write);
@ -2232,6 +2263,8 @@ void pim_cmd_init(void)
install_element(ENABLE_NODE, &debug_pimv6_packets_cmd);
install_element(ENABLE_NODE, &debug_pimv6_packetdump_send_cmd);
install_element(ENABLE_NODE, &debug_pimv6_packetdump_recv_cmd);
install_element(ENABLE_NODE, &debug_pimv6_trace_cmd);
install_element(ENABLE_NODE, &debug_pimv6_trace_detail_cmd);
install_element(CONFIG_NODE, &debug_pimv6_cmd);
install_element(CONFIG_NODE, &debug_pimv6_nht_cmd);
@ -2240,4 +2273,6 @@ void pim_cmd_init(void)
install_element(CONFIG_NODE, &debug_pimv6_packets_cmd);
install_element(CONFIG_NODE, &debug_pimv6_packetdump_send_cmd);
install_element(CONFIG_NODE, &debug_pimv6_packetdump_recv_cmd);
install_element(CONFIG_NODE, &debug_pimv6_trace_cmd);
install_element(CONFIG_NODE, &debug_pimv6_trace_detail_cmd);
}

View File

@ -55,6 +55,7 @@
#define DEBUG_PIMV6_PACKETDUMP_STR "PIMv6 packet dump\n"
#define DEBUG_PIMV6_PACKETDUMP_SEND_STR "Dump sent packets\n"
#define DEBUG_PIMV6_PACKETDUMP_RECV_STR "Dump received packets\n"
#define DEBUG_PIMV6_TRACE_STR "PIMv6 internal daemon activity\n"
void pim_cmd_init(void);

View File

@ -5655,51 +5655,34 @@ DEFPY (debug_pim_packetdump_recv,
return CMD_SUCCESS;
}
DEFUN (debug_pim_trace,
DEFPY (debug_pim_trace,
debug_pim_trace_cmd,
"debug pim trace",
"[no] debug pim trace",
NO_STR
DEBUG_STR
DEBUG_PIM_STR
DEBUG_PIM_TRACE_STR)
{
PIM_DO_DEBUG_PIM_TRACE;
if (!no)
PIM_DO_DEBUG_PIM_TRACE;
else
PIM_DONT_DEBUG_PIM_TRACE;
return CMD_SUCCESS;
}
DEFUN (debug_pim_trace_detail,
DEFPY (debug_pim_trace_detail,
debug_pim_trace_detail_cmd,
"debug pim trace detail",
DEBUG_STR
DEBUG_PIM_STR
DEBUG_PIM_TRACE_STR
"Detailed Information\n")
{
PIM_DO_DEBUG_PIM_TRACE_DETAIL;
return CMD_SUCCESS;
}
DEFUN (no_debug_pim_trace,
no_debug_pim_trace_cmd,
"no debug pim trace",
NO_STR
DEBUG_STR
DEBUG_PIM_STR
DEBUG_PIM_TRACE_STR)
{
PIM_DONT_DEBUG_PIM_TRACE;
return CMD_SUCCESS;
}
DEFUN (no_debug_pim_trace_detail,
no_debug_pim_trace_detail_cmd,
"no debug pim trace detail",
"[no] debug pim trace detail",
NO_STR
DEBUG_STR
DEBUG_PIM_STR
DEBUG_PIM_TRACE_STR
"Detailed Information\n")
{
PIM_DONT_DEBUG_PIM_TRACE_DETAIL;
if (!no)
PIM_DO_DEBUG_PIM_TRACE_DETAIL;
else
PIM_DONT_DEBUG_PIM_TRACE_DETAIL;
return CMD_SUCCESS;
}
@ -7776,9 +7759,7 @@ void pim_cmd_init(void)
install_element(ENABLE_NODE, &debug_pim_packetdump_send_cmd);
install_element(ENABLE_NODE, &debug_pim_packetdump_recv_cmd);
install_element(ENABLE_NODE, &debug_pim_trace_cmd);
install_element(ENABLE_NODE, &no_debug_pim_trace_cmd);
install_element(ENABLE_NODE, &debug_pim_trace_detail_cmd);
install_element(ENABLE_NODE, &no_debug_pim_trace_detail_cmd);
install_element(ENABLE_NODE, &debug_ssmpingd_cmd);
install_element(ENABLE_NODE, &no_debug_ssmpingd_cmd);
install_element(ENABLE_NODE, &debug_pim_zebra_cmd);
@ -7824,9 +7805,7 @@ void pim_cmd_init(void)
install_element(CONFIG_NODE, &debug_pim_packetdump_send_cmd);
install_element(CONFIG_NODE, &debug_pim_packetdump_recv_cmd);
install_element(CONFIG_NODE, &debug_pim_trace_cmd);
install_element(CONFIG_NODE, &no_debug_pim_trace_cmd);
install_element(CONFIG_NODE, &debug_pim_trace_detail_cmd);
install_element(CONFIG_NODE, &no_debug_pim_trace_detail_cmd);
install_element(CONFIG_NODE, &debug_ssmpingd_cmd);
install_element(CONFIG_NODE, &no_debug_ssmpingd_cmd);
install_element(CONFIG_NODE, &debug_pim_zebra_cmd);