Dumping route sources along with protocols and routes

This commit is contained in:
Maria Matejka 2023-11-01 18:25:40 +01:00
parent 6f1485baf9
commit f730ecef4f
4 changed files with 30 additions and 0 deletions

View File

@ -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
*

View File

@ -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);
}

View File

@ -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)
{

View File

@ -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");
}