From ae481c4166b08c3f55d689bb7710f130b411df5d Mon Sep 17 00:00:00 2001 From: "James R. Leu" Date: Mon, 16 May 2005 20:24:12 -0600 Subject: [PATCH] I added more debug code while bug hunting [git-p4: depot-paths = "//depot/ldp-portable/": change = 1146] --- ldp/ldp_fec.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/ldp/ldp_fec.c b/ldp/ldp_fec.c index 234ed09..162332f 100644 --- a/ldp/ldp_fec.c +++ b/ldp/ldp_fec.c @@ -36,6 +36,12 @@ static uint32_t _ldp_fec_next_index = 1; +static void walk_tree(ldp_global *g) { + LDP_ENTER(g->user_data, "walk_tree"); + route_dump_node(g->fec_tree); + LDP_EXIT(g->user_data, "walk_tree"); +} + static mpls_return_enum ldp_fec_insert(ldp_global *g, ldp_fec * fec) { mpls_return_enum retval = MPLS_SUCCESS; @@ -62,6 +68,8 @@ static mpls_return_enum ldp_fec_insert(ldp_global *g, ldp_fec * fec) MPLS_ASSERT(0); } + LDP_PRINT(g->user_data, "ldp_fec_insert: 0x%08x/%d\n", key, len); + if (mpls_tree_insert(g->fec_tree, key, len, (void *)fec) != MPLS_SUCCESS) { LDP_PRINT(g->user_data, "ldp_fec_insert: error adding fec\n"); retval = MPLS_FATAL; @@ -97,6 +105,7 @@ static void ldp_fec_remove(ldp_global *g, mpls_fec *fec) MPLS_ASSERT(0); } + LDP_PRINT(g->user_data, "ldp_fec_remove: 0x%08x/%d\n", key, len); mpls_tree_remove(g->fec_tree, key, len, (void **)&f); MPLS_ASSERT(f); @@ -185,6 +194,7 @@ ldp_fec *ldp_fec_find(ldp_global *g, mpls_fec *fec) MPLS_ASSERT(0); } + LDP_PRINT(g->user_data, "ldp_fec_find: 0x%08x/%d\n", key, len); if (mpls_tree_get(g->fec_tree, key, len, (void **)&f) != MPLS_SUCCESS) { return NULL; } @@ -253,15 +263,20 @@ mpls_return_enum ldp_fec_add_nexthop(ldp_global *g, ldp_fec * f, { MPLS_ASSERT(f && nh); + LDP_ENTER(g->user_data, "ldp_fec_add_nexthop"); + MPLS_REFCNT_HOLD(nh); MPLS_LIST_ADD_HEAD(&f->nh_root, nh, _fec, ldp_nexthop); ldp_nexthop_add_fec(nh, f); + + LDP_EXIT(g->user_data, "ldp_fec_add_nexthop: success"); return MPLS_SUCCESS; ldp_fec_add_nexthop_error: ldp_fec_del_nexthop(g, f, nh); + LDP_EXIT(g->user_data, "ldp_fec_add_nexthop: fail"); return MPLS_FATAL; } @@ -401,7 +416,9 @@ mpls_return_enum ldp_fec_process_change(ldp_global * g, ldp_fec * f, ldp_attr *ds_attr = NULL; ldp_session *nh_session = NULL; - LDP_ENTER(g->user_data, "ldp_fec_process_change"); + LDP_ENTER(g->user_data, + "ldp_fec_process_change: fec %p nh %p nh_old %p nh_session_old %p", + f, nh, nh_old, nh_session_old); if (!nh_session_old) { nh_session_old = ldp_session_for_nexthop(nh_old); -- 2.11.4.GIT