ospfd: Set filter to unbound debug logs

Ticket:CM-19213

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
This commit is contained in:
Chirag Shah 2017-12-26 09:45:25 -08:00
parent ff99c5b2bb
commit 05ba78e4d9
6 changed files with 39 additions and 32 deletions

View File

@ -679,6 +679,7 @@ static int ospf_ase_calculate_timer(struct thread *t)
monotime(&stop_time); monotime(&stop_time);
if (IS_DEBUG_OSPF_EVENT)
zlog_info("SPF Processing Time(usecs): External Routes: %lld\n", zlog_info("SPF Processing Time(usecs): External Routes: %lld\n",
(stop_time.tv_sec - start_time.tv_sec) * 1000000LL (stop_time.tv_sec - start_time.tv_sec) * 1000000LL
+ (stop_time.tv_usec - start_time.tv_usec)); + (stop_time.tv_usec - start_time.tv_usec));

View File

@ -38,7 +38,7 @@
#include "ospfd/ospf_lsdb.h" #include "ospfd/ospf_lsdb.h"
#include "ospfd/ospf_neighbor.h" #include "ospfd/ospf_neighbor.h"
#include "ospfd/ospf_packet.h" #include "ospfd/ospf_packet.h"
#include "ospfd/ospf_dump.h"
/* Join to the OSPF ALL SPF ROUTERS multicast group. */ /* Join to the OSPF ALL SPF ROUTERS multicast group. */
int ospf_if_add_allspfrouters(struct ospf *top, struct prefix *p, int ospf_if_add_allspfrouters(struct ospf *top, struct prefix *p,
@ -56,10 +56,11 @@ int ospf_if_add_allspfrouters(struct ospf *top, struct prefix *p,
"on # of multicast group memberships has been exceeded?", "on # of multicast group memberships has been exceeded?",
top->fd, inet_ntoa(p->u.prefix4), ifindex, top->fd, inet_ntoa(p->u.prefix4), ifindex,
safe_strerror(errno)); safe_strerror(errno));
else else {
zlog_debug( if (IS_DEBUG_OSPF_EVENT)
"interface %s [%u] join AllSPFRouters Multicast group.", zlog_debug("interface %s [%u] join AllSPFRouters Multicast group.",
inet_ntoa(p->u.prefix4), ifindex); inet_ntoa(p->u.prefix4), ifindex);
}
return ret; return ret;
} }
@ -78,10 +79,11 @@ int ospf_if_drop_allspfrouters(struct ospf *top, struct prefix *p,
"ifindex %u, AllSPFRouters): %s", "ifindex %u, AllSPFRouters): %s",
top->fd, inet_ntoa(p->u.prefix4), ifindex, top->fd, inet_ntoa(p->u.prefix4), ifindex,
safe_strerror(errno)); safe_strerror(errno));
else else {
zlog_debug( if (IS_DEBUG_OSPF_EVENT)
"interface %s [%u] leave AllSPFRouters Multicast group.", zlog_debug("interface %s [%u] leave AllSPFRouters Multicast group.",
inet_ntoa(p->u.prefix4), ifindex); inet_ntoa(p->u.prefix4), ifindex);
}
return ret; return ret;
} }

View File

@ -702,10 +702,10 @@ static void nsm_change_state(struct ospf_neighbor *nbr, int state)
oi->ospf); oi->ospf);
} }
zlog_info( if (CHECK_FLAG(oi->ospf->config, OSPF_LOG_ADJACENCY_DETAIL))
"nsm_change_state(%s, %s -> %s): " zlog_info("%s:(%s, %s -> %s): "
"scheduling new router-LSA origination", "scheduling new router-LSA origination",
inet_ntoa(nbr->router_id), __PRETTY_FUNCTION__, inet_ntoa(nbr->router_id),
lookup_msg(ospf_nsm_state_msg, old_state, NULL), lookup_msg(ospf_nsm_state_msg, old_state, NULL),
lookup_msg(ospf_nsm_state_msg, state, NULL)); lookup_msg(ospf_nsm_state_msg, state, NULL));

