]> git.puffer.fish Git - mirror/frr.git/commitdiff
*: Create and use infrastructure to show debugs in lib 12074/head
authorDonald Sharp <sharpd@nvidia.com>
Fri, 7 Oct 2022 11:51:17 +0000 (07:51 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Fri, 7 Oct 2022 16:39:05 +0000 (12:39 -0400)
There are lib debugs being set but never show up in
`show debug` commands because there was no way to show
that they were being used.  Add a bit of infrastructure
to allow this and then use it for `debug route-map`

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
24 files changed:
babeld/babel_zebra.c
bfdd/bfdd_vty.c
bgpd/bgp_debug.c
eigrpd/eigrp_dump.c
isisd/isisd.c
ldpd/ldp_vty_cmds.c
lib/command.c
lib/command.h
lib/routemap.c
lib/routemap.h
nhrpd/nhrp_vty.c
ospf6d/ospf6d.c
ospfd/ospf_dump.c
pathd/path_cli.c
pbrd/pbr_vty.c
pimd/pim6_cmd.c
pimd/pim_cmd.c
ripd/rip_debug.c
ripngd/ripng_debug.c
sharpd/sharp_vty.c
staticd/static_vty.c
vrrpd/vrrp_vty.c
watchfrr/watchfrr_vty.c
zebra/debug.c

index d0da93e50747d0fd972c5dea2ccc4991f68b0d89..daaa870a646a700959f0fa11c4e84b9adcdbaa84 100644 (file)
@@ -225,6 +225,8 @@ DEFUN_NOSH (show_debugging_babel,
 
        debug_babel_config_write(vty);
 
+       cmd_show_lib_debugs(vty);
+
        return CMD_SUCCESS;
 }
 
index 21429f06cfbf269c4630bd38d4c527a80089d794..4a2c5bf662b9b44f43dae3b29d3db9a58af431d3 100644 (file)
@@ -973,6 +973,8 @@ DEFUN_NOSH(show_debugging_bfd,
        if (bglobal.debug_network)
                vty_out(vty, "  Network layer debugging is on.\n");
 
+       cmd_show_lib_debugs(vty);
+
        return CMD_SUCCESS;
 }
 
index df7262be6412e590747bf6daae4ad8bd208f167e..264dd85fbc66901c865f64d1bb9a6dd2f8a3429d 100644 (file)
@@ -2278,6 +2278,8 @@ DEFUN_NOSH (show_debugging_bgp,
                vty_out(vty,
                        "  BGP conditional advertisement debugging is on\n");
 
+       cmd_show_lib_debugs(vty);
+
        return CMD_SUCCESS;
 }
 
index e1ad51a9dbb1f7d4350accd2788e75a4310e8601..b0d34f55e619ccf2c917edef02a16df6ac0aa706 100644 (file)
@@ -322,6 +322,7 @@ DEFUN_NOSH (show_debugging_eigrp,
                }
        }
 
+       cmd_show_lib_debugs(vty);
        return CMD_SUCCESS;
 }
 
index 54e6be5970e7809aedd1ab6499193697af83754f..0ff31df0f8649eeeba8704e369f57653fc52828b 100644 (file)
@@ -1700,6 +1700,8 @@ DEFUN_NOSH (show_debugging,
        if (IS_DEBUG_LFA)
                print_debug(vty, DEBUG_LFA, 1);
 
+       cmd_show_lib_debugs(vty);
+
        return CMD_SUCCESS;
 }
 
index 11d6930f06a30d65d49c52031062270796300303..3795cdaf387a1bd1c0ec8dfa327bef3b2c7dce0a 100644 (file)
@@ -774,7 +774,11 @@ DEFPY_NOSH (ldp_show_debugging_mpls_ldp,
            "MPLS information\n"
            "Label Distribution Protocol\n")
 {
-       return (ldp_vty_show_debugging(vty));
+       ldp_vty_show_debugging(vty);
+
+       cmd_show_lib_debugs(vty);
+
+       return CMD_SUCCESS;
 }
 
 static void
index a23afb1e43863e15ff36c50a1d866ff1e69ca0f5..7e171cb309157f2960668040f077071dd8776298 100644 (file)
@@ -48,6 +48,7 @@
 #include "lib_errors.h"
 #include "northbound_cli.h"
 #include "network.h"
+#include "routemap.h"
 
 #include "frrscript.h"
 
