3 * Copyright (c) 2009, Jouni Malinen <j@w1.fi>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
9 * Alternatively, this software may be distributed under the terms of BSD
12 * See README and COPYING for more details.
18 #define WPA_TRACE_LEN 16
25 #define WPA_TRACE_INFO void *btrace[WPA_TRACE_LEN]; int btrace_num;
27 struct wpa_trace_ref
{
32 #define WPA_TRACE_REF(name) struct wpa_trace_ref wpa_trace_ref_##name
34 #define wpa_trace_dump(title, ptr) \
35 wpa_trace_dump_func((title), (ptr)->btrace, (ptr)->btrace_num)
36 void wpa_trace_dump_func(const char *title
, void **btrace
, int btrace_num
);
37 #define wpa_trace_record(ptr) \
38 (ptr)->btrace_num = backtrace((ptr)->btrace, WPA_TRACE_LEN)
39 void wpa_trace_show(const char *title
);
40 #define wpa_trace_add_ref(ptr, name, addr) \
41 wpa_trace_add_ref_func(&(ptr)->wpa_trace_ref_##name, (addr))
42 void wpa_trace_add_ref_func(struct wpa_trace_ref
*ref
, const void *addr
);
43 #define wpa_trace_remove_ref(ptr, name, addr) \
46 dl_list_del(&(ptr)->wpa_trace_ref_##name.list); \
48 void wpa_trace_check_ref(const void *addr
);
52 #define WPA_TRACE_INFO
53 #define WPA_TRACE_REF(n)
54 #define wpa_trace_dump(title, ptr) do { } while (0)
55 #define wpa_trace_record(ptr) do { } while (0)
56 #define wpa_trace_show(title) do { } while (0)
57 #define wpa_trace_add_ref(ptr, name, addr) do { } while (0)
58 #define wpa_trace_remove_ref(ptr, name, addr) do { } while (0)
59 #define wpa_trace_check_ref(addr) do { } while (0)
61 #endif /* WPA_TRACE */
66 void wpa_trace_dump_funcname(const char *title
, void *pc
);
68 #else /* WPA_TRACE_BFD */
70 #define wpa_trace_dump_funcname(title, pc) do { } while (0)
72 #endif /* WPA_TRACE_BFD */