]> git.puffer.fish Git - mirror/frr.git/commitdiff
Zebra: Rectifying the log messages. 4875/head
authorvdhingra <vdhingra@vmware.com>
Fri, 23 Aug 2019 12:28:43 +0000 (05:28 -0700)
committervdhingra <vdhingra@vmware.com>
Thu, 19 Sep 2019 09:59:04 +0000 (02:59 -0700)
This change addresses the following :
1. Ensures zlog_debug should be under DEBUG macro check
2. Ensures zlog_err and zlog_warn wherever applicable.
3. Removed few posivite logs from fpm handling, whose frequency is high.

Signed-off-by: vishaldhingra <vdhingra@vmware.com>
zebra/connected.c
zebra/if_netlink.c
zebra/interface.c
zebra/redistribute.c
zebra/zebra_fpm.c
zebra/zebra_rnh.c
zebra/zebra_vrf.c

index 6b92945c6314123c1e472292104614f4425e83bc..87cf8c8f205eb4396ead587af51f76d98c0c065e 100644 (file)
@@ -385,7 +385,7 @@ void connected_down(struct interface *ifp, struct connected *ifc)
                        return;
                break;
        default:
-               zlog_info("Unknown AFI: %s", afi2str(afi));
+               zlog_warn("Unknown AFI: %s", afi2str(afi));
                break;
        }
 
index c71b95f753ad894648408b6962691642db21d69b..08fa77923dc5df46c161287ae0208da3837e172c 100644 (file)
@@ -1032,7 +1032,8 @@ int netlink_interface_addr(struct nlmsghdr *h, ns_id_t ns_id, int startup)
 
        /* addr is primary key, SOL if we don't have one */
        if (addr == NULL) {
-               zlog_debug("%s: NULL address", __func__);
+               zlog_debug("%s: Local Interface Address is NULL for %s",
+                          __func__, ifp->name);
                return -1;
        }
 
index 6486c01430c39bc02c1c8e8538053903c4064558..bb808e185274dbd9dda4a34335f29e578159526a 100644 (file)
@@ -2034,13 +2034,13 @@ DEFUN (link_params_enable,
        /* This command could be issue at startup, when activate MPLS TE */
        /* on a new interface or after a ON / OFF / ON toggle */
        /* In all case, TE parameters are reset to their default factory */
-       if (IS_ZEBRA_DEBUG_EVENT)
+       if (IS_ZEBRA_DEBUG_EVENT || IS_ZEBRA_DEBUG_MPLS)
                zlog_debug(
                        "Link-params: enable TE link parameters on interface %s",
                        ifp->name);
 
        if (!if_link_params_get(ifp)) {
-               if (IS_ZEBRA_DEBUG_EVENT)
+               if (IS_ZEBRA_DEBUG_EVENT || IS_ZEBRA_DEBUG_MPLS)
                        zlog_debug(
                                "Link-params: failed to init TE link parameters  %s",
                                ifp->name);
@@ -2063,8 +2063,9 @@ DEFUN (no_link_params_enable,
 {
        VTY_DECLVAR_CONTEXT(interface, ifp);
 
-       zlog_debug("MPLS-TE: disable TE link parameters on interface %s",
-                  ifp->name);
+       if (IS_ZEBRA_DEBUG_EVENT || IS_ZEBRA_DEBUG_MPLS)
+               zlog_debug("MPLS-TE: disable TE link parameters on interface %s",
+                          ifp->name);
 
        if_link_params_free(ifp);
 
index 4f72e2414af2768db30d5fbfce39f8905195851a..227226b5f9454489abf1227b335a3e89e152004f 100644 (file)
@@ -119,7 +119,7 @@ static void zebra_redistribute(struct zserv *client, int type,
 
                        srcdest_rnode_prefixes(rn, &dst_p, &src_p);
 
-                       if (IS_ZEBRA_DEBUG_EVENT)
+                       if (IS_ZEBRA_DEBUG_RIB)
                                zlog_debug(
                                        "%s: client %s %s(%u) checking: selected=%d, type=%d, distance=%d, metric=%d zebra_check_addr=%d",
                                        __func__,
@@ -201,7 +201,7 @@ void redistribute_update(const struct prefix *p, const struct prefix *src_p,
                        send_redistribute = 1;
 
                if (send_redistribute) {
-                       if (IS_ZEBRA_DEBUG_EVENT) {
+                       if (IS_ZEBRA_DEBUG_RIB) {
                                zlog_debug(
                                           "%s: client %s %s(%u), type=%d, distance=%d, metric=%d",
                                           __func__,
index 4144c0afe06e6211baf57911fcce4985b9df9007..5d88d4eeb47cfe9accf2e46e8c7aa46dde728114 100644 (file)
@@ -711,7 +711,6 @@ static void zfpm_connection_down(const char *detail)
         * Start thread to clean up state after the connection goes down.
         */
        assert(!zfpm_g->t_conn_down);
-       zfpm_debug("Starting conn_down thread");
        zfpm_rnodes_iter_init(&zfpm_g->t_conn_down_state.iter);
        zfpm_g->t_conn_down = NULL;
        thread_add_timer_msec(zfpm_g->master, zfpm_conn_down_thread_cb, NULL, 0,
@@ -806,8 +805,6 @@ static int zfpm_read_cb(struct thread *thread)
                        goto done;
        }
 
-       zfpm_debug("Read out a full fpm message");
-
        /*
         * Just throw it away for now.
         */
@@ -1249,7 +1246,7 @@ static int zfpm_connect_cb(struct thread *t)
 
        sock = socket(AF_INET, SOCK_STREAM, 0);
        if (sock < 0) {
-               zfpm_debug("Failed to create socket for connect(): %s",
+               zlog_err("Failed to create socket for connect(): %s",
                           strerror(errno));
                zfpm_g->stats.connect_no_sock++;
                return 0;
index bcaf1b520441888b6c922d07dd7e67eb9e8271b8..5df5d94f4b805b0da740b7b82614e7a0b5bb5479 100644 (file)
@@ -337,7 +337,7 @@ static void addr2hostprefix(int af, const union g_addr *addr,
                break;
        default:
                memset(prefix, 0, sizeof(*prefix));
-               zlog_debug("%s: unknown address family %d", __func__, af);
+               zlog_warn("%s: unknown address family %d", __func__, af);
                break;
        }
 }
@@ -916,7 +916,8 @@ void zebra_print_rnh_table(vrf_id_t vrfid, afi_t afi, struct vty *vty,
 
        table = get_rnh_table(vrfid, afi, type);
        if (!table) {
-               zlog_debug("print_rnhs: rnh table not found");
+               if (IS_ZEBRA_DEBUG_NHT)
+                       zlog_debug("print_rnhs: rnh table not found");
                return;
        }
 
index 72d0b6866db800c0dc8f61e10e73cfce7ac3ad53..4f1868311c2826963be2ad09ee048a07e6fde46f 100644 (file)
@@ -92,7 +92,7 @@ static int zebra_vrf_new(struct vrf *vrf)
        struct zebra_vrf *zvrf;
 
        if (IS_ZEBRA_DEBUG_EVENT)
-               zlog_info("VRF %s created, id %u", vrf->name, vrf->vrf_id);
+               zlog_debug("VRF %s created, id %u", vrf->name, vrf->vrf_id);
 
        zvrf = zebra_vrf_alloc();
        vrf->info = zvrf;