From 5edba27fe43c11634bd4f58b642ef30bf8e53fb2 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 2 Jul 2015 14:42:08 +0200 Subject: [PATCH] platform: add trace-logging to nm_platform_link_get_all() (cherry picked from commit 987515ea736a6be25ecdd0de309e0844bde637a2) --- src/platform/nm-platform.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/platform/nm-platform.c b/src/platform/nm-platform.c index b67871afe2..953c9cf3a9 100644 --- a/src/platform/nm-platform.c +++ b/src/platform/nm-platform.c @@ -445,11 +445,14 @@ nm_platform_link_get_all (NMPlatform *self) item = &g_array_index (links, NMPlatformLink, i); if (item->ifindex <= 0 || g_hash_table_contains (unseen, GINT_TO_POINTER (item->ifindex))) { + _LOGT ("link-get: SKIP: %3d: %s", i, nm_platform_link_to_string (item)); g_warn_if_reached (); item->ifindex = 0; continue; } + _LOGT ("link-get: %3d: %s", i, nm_platform_link_to_string (item)); + g_hash_table_insert (unseen, GINT_TO_POINTER (item->ifindex), NULL); } @@ -499,6 +502,8 @@ nm_platform_link_get_all (NMPlatform *self) if (item->parent > 0 && g_hash_table_contains (unseen, GINT_TO_POINTER (item->parent))) continue; + _LOGT ("link-get: add %3d -> %3d: %s", i, j, nm_platform_link_to_string (item)); + g_hash_table_remove (unseen, GINT_TO_POINTER (item->ifindex)); g_array_index (result, NMPlatformLink, j++) = *item; item->ifindex = 0; @@ -507,9 +512,11 @@ nm_platform_link_get_all (NMPlatform *self) if (!found_something) { /* there is a circle, pop the first (remaining) element from the list */ - g_warn_if_reached (); item = &g_array_index (links, NMPlatformLink, first_idx); + _LOGT ("link-get: add (circle) %3d -> %3d: %s", first_idx, j, nm_platform_link_to_string (item)); + g_warn_if_reached (); + g_hash_table_remove (unseen, GINT_TO_POINTER (item->ifindex)); g_array_index (result, NMPlatformLink, j++) = *item; item->ifindex = 0;