Skip to content

Commit

Permalink
zebra: Combine 2 debugs into 1 for NHG Detail
Browse files Browse the repository at this point in the history
When debugging NHG detail there is a whole bunch
of lines surrounding the nexthop group.  Let's
clean these up since they are extremely chatty and
spawn several lines.

Signed-off-by: Donald Sharp <[email protected]>
  • Loading branch information
donaldsharp committed Jan 24, 2024
1 parent a5613bd commit 7a3b649
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions zebra/zebra_nhg.c
Original file line number Diff line number Diff line change
Expand Up @@ -690,20 +690,17 @@ static bool zebra_nhe_find(struct nhg_hash_entry **nhe, /* return value */
struct nhg_hash_entry *newnhe, *backup_nhe;
struct nexthop *nh = NULL;

if (IS_ZEBRA_DEBUG_NHG_DETAIL)
zlog_debug(
"%s: id %u, lookup %p, vrf %d, type %d, depends %p%s",
__func__, lookup->id, lookup, lookup->vrf_id,
lookup->type, nhg_depends,
(from_dplane ? " (from dplane)" : ""));

if (lookup->id)
(*nhe) = zebra_nhg_lookup_id(lookup->id);
else
(*nhe) = hash_lookup(zrouter.nhgs, lookup);

if (IS_ZEBRA_DEBUG_NHG_DETAIL)
zlog_debug("%s: lookup => %p (%pNG)", __func__, *nhe, *nhe);
zlog_debug("%s: id %u, lookup %p, vrf %d, type %d, depends %p%s => Found %p(%pNG)",
__func__, lookup->id, lookup, lookup->vrf_id,
lookup->type, nhg_depends,
(from_dplane ? " (from dplane)" : ""), *nhe, *nhe);

/* If we found an existing object, we're done */
if (*nhe)
Expand Down Expand Up @@ -1537,13 +1534,11 @@ zebra_nhg_rib_find_nhe(struct nhg_hash_entry *rt_nhe, afi_t rt_afi)
return NULL;
}

if (IS_ZEBRA_DEBUG_NHG_DETAIL)
zlog_debug("%s: rt_nhe %p (%pNG)", __func__, rt_nhe, rt_nhe);

zebra_nhe_find(&nhe, rt_nhe, NULL, rt_afi, false);

if (IS_ZEBRA_DEBUG_NHG_DETAIL)
zlog_debug("%s: => nhe %p (%pNG)", __func__, nhe, nhe);
zlog_debug("%s: rt_nhe %p(%pNG) => nhe %p(%pNG)", __func__,
rt_nhe, rt_nhe, nhe, nhe);

return nhe;
}
Expand Down

0 comments on commit 7a3b649

Please sign in to comment.