aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-devtrace.h
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-02-01 00:08:37 -0500
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2012-02-17 12:49:27 -0500
commit2655e314c4b204966008689eaf3e87ba1f38d55c (patch)
tree2d0dc33216e97e764133c7165b7ebcf4b5f16347 /drivers/net/wireless/iwlwifi/iwl-devtrace.h
parentcdfef6c224f9490215cadd91b34c579757a6e59d (diff)
iwlwifi: trace debug messages
Make iwlwifi record all debug messages into tracing, even if debug_level is not enabled. Due to the lack of APIs, the debug messages are now recorded up to a max length of 100, the only one above that is the RXON which is not needed if you trace the commands as well as it only dumps the command contents. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi W Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-devtrace.h')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-devtrace.h65
1 files changed, 65 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-devtrace.h b/drivers/net/wireless/iwlwifi/iwl-devtrace.h
index 4d892211ce4c..96e62338cec0 100644
--- a/drivers/net/wireless/iwlwifi/iwl-devtrace.h
+++ b/drivers/net/wireless/iwlwifi/iwl-devtrace.h
@@ -34,6 +34,11 @@
34#undef TRACE_EVENT 34#undef TRACE_EVENT
35#define TRACE_EVENT(name, proto, ...) \ 35#define TRACE_EVENT(name, proto, ...) \
36static inline void trace_ ## name(proto) {} 36static inline void trace_ ## name(proto) {}
37#undef DECLARE_EVENT_CLASS
38#define DECLARE_EVENT_CLASS(...)
39#undef DEFINE_EVENT
40#define DEFINE_EVENT(evt_class, name, proto, ...) \
41static inline void trace_ ## name(proto) {}
37#endif 42#endif
38 43
39#define PRIV_ENTRY __field(void *, priv) 44#define PRIV_ENTRY __field(void *, priv)
@@ -164,6 +169,66 @@ TRACE_EVENT(iwlwifi_dev_ucode_wrap_event,
164); 169);
165 170
166#undef TRACE_SYSTEM 171#undef TRACE_SYSTEM
172#define TRACE_SYSTEM iwlwifi_msg
173
174#define MAX_MSG_LEN 100
175
176DECLARE_EVENT_CLASS(iwlwifi_msg_event,
177 TP_PROTO(struct va_format *vaf),
178 TP_ARGS(vaf),
179 TP_STRUCT__entry(
180 __dynamic_array(char, msg, MAX_MSG_LEN)
181 ),
182 TP_fast_assign(
183 WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg),
184 MAX_MSG_LEN, vaf->fmt,
185 *vaf->va) >= MAX_MSG_LEN);
186 ),
187 TP_printk("%s", (char *)__get_dynamic_array(msg))
188);
189
190DEFINE_EVENT(iwlwifi_msg_event, iwlwifi_err,
191 TP_PROTO(struct va_format *vaf),
192 TP_ARGS(vaf)
193);
194
195DEFINE_EVENT(iwlwifi_msg_event, iwlwifi_warn,
196 TP_PROTO(struct va_format *vaf),
197 TP_ARGS(vaf)
198);
199
200DEFINE_EVENT(iwlwifi_msg_event, iwlwifi_info,
201 TP_PROTO(struct va_format *vaf),
202 TP_ARGS(vaf)
203);
204
205DEFINE_EVENT(iwlwifi_msg_event, iwlwifi_crit,
206 TP_PROTO(struct va_format *vaf),
207 TP_ARGS(vaf)
208);
209
210TRACE_EVENT(iwlwifi_dbg,
211 TP_PROTO(u32 level, bool in_interrupt, const char *function,
212 struct va_format *vaf),
213 TP_ARGS(level, in_interrupt, function, vaf),
214 TP_STRUCT__entry(
215 __field(u32, level)
216 __field(u8, in_interrupt)
217 __string(function, function)
218 __dynamic_array(char, msg, MAX_MSG_LEN)
219 ),
220 TP_fast_assign(
221 __entry->level = level;
222 __entry->in_interrupt = in_interrupt;
223 __assign_str(function, function);
224 WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg),
225 MAX_MSG_LEN, vaf->fmt,
226 *vaf->va) >= MAX_MSG_LEN);
227 ),
228 TP_printk("%s", (char *)__get_dynamic_array(msg))
229);
230
231#undef TRACE_SYSTEM
167#define TRACE_SYSTEM iwlwifi 232#define TRACE_SYSTEM iwlwifi
168 233
169TRACE_EVENT(iwlwifi_dev_hcmd, 234TRACE_EVENT(iwlwifi_dev_hcmd,