View File

@ -1363,9 +1363,11 @@ static void ospf_db_desc(struct ip *iph, struct ospf_header *ospfh,
if (IPV4_ADDR_CMP(&nbr->router_id, &oi->ospf->router_id) if (IPV4_ADDR_CMP(&nbr->router_id, &oi->ospf->router_id)
> 0) { > 0) {
/* We're Slave---obey */ /* We're Slave---obey */
zlog_info( if (CHECK_FLAG(oi->ospf->config,
"Packet[DD]: Neighbor %s Negotiation done (Slave).", OSPF_LOG_ADJACENCY_DETAIL))
zlog_info("Packet[DD]: Neighbor %s Negotiation done (Slave).",
inet_ntoa(nbr->router_id)); inet_ntoa(nbr->router_id));
nbr->dd_seqnum = ntohl(dd->dd_seqnum); nbr->dd_seqnum = ntohl(dd->dd_seqnum);
/* Reset I/MS */ /* Reset I/MS */
@ -1374,6 +1376,8 @@ static void ospf_db_desc(struct ip *iph, struct ospf_header *ospfh,
} else { } else {
/* We're Master, ignore the initial DBD from /* We're Master, ignore the initial DBD from
* Slave */ * Slave */
if (CHECK_FLAG(oi->ospf->config,
OSPF_LOG_ADJACENCY_DETAIL))
zlog_info( zlog_info(
"Packet[DD]: Neighbor %s: Initial DBD from Slave, " "Packet[DD]: Neighbor %s: Initial DBD from Slave, "
"ignoring.", "ignoring.",

View File

@ -2589,7 +2589,8 @@ static void ospfTrapNbrStateChange(struct ospf_neighbor *on)
char msgbuf[16]; char msgbuf[16];
ospf_nbr_state_message(on, msgbuf, sizeof(msgbuf)); ospf_nbr_state_message(on, msgbuf, sizeof(msgbuf));
zlog_info("ospfTrapNbrStateChange trap sent: %s now %s", if (IS_DEBUG_OSPF_EVENT)
zlog_info("%s: trap sent: %s now %s", __PRETTY_FUNCTION__,
inet_ntoa(on->address.u.prefix4), msgbuf); inet_ntoa(on->address.u.prefix4), msgbuf);
oid_copy_addr(index, &(on->address.u.prefix4), IN_ADDR_SIZE); oid_copy_addr(index, &(on->address.u.prefix4), IN_ADDR_SIZE);
@ -2646,7 +2647,8 @@ static void ospfTrapIfStateChange(struct ospf_interface *oi)
{ {
oid index[sizeof(oid) * (IN_ADDR_SIZE + 1)]; oid index[sizeof(oid) * (IN_ADDR_SIZE + 1)];
zlog_info("ospfTrapIfStateChange trap sent: %s now %s", if (IS_DEBUG_OSPF_EVENT)
zlog_info("%s: trap sent: %s now %s", __PRETTY_FUNCTION__,
inet_ntoa(oi->address->u.prefix4), inet_ntoa(oi->address->u.prefix4),
lookup_msg(ospf_ism_state_msg, oi->state, NULL)); lookup_msg(ospf_ism_state_msg, oi->state, NULL));

View File

@ -1463,9 +1463,7 @@ void ospf_spf_calculate_schedule(struct ospf *ospf, ospf_spf_reason_t reason)
} }
if (IS_DEBUG_OSPF_EVENT) if (IS_DEBUG_OSPF_EVENT)
zlog_debug("SPF: calculation timer delay = %ld", delay); zlog_debug("SPF: calculation timer delay = %ld msec", delay);
zlog_info("SPF: Scheduled in %ld msec", delay);
ospf->t_spf_calc = NULL; ospf->t_spf_calc = NULL;
thread_add_timer_msec(master, ospf_spf_calculate_timer, ospf, delay, thread_add_timer_msec(master, ospf_spf_calculate_timer, ospf, delay,