@@ -2446,6 +2447,11 @@ const char *host_config_get(void)
        return host.config;
 }
 
+void cmd_show_lib_debugs(struct vty *vty)
+{
+       route_map_show_debug(vty);
+}
+
 void install_default(enum node_type node)
 {
        _install_element(node, &config_exit_cmd);
index 70e52708a741ee0ac5def20e7d8d94af64fe1f12..ca49efd262a740a7e6af46adea971f28491b9d62 100644 (file)
@@ -649,6 +649,12 @@ extern char *cmd_variable_comp2str(vector comps, unsigned short cols);
 
 extern void command_setup_early_logging(const char *dest, const char *level);
 
+/*
+ * Allow a mechanism for `debug XXX` commands that live
+ * under the lib directory to output their debug status
+ */
+extern void cmd_show_lib_debugs(struct vty *vty);
+
 #ifdef __cplusplus
 }
 #endif
index 3cc010c148d454cdf4147367d4acb69a33b75b0d..3a927999915923a0a073489f661fdd2f5d7bc449 100644 (file)
@@ -3174,6 +3174,12 @@ static struct cmd_node rmap_debug_node = {
        .config_write = rmap_config_write_debug,
 };
 
+void route_map_show_debug(struct vty *vty)
+{
+       if (rmap_debug)
+               vty_out(vty, "debug route-map\n");
+}
+
 /* Configuration write function. */
 static int rmap_config_write_debug(struct vty *vty)
 {
index a3659258545f2886c1929316b73ea89d164b333a..c2e9de6cfbb2bf106b07bfdcb5f8c7d461e8d027 100644 (file)
@@ -1015,6 +1015,8 @@ extern void route_map_optimization_disabled_show(struct vty *vty,
                                                 bool show_defaults);
 extern void route_map_cli_init(void);
 
+extern void route_map_show_debug(struct vty *vty);
+
 #ifdef __cplusplus
 }
 #endif
index 3a8baa2342ddd1a75e75c81e3db13737f4315dcf..53ba9eb12f3b0d449edd47291f6db72873c38d52 100644 (file)
@@ -126,6 +126,8 @@ DEFUN_NOSH(show_debugging_nhrp, show_debugging_nhrp_cmd,
                        debug_flags_desc[i].str);
        }
 
+       cmd_show_lib_debugs(vty);
+
        return CMD_SUCCESS;
 }
 
index a16f4f73eb6ae4a25e0b6236aebb93baa57b3234..fe742b912fb0ebb6386416e72c85270010e0a713 100644 (file)
@@ -115,6 +115,8 @@ DEFUN_NOSH (show_debugging_ospf6,
 
        config_write_ospf6_debug(vty);
 
+       cmd_show_lib_debugs(vty);
+
        return CMD_SUCCESS;
 }
 
