mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-26 21:40:08 +01:00
platform: add trace-logging to nm_platform_link_get_all()
(cherry picked from commit 987515ea73)
This commit is contained in:
parent
41617b9605
commit
5edba27fe4
1 changed files with 8 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue