aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/debug.h
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-06-22 07:36:25 -0400
committerJohannes Berg <johannes.berg@intel.com>2012-06-24 05:33:18 -0400
commit3fae0273168026ed7b6065674f1410f531d58164 (patch)
tree18333b3760f1c5fea83d1f92a1a6c8a0c1e0212d /net/mac80211/debug.h
parent011ad0e9f8533cd003fb760663713df2655a2114 (diff)
mac80211: trace debug messages
It can be very useful to have all debug messages available when debugging, but hard to correlate between different sources, so add a trace event for all mac80211 debug messages. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/debug.h')
-rw-r--r--net/mac80211/debug.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/net/mac80211/debug.h b/net/mac80211/debug.h
index 6e6bbb9a9d41..8f383a576016 100644
--- a/net/mac80211/debug.h
+++ b/net/mac80211/debug.h
@@ -1,5 +1,6 @@
1#ifndef __MAC80211_DEBUG_H 1#ifndef __MAC80211_DEBUG_H
2#define __MAC80211_DEBUG_H 2#define __MAC80211_DEBUG_H
3#include <net/cfg80211.h>
3 4
4#ifdef CONFIG_MAC80211_IBSS_DEBUG 5#ifdef CONFIG_MAC80211_IBSS_DEBUG
5#define MAC80211_IBSS_DEBUG 1 6#define MAC80211_IBSS_DEBUG 1
@@ -61,6 +62,22 @@
61#define MAC80211_MLME_DEBUG 0 62#define MAC80211_MLME_DEBUG 0
62#endif 63#endif
63 64
65#ifdef CONFIG_MAC80211_MESSAGE_TRACING
66void __sdata_info(const char *fmt, ...) __printf(1, 2);
67void __sdata_dbg(bool print, const char *fmt, ...) __printf(2, 3);
68void __sdata_err(const char *fmt, ...) __printf(1, 2);
69void __wiphy_dbg(struct wiphy *wiphy, bool print, const char *fmt, ...)
70 __printf(3, 4);
71
72#define _sdata_info(sdata, fmt, ...) \
73 __sdata_info("%s: " fmt, (sdata)->name, ##__VA_ARGS__)
74#define _sdata_dbg(print, sdata, fmt, ...) \
75 __sdata_dbg(print, "%s: " fmt, (sdata)->name, ##__VA_ARGS__)
76#define _sdata_err(sdata, fmt, ...) \
77 __sdata_err("%s: " fmt, (sdata)->name, ##__VA_ARGS__)
78#define _wiphy_dbg(print, wiphy, fmt, ...) \
79 __wiphy_dbg(wiphy, print, fmt, ##__VA_ARGS__)
80#else
64#define _sdata_info(sdata, fmt, ...) \ 81#define _sdata_info(sdata, fmt, ...) \
65do { \ 82do { \
66 pr_info("%s: " fmt, \ 83 pr_info("%s: " fmt, \
@@ -85,6 +102,7 @@ do { \
85 if (print) \ 102 if (print) \
86 wiphy_dbg((wiphy), fmt, ##__VA_ARGS__); \ 103 wiphy_dbg((wiphy), fmt, ##__VA_ARGS__); \
87} while (0) 104} while (0)
105#endif
88 106
89#define sdata_info(sdata, fmt, ...) \ 107#define sdata_info(sdata, fmt, ...) \
90 _sdata_info(sdata, fmt, ##__VA_ARGS__) 108 _sdata_info(sdata, fmt, ##__VA_ARGS__)