mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-12-22 09:41:54 +00:00
Dumping route sources along with protocols and routes
This commit is contained in:
parent
6f1485baf9
commit
f730ecef4f
@ -173,6 +173,8 @@ static inline void rt_unlock_source(struct rte_src *src)
|
||||
void rt_init_sources(struct rte_owner *, const char *name, event_list *list);
|
||||
void rt_destroy_sources(struct rte_owner *, event *);
|
||||
|
||||
void rt_dump_sources(struct rte_owner *);
|
||||
|
||||
/*
|
||||
* Route Attributes
|
||||
*
|
||||
|
@ -2034,6 +2034,9 @@ protos_dump_all(void)
|
||||
c->out_req.hook ? rt_export_state_name(rt_export_get_state(c->out_req.hook)) : "-");
|
||||
}
|
||||
|
||||
debug("\tSOURCES\n");
|
||||
rt_dump_sources(&p->sources);
|
||||
|
||||
if (p->proto->dump && (p->proto_state != PS_DOWN))
|
||||
p->proto->dump(p);
|
||||
}
|
||||
|
@ -366,6 +366,30 @@ rt_prune_sources(void *data)
|
||||
RTA_UNLOCK;
|
||||
}
|
||||
|
||||
void
|
||||
rt_dump_sources(struct rte_owner *o)
|
||||
{
|
||||
debug("\t%s: hord=%u, uc=%u, cnt=%u prune=%p, stop=%p\n",
|
||||
o->name, o->hash.order, o->uc, o->hash.count, o->prune, o->stop);
|
||||
debug("\tget_route_info=%p, better=%p, mergable=%p, igp_metric=%p, recalculate=%p",
|
||||
o->class->get_route_info, o->class->rte_better, o->class->rte_mergable,
|
||||
o->class->rte_igp_metric, o->rte_recalculate);
|
||||
|
||||
int splitting = 0;
|
||||
HASH_WALK(o->hash, next, src)
|
||||
{
|
||||
debug("%c%c%uL %uG %luU",
|
||||
(splitting % 8) ? ',' : '\n',
|
||||
(splitting % 8) ? ' ' : '\t',
|
||||
src->private_id, src->global_id,
|
||||
atomic_load_explicit(&src->uc, memory_order_relaxed));
|
||||
|
||||
splitting++;
|
||||
}
|
||||
HASH_WALK_END;
|
||||
debug("\n");
|
||||
}
|
||||
|
||||
void
|
||||
rt_init_sources(struct rte_owner *o, const char *name, event_list *list)
|
||||
{
|
||||
|
@ -2502,6 +2502,7 @@ rte_dump(struct rte_storage *e)
|
||||
{
|
||||
debug("%-1N ", e->rte.net);
|
||||
debug("PF=%02x ", e->rte.pflags);
|
||||
debug("SRC=%uG ", e->rte.src->global_id);
|
||||
ea_dump(e->rte.attrs);
|
||||
debug("\n");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user