trace: Show eloop unregistered handler function name/file/line

This commit is contained in:
Jouni Malinen 2009-12-22 01:52:48 +02:00
parent 94caf8cd62
commit 5e5223bf29
3 changed files with 25 additions and 4 deletions

View file

@ -230,11 +230,14 @@ static void eloop_sock_table_destroy(struct eloop_sock_table *table)
for (i = 0; i < table->count && table->table; i++) { for (i = 0; i < table->count && table->table; i++) {
wpa_printf(MSG_INFO, "ELOOP: remaining socket: " wpa_printf(MSG_INFO, "ELOOP: remaining socket: "
"sock=%d eloop_data=%p user_data=%p " "sock=%d eloop_data=%p user_data=%p "
"handler=%p\n", "handler=%p",
table->table[i].sock, table->table[i].sock,
table->table[i].eloop_data, table->table[i].eloop_data,
table->table[i].user_data, table->table[i].user_data,
table->table[i].handler); table->table[i].handler);
wpa_trace_dump_funcname("eloop unregistered socket "
"handler",
table->table[i].handler);
wpa_trace_dump("eloop sock", &table->table[i]); wpa_trace_dump("eloop sock", &table->table[i]);
} }
os_free(table->table); os_free(table->table);
@ -577,6 +580,8 @@ void eloop_destroy(void)
"eloop_data=%p user_data=%p handler=%p", "eloop_data=%p user_data=%p handler=%p",
sec, usec, timeout->eloop_data, timeout->user_data, sec, usec, timeout->eloop_data, timeout->user_data,
timeout->handler); timeout->handler);
wpa_trace_dump_funcname("eloop unregistered timeout handler",
timeout->handler);
wpa_trace_dump("eloop timeout", timeout); wpa_trace_dump("eloop timeout", timeout);
dl_list_del(&timeout->list); dl_list_del(&timeout->list);
eloop_remove_timeout(timeout); eloop_remove_timeout(timeout);

View file

@ -113,8 +113,6 @@ static void read_syms(bfd *abfd)
syms = NULL; syms = NULL;
return; return;
} }
wpa_printf(MSG_INFO, "BFD: Read %ld symbols (%ld bytes)",
symcount, storage);
} }
@ -223,7 +221,6 @@ static void wpa_trace_bfd_init(void)
get_prg_fname(); get_prg_fname();
if (!prg_fname) if (!prg_fname)
return; return;
wpa_printf(MSG_INFO, "BFD[%s]", prg_fname);
} }
if (!cached_abfd) { if (!cached_abfd) {
@ -241,6 +238,14 @@ static void wpa_trace_bfd_init(void)
} }
} }
void wpa_trace_dump_funcname(const char *title, void *pc)
{
wpa_printf(MSG_INFO, "WPA_TRACE: %s: %p", title, pc);
wpa_trace_bfd_init();
wpa_trace_bfd_addr(pc);
}
#else /* WPA_TRACE_BFD */ #else /* WPA_TRACE_BFD */
#define wpa_trace_bfd_init() do { } while (0) #define wpa_trace_bfd_init() do { } while (0)

View file

@ -60,4 +60,15 @@ void wpa_trace_check_ref(const void *addr);
#endif /* WPA_TRACE */ #endif /* WPA_TRACE */
#ifdef WPA_TRACE_BFD
void wpa_trace_dump_funcname(const char *title, void *pc);
#else /* WPA_TRACE_BFD */
#define wpa_trace_dump_funcname(title, pc) do { } while (0)
#endif /* WPA_TRACE_BFD */
#endif /* TRACE_H */ #endif /* TRACE_H */