index 258a93fb16fc92943488af27f0f7c7692cd4b119..9f2eab6d6654ac91f9ff6e2b4e4e91488fd8a08f 100644 (file)
@@ -1860,7 +1860,11 @@ DEFUN_NOSH (show_debugging_ospf,
            DEBUG_STR
            OSPF_STR)
 {
-       return show_debugging_ospf_common(vty);
+       show_debugging_ospf_common(vty);
+
+       cmd_show_lib_debugs(vty);
+
+       return CMD_SUCCESS;
 }
 
 DEFUN_NOSH (show_debugging_ospf_instance,
@@ -1878,7 +1882,11 @@ DEFUN_NOSH (show_debugging_ospf_instance,
        if (instance != ospf_instance)
                return CMD_NOT_MY_INSTANCE;
 
-       return show_debugging_ospf_common(vty);
+       show_debugging_ospf_common(vty);
+
+       cmd_show_lib_debugs(vty);
+
+       return CMD_SUCCESS;
 }
 
 static int config_write_debug(struct vty *vty);
index 4775aa36fbda8a6af70f12d98c61b12596ed30f2..13e52ac86bf7604d20b81b266de777b35414a6bd 100644 (file)
@@ -1092,6 +1092,8 @@ DEFPY_NOSH(show_debugging_pathd, show_debugging_pathd_cmd,
           "State of each debugging option\n"
           "pathd module debugging\n")
 {
+
+       cmd_show_lib_debugs(vty);
        /* nothing to do here */
        return CMD_SUCCESS;
 }
index a2b3431b94fcc346e8f8130a5bb58199cc2d9801..6f53adb334da8e37a326425e5dc585acacd63e55 100644 (file)
@@ -1243,6 +1243,8 @@ DEFUN_NOSH(show_debugging_pbr,
 
        pbr_debug_config_write_helper(vty, false);
 
+       cmd_show_lib_debugs(vty);
+
        return CMD_SUCCESS;
 }
 
index 49248798bff8e65c6ceea2cbfea30a59447fd7ab..f6b370cee32b0a6d369876ebef9e374b507baa26 100644 (file)
@@ -1558,6 +1558,8 @@ DEFUN_NOSH (show_debugging_pimv6,
 
        pim_debug_config_write(vty);
 
+       cmd_show_lib_debugs(vty);
+
        return CMD_SUCCESS;
 }
 
index c2f7396c180e75fa392616cc26ca17918d414bf3..f26667245cc26138017f3bccb2d77ef88ccfee7d 100644 (file)
@@ -4906,6 +4906,7 @@ DEFUN_NOSH (show_debugging_pim,
 
        pim_debug_config_write(vty);
 
+       cmd_show_lib_debugs(vty);
        return CMD_SUCCESS;
 }
 
index 871ee8e87ef4e0e3b3b3fc84e8f1139e501147de..ded62812a756764ab8253d877dd357d987ab9d6a 100644 (file)
@@ -55,6 +55,8 @@ DEFUN_NOSH (show_debugging_rip,
        if (IS_RIP_DEBUG_ZEBRA)
                vty_out(vty, "  RIP zebra debugging is on\n");
 
+       cmd_show_lib_debugs(vty);
+
        return CMD_SUCCESS;
 }
 
index 539c01b3ecda67121de09e6307440e780e4ab2dc..d36327cb7680f567dc01248606677019445ece58 100644 (file)
@@ -56,6 +56,8 @@ DEFUN_NOSH (show_debugging_ripng,
        if (IS_RIPNG_DEBUG_ZEBRA)
                vty_out(vty, "  RIPng zebra debugging is on\n");
 
+       cmd_show_lib_debugs(vty);
+
        return CMD_SUCCESS;
 }
 
index 3853df7cb08a1b4d754cd29bc183c5140e794645..9b900fccd23298642afc685b8ed4030fd4f4be8a 100644 (file)
@@ -615,6 +615,8 @@ DEFUN_NOSH (show_debugging_sharpd,
 {
        vty_out(vty, "Sharp debugging status:\n");
 
+       cmd_show_lib_debugs(vty);
+
        return CMD_SUCCESS;
 }
 
index c0ace0e2588ca9d1f65c8595ea6585ba4685357a..c0638f4bc4b436ed8fc9868ee4b18db85ceba4f8 100644 (file)
@@ -1301,6 +1301,8 @@ DEFUN_NOSH (show_debugging_static,
 
        static_debug_status_write(vty);
 
+       cmd_show_lib_debugs(vty);
+
        return CMD_SUCCESS;
 }
 
index 634a55dbc37fd3390b6375df0d67a579311a3496..d2f25f2d405da7728b9fd0d37d98e47186b9a4f5 100644 (file)
@@ -710,6 +710,8 @@ DEFUN_NOSH (show_debugging_vrrp,
 
        vrrp_debug_status_write(vty);
 
+       cmd_show_lib_debugs(vty);
+
        return CMD_SUCCESS;
 }
 
index 1492ee37b600073b443cf3d2aea8eba5e39657a2..e5cc43754243786d2e435ad7833497c651241335 100644 (file)
@@ -125,6 +125,8 @@ DEFUN_NOSH (show_debugging_watchfrr,
             DEBUG_STR
             WATCHFRR_STR)
 {
+       cmd_show_lib_debugs(vty);
+
        return CMD_SUCCESS;
 }
 
index 69aaed33acb5a88ed5640c804334e4e6ab2b204f..25102145d757e81d34b3bbfeaf6677ced07d01ff 100644 (file)
@@ -137,6 +137,9 @@ DEFUN_NOSH (show_debugging_zebra,
                vty_out(vty, "  Zebra PBR debugging is on\n");
 
        hook_call(zebra_debug_show_debugging, vty);
+
+       cmd_show_lib_debugs(vty);
+
        return CMD_SUCCESS;
 }