diff options
author | Thomas Haller <thaller@redhat.com> | 2015-07-02 14:42:08 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2015-07-02 14:42:08 +0200 |
commit | 987515ea736a6be25ecdd0de309e0844bde637a2 (patch) | |
tree | 7dcb644fc8f4c18ed45a543507e9b9ef51478945 | |
parent | c9aeefb5a18511f930328a3d3a4e7e08cb8564df (diff) | |
download | NetworkManager-th/platform-link-get-all.tar.gz |
platform: add trace-logging to nm_platform_link_get_all()th/platform-link-get-all
-rw-r--r-- | src/platform/nm-platform.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/platform/nm-platform.c b/src/platform/nm-platform.c index 6a549d4ff0..d200df61fd 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; |