2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

Add a utility function to dump all active sockets on a NM instance

Add the new isc__nm_dump_active_manager() function that can be used
for debugging purposes: it dumps all active sockets withing the
network manager instance.
This commit is contained in:
Artem Boldariev
2023-09-26 15:37:48 +03:00
parent 4a88fc9d5b
commit 3c45dd59cb
2 changed files with 19 additions and 0 deletions

View File

@@ -2926,4 +2926,18 @@ isc__nm_dump_active(isc__networker_t *worker) {
nmsocket_dump(sock);
}
}
void
isc__nm_dump_active_manager(isc_nm_t *netmgr) {
size_t i = 0;
for (i = 0; i < netmgr->nloops; i++) {
isc__networker_t *worker = &netmgr->workers[i];
if (!ISC_LIST_EMPTY(worker->active_sockets)) {
fprintf(stderr, "Worker #%zu (%p)\n", i, worker);
isc__nm_dump_active(worker);
}
}
}
#endif