wpa_supplicant / hostapd  2.5
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
trace.h
Go to the documentation of this file.
1 
5 #ifndef TRACE_H
6 #define TRACE_H
7 
8 #define WPA_TRACE_LEN 16
9 
10 #ifdef WPA_TRACE
11 #include <execinfo.h>
12 
13 #include "list.h"
14 
15 #define WPA_TRACE_INFO void *btrace[WPA_TRACE_LEN]; int btrace_num;
16 
17 struct wpa_trace_ref {
18  struct dl_list list;
19  const void *addr;
20  WPA_TRACE_INFO
21 };
22 #define WPA_TRACE_REF(name) struct wpa_trace_ref wpa_trace_ref_##name
23 
24 #define wpa_trace_dump(title, ptr) \
25  wpa_trace_dump_func((title), (ptr)->btrace, (ptr)->btrace_num)
26 void wpa_trace_dump_func(const char *title, void **btrace, int btrace_num);
27 #define wpa_trace_record(ptr) \
28  (ptr)->btrace_num = backtrace((ptr)->btrace, WPA_TRACE_LEN)
29 void wpa_trace_show(const char *title);
30 #define wpa_trace_add_ref(ptr, name, addr) \
31  wpa_trace_add_ref_func(&(ptr)->wpa_trace_ref_##name, (addr))
32 void wpa_trace_add_ref_func(struct wpa_trace_ref *ref, const void *addr);
33 #define wpa_trace_remove_ref(ptr, name, addr) \
34  do { \
35  if ((addr)) \
36  dl_list_del(&(ptr)->wpa_trace_ref_##name.list); \
37  } while (0)
38 void wpa_trace_check_ref(const void *addr);
39 size_t wpa_trace_calling_func(const char *buf[], size_t len);
40 
41 #else /* WPA_TRACE */
42 
43 #define WPA_TRACE_INFO
44 #define WPA_TRACE_REF(n)
45 #define wpa_trace_dump(title, ptr) do { } while (0)
46 #define wpa_trace_record(ptr) do { } while (0)
47 #define wpa_trace_show(title) do { } while (0)
48 #define wpa_trace_add_ref(ptr, name, addr) do { } while (0)
49 #define wpa_trace_remove_ref(ptr, name, addr) do { } while (0)
50 #define wpa_trace_check_ref(addr) do { } while (0)
51 
52 #endif /* WPA_TRACE */
53 
54 
55 #ifdef WPA_TRACE_BFD
56 
57 void wpa_trace_dump_funcname(const char *title, void *pc);
58 
59 #else /* WPA_TRACE_BFD */
60 
61 #define wpa_trace_dump_funcname(title, pc) do { } while (0)
62 
63 #endif /* WPA_TRACE_BFD */
64 
65 #endif /* TRACE_H */
Doubly-linked list.
Doubly-linked list.
Definition: list.h:12