summaryrefslogtreecommitdiffstats
path: root/net/mac80211/debug.h
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-06-22 13:36:25 +0200
committerJohannes Berg <johannes.berg@intel.com>2012-06-24 11:33:18 +0200
commit3fae0273168026ed7b6065674f1410f531d58164 (patch)
tree18333b3760f1c5fea83d1f92a1a6c8a0c1e0212d /net/mac80211/debug.h
parentmac80211: rename driver-trace file (diff)
downloadlinux-3fae0273168026ed7b6065674f1410f531d58164.tar.xz
linux-3fae0273168026ed7b6065674f1410f531d58164.zip
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 @@
#ifndef __MAC80211_DEBUG_H
#define __MAC80211_DEBUG_H
+#include <net/cfg80211.h>
#ifdef CONFIG_MAC80211_IBSS_DEBUG
#define MAC80211_IBSS_DEBUG 1
@@ -61,6 +62,22 @@
#define MAC80211_MLME_DEBUG 0
#endif
+#ifdef CONFIG_MAC80211_MESSAGE_TRACING
+void __sdata_info(const char *fmt, ...) __printf(1, 2);
+void __sdata_dbg(bool print, const char *fmt, ...) __printf(2, 3);
+void __sdata_err(const char *fmt, ...) __printf(1, 2);
+void __wiphy_dbg(struct wiphy *wiphy, bool print, const char *fmt, ...)
+ __printf(3, 4);
+
+#define _sdata_info(sdata, fmt, ...) \
+ __sdata_info("%s: " fmt, (sdata)->name, ##__VA_ARGS__)
+#define _sdata_dbg(print, sdata, fmt, ...) \
+ __sdata_dbg(print, "%s: " fmt, (sdata)->name, ##__VA_ARGS__)
+#define _sdata_err(sdata, fmt, ...) \
+ __sdata_err("%s: " fmt, (sdata)->name, ##__VA_ARGS__)
+#define _wiphy_dbg(print, wiphy, fmt, ...) \
+ __wiphy_dbg(wiphy, print, fmt, ##__VA_ARGS__)
+#else
#define _sdata_info(sdata, fmt, ...) \
do { \
pr_info("%s: " fmt, \
@@ -85,6 +102,7 @@ do { \
if (print) \
wiphy_dbg((wiphy), fmt, ##__VA_ARGS__); \
} while (0)
+#endif
#define sdata_info(sdata, fmt, ...) \
_sdata_info(sdata, fmt, ##__VA_ARGS__)