summaryrefslogtreecommitdiffstats
path: root/net/mac80211/trace.c
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/trace.c
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/trace.c')
-rw-r--r--net/mac80211/trace.c66
1 files changed, 66 insertions, 0 deletions
diff --git a/net/mac80211/trace.c b/net/mac80211/trace.c
index 943da6e7076c..386e45d8a958 100644
--- a/net/mac80211/trace.c
+++ b/net/mac80211/trace.c
@@ -3,7 +3,73 @@
/* sparse isn't too happy with all macros... */
#ifndef __CHECKER__
+#include <net/cfg80211.h>
#include "driver-ops.h"
+#include "debug.h"
#define CREATE_TRACE_POINTS
#include "trace.h"
+
+#ifdef CONFIG_MAC80211_MESSAGE_TRACING
+void __sdata_info(const char *fmt, ...)
+{
+ struct va_format vaf = {
+ .fmt = fmt,
+ };
+ va_list args;
+
+ va_start(args, fmt);
+ vaf.va = &args;
+
+ pr_info("%pV", &vaf);
+ trace_mac80211_info(&vaf);
+ va_end(args);
+}
+
+void __sdata_dbg(bool print, const char *fmt, ...)
+{
+ struct va_format vaf = {
+ .fmt = fmt,
+ };
+ va_list args;
+
+ va_start(args, fmt);
+ vaf.va = &args;
+
+ if (print)
+ pr_debug("%pV", &vaf);
+ trace_mac80211_dbg(&vaf);
+ va_end(args);
+}
+
+void __sdata_err(const char *fmt, ...)
+{
+ struct va_format vaf = {
+ .fmt = fmt,
+ };
+ va_list args;
+
+ va_start(args, fmt);
+ vaf.va = &args;
+
+ pr_err("%pV", &vaf);
+ trace_mac80211_err(&vaf);
+ va_end(args);
+}
+
+void __wiphy_dbg(struct wiphy *wiphy, bool print, const char *fmt, ...)
+{
+ struct va_format vaf = {
+ .fmt = fmt,
+ };
+ va_list args;
+
+ va_start(args, fmt);
+ vaf.va = &args;
+
+ if (print)
+ wiphy_dbg(wiphy, "%pV", &vaf);
+ trace_mac80211_dbg(&vaf);
+ va_end(args);
+}
+#endif
#endif