Parcourir la source

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

Jouni Malinen il y a 15 ans
Parent
commit
5e5223bf29
3 fichiers modifiés avec 25 ajouts et 4 suppressions
  1. 6 1
      src/utils/eloop.c
  2. 8 3
      src/utils/trace.c
  3. 11 0
      src/utils/trace.h

+ 6 - 1
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);

+ 8 - 3
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)

+ 11 - 0
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 */