From 5e5223bf295bdfb19d0ff0905d0da77f846f8de1 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Tue, 22 Dec 2009 01:52:48 +0200 Subject: [PATCH] trace: Show eloop unregistered handler function name/file/line --- src/utils/eloop.c | 7 ++++++- src/utils/trace.c | 11 ++++++++--- src/utils/trace.h | 11 +++++++++++ 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/utils/eloop.c b/src/utils/eloop.c index fa33d4c63..fdc1d8fe5 100644 --- a/src/utils/eloop.c +++ b/src/utils/eloop.c @@ -230,11 +230,14 @@ static void eloop_sock_table_destroy(struct eloop_sock_table *table) for (i = 0; i < table->count && table->table; i++) { wpa_printf(MSG_INFO, "ELOOP: remaining socket: " "sock=%d eloop_data=%p user_data=%p " - "handler=%p\n", + "handler=%p", table->table[i].sock, table->table[i].eloop_data, table->table[i].user_data, table->table[i].handler); + wpa_trace_dump_funcname("eloop unregistered socket " + "handler", + table->table[i].handler); wpa_trace_dump("eloop sock", &table->table[i]); } os_free(table->table); @@ -577,6 +580,8 @@ void eloop_destroy(void) "eloop_data=%p user_data=%p handler=%p", sec, usec, timeout->eloop_data, timeout->user_data, timeout->handler); + wpa_trace_dump_funcname("eloop unregistered timeout handler", + timeout->handler); wpa_trace_dump("eloop timeout", timeout); dl_list_del(&timeout->list); eloop_remove_timeout(timeout); diff --git a/src/utils/trace.c b/src/utils/trace.c index cd5d8ecc0..17ce22442 100644 --- a/src/utils/trace.c +++ b/src/utils/trace.c @@ -113,8 +113,6 @@ static void read_syms(bfd *abfd) syms = NULL; 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(); if (!prg_fname) return; - wpa_printf(MSG_INFO, "BFD[%s]", prg_fname); } 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 */ #define wpa_trace_bfd_init() do { } while (0) diff --git a/src/utils/trace.h b/src/utils/trace.h index 009b6e318..22d3de035 100644 --- a/src/utils/trace.h +++ b/src/utils/trace.h @@ -60,4 +60,15 @@ void wpa_trace_check_ref(const void *addr); #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 */