]> git.proxmox.com Git - mirror_frr.git/commitdiff
pimd: Cleanup zebra debugs to be protected by debug commands
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 30 Sep 2015 14:22:46 +0000 (10:22 -0400)
committerDonald Sharp <sharpd@cumulusnetwroks.com>
Thu, 26 May 2016 00:38:33 +0000 (20:38 -0400)
pimd is very chatty without any pim debugs turned on.
This commit fixes a bunch of the debugs to be protected
by appropriate pim debug statement.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
pimd/pim_iface.c
pimd/pim_ifchannel.c
pimd/pim_neighbor.c
pimd/pim_rpf.c
pimd/pim_signals.c
pimd/pim_zebra.c
pimd/pim_zlookup.c

index 54fb09daa3715db642ce715354ad7b9bf2a70a26..32d10f1c15fe8659b6d651585972397d184669f6 100644 (file)
@@ -262,14 +262,14 @@ static void on_primary_address_change(struct interface *ifp,
 {
   struct pim_interface *pim_ifp;
 
-  {
+  if (PIM_DEBUG_ZEBRA) {
     char old_str[100];
     char new_str[100];
     pim_inet4_dump("<old?>", old_addr, old_str, sizeof(old_str));
     pim_inet4_dump("<new?>", new_addr, new_str, sizeof(new_str));
-    zlog_info("%s: %s: primary address changed from %s to %s on interface %s",
-             __PRETTY_FUNCTION__, caller,
-             old_str, new_str, ifp->name);
+    zlog_debug("%s: %s: primary address changed from %s to %s on interface %s",
+              __PRETTY_FUNCTION__, caller,
+              old_str, new_str, ifp->name);
   }
 
   pim_ifp = ifp->info;
@@ -335,8 +335,8 @@ static void detect_secondary_address_change(struct interface *ifp,
     return;
 
   changed = 1; /* true */
-  zlog_debug("FIXME T31 C15 %s: on interface %s: acting on any addr change",
-            __PRETTY_FUNCTION__, ifp->name);
+  zlog_info("FIXME T31 C15 %s: on interface %s: acting on any addr change",
+           __PRETTY_FUNCTION__, ifp->name);
 
   if (PIM_DEBUG_ZEBRA) {
     zlog_debug("%s: on interface %s: %s",
@@ -388,7 +388,7 @@ void pim_if_addr_add(struct connected *ifc)
   if (!if_is_operative(ifp))
     return;
 
-  /* if (PIM_DEBUG_ZEBRA) */ {
+  if (PIM_DEBUG_ZEBRA) {
     char buf[BUFSIZ];
     prefix2str(ifc->address, buf, BUFSIZ);
     zlog_debug("%s: %s ifindex=%d connected IP address %s %s",
@@ -507,7 +507,7 @@ void pim_if_addr_del(struct connected *ifc, int force_prim_as_any)
   ifp = ifc->ifp;
   zassert(ifp);
 
-  /* if (PIM_DEBUG_ZEBRA) */ {
+  if (PIM_DEBUG_ZEBRA) {
     char buf[BUFSIZ];
     prefix2str(ifc->address, buf, BUFSIZ);
     zlog_debug("%s: %s ifindex=%d disconnected IP address %s %s",
@@ -1061,14 +1061,14 @@ int pim_if_igmp_join_add(struct interface *ifp,
     return -4;
   }
 
-  {
+  if (PIM_DEBUG_IGMP_EVENTS) {
     char group_str[100];
     char source_str[100];
     pim_inet4_dump("<grp?>", group_addr, group_str, sizeof(group_str));
     pim_inet4_dump("<src?>", source_addr, source_str, sizeof(source_str));
     zlog_debug("%s: issued static igmp join for channel (S,G)=(%s,%s) on interface %s",
-              __PRETTY_FUNCTION__,
-              source_str, group_str, ifp->name);
+             __PRETTY_FUNCTION__,
+             source_str, group_str, ifp->name);
   }
 
   return 0;
index e253a0ea9c070e8b1c6f714700f8a435adef0c12..e801f4eeb561fce64d8a80ce3e2a1f467eec0ee1 100644 (file)
@@ -103,9 +103,11 @@ void pim_ifchannel_ifjoin_switch(const char *caller,
   enum pim_ifjoin_state old_state = ch->ifjoin_state;
 
   if (old_state == new_state) {
-    zlog_debug("%s calledby %s: non-transition on state %d (%s)",
-              __PRETTY_FUNCTION__, caller, new_state,
-              pim_ifchannel_ifjoin_name(new_state));
+    if (PIM_DEBUG_PIM_EVENTS) {
+      zlog_debug("%s calledby %s: non-transition on state %d (%s)",
+                __PRETTY_FUNCTION__, caller, new_state,
+                pim_ifchannel_ifjoin_name(new_state));
+    }
     return;
   }
 
@@ -286,7 +288,7 @@ static void ifmembership_set(struct pim_ifchannel *ch,
   if (ch->local_ifmembership == membership)
     return;
 
-  /* if (PIM_DEBUG_PIM_EVENTS) */ {
+  if (PIM_DEBUG_PIM_EVENTS) {
     char src_str[100];
     char grp_str[100];
     pim_inet4_dump("<src?>", ch->source_addr, src_str, sizeof(src_str));
index 72a35382fd5b872f1a7c9c03a2c799c9b8048038..8932dc324c9764c107bb3ab4b885baba1dda6ca6 100644 (file)
@@ -125,7 +125,7 @@ int pim_if_dr_election(struct interface *ifp)
   /* DR changed ? */
   if (old_dr_addr.s_addr != pim_ifp->pim_dr_addr.s_addr) {
 
-    /* if (PIM_DEBUG_PIM_EVENTS) */ {
+    if (PIM_DEBUG_PIM_EVENTS) {
       char dr_old_str[100];
       char dr_new_str[100];
       pim_inet4_dump("<old_dr?>", old_dr_addr, dr_old_str, sizeof(dr_old_str));
index dedc60a551748d22d1d0753d10e92151a843bd74..38339da1bdf7e31ed901390230c82fa0324d5da3 100644 (file)
@@ -61,7 +61,7 @@ int pim_nexthop_lookup(struct pim_nexthop *nexthop,
   if (num_ifindex > 1) {
     char addr_str[100];
     pim_inet4_dump("<addr?>", addr, addr_str, sizeof(addr_str));
-    zlog_debug("%s %s: FIXME ignoring multiple nexthop ifindex'es num_ifindex=%d for address %s (using only ifindex=%d)",
+    zlog_info("%s %s: FIXME ignoring multiple nexthop ifindex'es num_ifindex=%d for address %s (using only ifindex=%d)",
              __FILE__, __PRETTY_FUNCTION__,
              num_ifindex, addr_str, first_ifindex);
     /* debug warning only, do not return */
@@ -136,22 +136,22 @@ enum pim_rpf_result pim_rpf_update(struct pim_upstream *up,
   }
 
   rpf->rpf_addr = pim_rpf_find_rpf_addr(up);
-  if (PIM_INADDR_IS_ANY(rpf->rpf_addr)) {
+  if (PIM_INADDR_IS_ANY(rpf->rpf_addr) && PIM_DEBUG_PIM_EVENTS) {
     /* RPF'(S,G) not found */
     char src_str[100];
     char grp_str[100];
     pim_inet4_dump("<src?>", up->source_addr, src_str, sizeof(src_str));
     pim_inet4_dump("<grp?>", up->group_addr, grp_str, sizeof(grp_str));
-    zlog_warn("%s %s: RPF'(%s,%s) not found: won't send join upstream",
-              __FILE__, __PRETTY_FUNCTION__,
-              src_str, grp_str);
+    zlog_debug("%s %s: RPF'(%s,%s) not found: won't send join upstream",
+              __FILE__, __PRETTY_FUNCTION__,
+              src_str, grp_str);
     /* warning only */
   }
 
   /* detect change in pim_nexthop */
   if (nexthop_mismatch(&rpf->source_nexthop, &save_nexthop)) {
 
-    /* if (PIM_DEBUG_PIM_EVENTS) */ {
+    if (PIM_DEBUG_PIM_EVENTS) {
       char src_str[100];
       char grp_str[100];
       char nhaddr_str[100];
@@ -176,7 +176,7 @@ enum pim_rpf_result pim_rpf_update(struct pim_upstream *up,
   /* detect change in RPF_interface(S) */
   if (save_nexthop.interface != rpf->source_nexthop.interface) {
 
-    /* if (PIM_DEBUG_PIM_EVENTS) */ {
+    if (PIM_DEBUG_PIM_EVENTS) {
       char src_str[100];
       char grp_str[100];
       pim_inet4_dump("<src?>", up->source_addr, src_str, sizeof(src_str));
index d1350b08b3e6c6227329e20cd975d1447bc920e9..afd025965894b0ebdbe7c029c2c016808551eff9 100644 (file)
@@ -36,7 +36,7 @@
 
 static void pim_sighup()
 {
-  zlog_debug ("SIGHUP received, ignoring");
+  zlog_info ("SIGHUP received, ignoring");
 }
 
 static void pim_sigint()
@@ -55,7 +55,7 @@ static void pim_sigterm()
 
 static void pim_sigusr1()
 {
-  zlog_debug ("SIGUSR1 received");
+  zlog_info ("SIGUSR1 received");
   zlog_rotate (NULL);
 }
 
index 4cfb359a5a1dd883ba3e406ee4ec42479f98fbeb..5510ceae1b0a3dc9cd623834957ea6b8f91218e4 100644 (file)
@@ -758,7 +758,7 @@ static int fib_lookup_if_vif_index(struct in_addr addr)
   if (num_ifindex > 1) {
     char addr_str[100];
     pim_inet4_dump("<addr?>", addr, addr_str, sizeof(addr_str));
-    zlog_debug("%s %s: FIXME ignoring multiple nexthop ifindex'es num_ifindex=%d for address %s (using only ifindex=%d)",
+    zlog_info("%s %s: FIXME ignoring multiple nexthop ifindex'es num_ifindex=%d for address %s (using only ifindex=%d)",
               __FILE__, __PRETTY_FUNCTION__,
               num_ifindex, addr_str, first_ifindex);
     /* debug warning only, do not return */
index 6e3845c54928c0a5c48e4c5cc17f2dee04b0bbb4..6f9e2fb35b799a2b560000a0c9f3fcb2d7e8560c 100644 (file)
@@ -289,14 +289,14 @@ static int zclient_read_nexthop(struct zclient *zlookup,
       nexthop_tab[num_ifindex].ifindex             = 0;
       nexthop_tab[num_ifindex].protocol_distance   = distance;
       nexthop_tab[num_ifindex].route_metric        = metric;
-      {
+      if (PIM_DEBUG_ZEBRA) {
        char addr_str[100];
        char nexthop_str[100];
        pim_inet4_dump("<addr?>", addr, addr_str, sizeof(addr_str));
        pim_inet4_dump("<nexthop?>", nexthop_tab[num_ifindex].nexthop_addr, nexthop_str, sizeof(nexthop_str));
-       zlog_warn("%s %s: zebra returned recursive nexthop %s for address %s",
-                 __FILE__, __PRETTY_FUNCTION__,
-                 nexthop_str, addr_str);
+       zlog_debug("%s %s: zebra returned recursive nexthop %s for address %s",
+                  __FILE__, __PRETTY_FUNCTION__,
+                  nexthop_str, addr_str);
       }
       ++num_ifindex;
       break;
@@ -381,7 +381,7 @@ int zclient_lookup_nexthop(struct zclient *zlookup,
 
     num_ifindex = zclient_lookup_nexthop_once(qpim_zclient_lookup, nexthop_tab,
                                              PIM_NEXTHOP_IFINDEX_TAB_SIZE, addr);
-    if (num_ifindex < 1) {
+    if ((num_ifindex < 1) && PIM_DEBUG_ZEBRA) {
       char addr_str[100];
       pim_inet4_dump("<addr?>", addr, addr_str, sizeof(addr_str));
       zlog_warn("%s %s: lookup=%d/%d: could not find nexthop ifindex for address %s",
@@ -406,15 +406,15 @@ int zclient_lookup_nexthop(struct zclient *zlookup,
     if (first_ifindex > 0) {
       /* found: first ifindex is non-recursive nexthop */
 
-      if (lookup > 0) {
+      if ((lookup > 0) && PIM_DEBUG_ZEBRA) {
        /* Report non-recursive success after first lookup */
        char addr_str[100];
        pim_inet4_dump("<addr?>", addr, addr_str, sizeof(addr_str));
-       zlog_info("%s %s: lookup=%d/%d: found non-recursive ifindex=%d for address %s dist=%d met=%d",
-                 __FILE__, __PRETTY_FUNCTION__,
-                 lookup, max_lookup, first_ifindex, addr_str,
-                 nexthop_tab[0].protocol_distance,
-                 nexthop_tab[0].route_metric);
+       zlog_debug("%s %s: lookup=%d/%d: found non-recursive ifindex=%d for address %s dist=%d met=%d",
+                  __FILE__, __PRETTY_FUNCTION__,
+                  lookup, max_lookup, first_ifindex, addr_str,
+                  nexthop_tab[0].protocol_distance,
+                  nexthop_tab[0].route_metric);
 
        /* use last address as nexthop address */
        nexthop_tab[0].nexthop_addr = addr;
@@ -427,12 +427,12 @@ int zclient_lookup_nexthop(struct zclient *zlookup,
       return num_ifindex;
     }
 
-    {
+    if (PIM_DEBUG_ZEBRA) {
       char addr_str[100];
       char nexthop_str[100];
       pim_inet4_dump("<addr?>", addr, addr_str, sizeof(addr_str));
       pim_inet4_dump("<nexthop?>", nexthop_addr, nexthop_str, sizeof(nexthop_str));
-      zlog_warn("%s %s: lookup=%d/%d: zebra returned recursive nexthop %s for address %s dist=%d met=%d",
+      zlog_debug("%s %s: lookup=%d/%d: zebra returned recursive nexthop %s for address %s dist=%d met=%d",
                __FILE__, __PRETTY_FUNCTION__,
                lookup, max_lookup, nexthop_str, addr_str,
                nexthop_tab[0].protocol_distance,
@@ -443,11 +443,13 @@ int zclient_lookup_nexthop(struct zclient *zlookup,
 
   } /* for (max_lookup) */
 
-  char addr_str[100];
-  pim_inet4_dump("<addr?>", addr, addr_str, sizeof(addr_str));
-  zlog_warn("%s %s: lookup=%d/%d: failure searching recursive nexthop ifindex for address %s",
-           __FILE__, __PRETTY_FUNCTION__,
-           lookup, max_lookup, addr_str);
+  if (PIM_DEBUG_ZEBRA) {
+    char addr_str[100];
+    pim_inet4_dump("<addr?>", addr, addr_str, sizeof(addr_str));
+    zlog_warn("%s %s: lookup=%d/%d: failure searching recursive nexthop ifindex for address %s",
+             __FILE__, __PRETTY_FUNCTION__,
+             lookup, max_lookup, addr_str);
+  }
 
   return -2;
 }