diff options
author | Johannes Berg <johannes.berg@intel.com> | 2012-06-22 07:36:25 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2012-06-24 05:33:18 -0400 |
commit | 3fae0273168026ed7b6065674f1410f531d58164 (patch) | |
tree | 18333b3760f1c5fea83d1f92a1a6c8a0c1e0212d /net/mac80211/trace.c | |
parent | 011ad0e9f8533cd003fb760663713df2655a2114 (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/trace.c')
-rw-r--r-- | net/mac80211/trace.c | 66 |
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 @@ | |||
3 | 3 | ||
4 | /* sparse isn't too happy with all macros... */ | 4 | /* sparse isn't too happy with all macros... */ |
5 | #ifndef __CHECKER__ | 5 | #ifndef __CHECKER__ |
6 | #include <net/cfg80211.h> | ||
6 | #include "driver-ops.h" | 7 | #include "driver-ops.h" |
8 | #include "debug.h" | ||
7 | #define CREATE_TRACE_POINTS | 9 | #define CREATE_TRACE_POINTS |
8 | #include "trace.h" | 10 | #include "trace.h" |
11 | |||
12 | #ifdef CONFIG_MAC80211_MESSAGE_TRACING | ||
13 | void __sdata_info(const char *fmt, ...) | ||
14 | { | ||
15 | struct va_format vaf = { | ||
16 | .fmt = fmt, | ||
17 | }; | ||
18 | va_list args; | ||
19 | |||
20 | va_start(args, fmt); | ||
21 | vaf.va = &args; | ||
22 | |||
23 | pr_info("%pV", &vaf); | ||
24 | trace_mac80211_info(&vaf); | ||
25 | va_end(args); | ||
26 | } | ||
27 | |||
28 | void __sdata_dbg(bool print, const char *fmt, ...) | ||
29 | { | ||
30 | struct va_format vaf = { | ||
31 | .fmt = fmt, | ||
32 | }; | ||
33 | va_list args; | ||
34 | |||
35 | va_start(args, fmt); | ||
36 | vaf.va = &args; | ||
37 | |||
38 | if (print) | ||
39 | pr_debug("%pV", &vaf); | ||
40 | trace_mac80211_dbg(&vaf); | ||
41 | va_end(args); | ||
42 | } | ||
43 | |||
44 | void __sdata_err(const char *fmt, ...) | ||
45 | { | ||
46 | struct va_format vaf = { | ||
47 | .fmt = fmt, | ||
48 | }; | ||
49 | va_list args; | ||
50 | |||
51 | va_start(args, fmt); | ||
52 | vaf.va = &args; | ||
53 | |||
54 | pr_err("%pV", &vaf); | ||
55 | trace_mac80211_err(&vaf); | ||
56 | va_end(args); | ||
57 | } | ||
58 | |||
59 | void __wiphy_dbg(struct wiphy *wiphy, bool print, const char *fmt, ...) | ||
60 | { | ||
61 | struct va_format vaf = { | ||
62 | .fmt = fmt, | ||
63 | }; | ||
64 | va_list args; | ||
65 | |||
66 | va_start(args, fmt); | ||
67 | vaf.va = &args; | ||
68 | |||
69 | if (print) | ||
70 | wiphy_dbg(wiphy, "%pV", &vaf); | ||
71 | trace_mac80211_dbg(&vaf); | ||
72 | va_end(args); | ||
73 | } | ||
74 | #endif | ||
9 | #endif | 75 | #endif |