blob: e0d00cef0bd8d27dc0ee9d964d4343f542efce41 [file] [log] [blame]
Kalle Valo5e3dd152013-06-12 20:52:10 +03001/*
2 * Copyright (c) 2005-2011 Atheros Communications Inc.
3 * Copyright (c) 2011-2013 Qualcomm Atheros, Inc.
4 *
5 * Permission to use, copy, modify, and/or distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 */
17
18#if !defined(_TRACE_H_) || defined(TRACE_HEADER_MULTI_READ)
19
20#include <linux/tracepoint.h>
Michal Kaziord35a6c12014-09-02 11:00:21 +030021#include "core.h"
Kalle Valo5e3dd152013-06-12 20:52:10 +030022
Rajkumar Manoharan5ce8e7f2014-11-05 19:14:31 +053023#if !defined(_TRACE_H_)
Michal Kazior36d82302015-04-10 13:02:28 +000024static inline u32 ath10k_frm_hdr_len(const void *buf, size_t len)
Rajkumar Manoharan5ce8e7f2014-11-05 19:14:31 +053025{
Michal Kaziorb22a8f42014-11-27 08:42:11 +010026 const struct ieee80211_hdr *hdr = buf;
27
Michal Kazior36d82302015-04-10 13:02:28 +000028 /* In some rare cases (e.g. fcs error) device reports frame buffer
29 * shorter than what frame header implies (e.g. len = 0). The buffer
30 * can still be accessed so do a simple min() to guarantee caller
31 * doesn't get value greater than len.
32 */
33 return min_t(u32, len, ieee80211_hdrlen(hdr->frame_control));
Rajkumar Manoharan5ce8e7f2014-11-05 19:14:31 +053034}
35#endif
36
Kalle Valo5e3dd152013-06-12 20:52:10 +030037#define _TRACE_H_
38
39/* create empty functions when tracing is disabled */
40#if !defined(CONFIG_ATH10K_TRACING)
41#undef TRACE_EVENT
42#define TRACE_EVENT(name, proto, ...) \
43static inline void trace_ ## name(proto) {}
44#undef DECLARE_EVENT_CLASS
45#define DECLARE_EVENT_CLASS(...)
46#undef DEFINE_EVENT
47#define DEFINE_EVENT(evt_class, name, proto, ...) \
48static inline void trace_ ## name(proto) {}
49#endif /* !CONFIG_ATH10K_TRACING || __CHECKER__ */
50
51#undef TRACE_SYSTEM
52#define TRACE_SYSTEM ath10k
53
Michal Kaziorf42f8eb2015-04-01 22:53:19 +030054#define ATH10K_MSG_MAX 400
Kalle Valo5e3dd152013-06-12 20:52:10 +030055
56DECLARE_EVENT_CLASS(ath10k_log_event,
Michal Kaziord35a6c12014-09-02 11:00:21 +030057 TP_PROTO(struct ath10k *ar, struct va_format *vaf),
58 TP_ARGS(ar, vaf),
Kalle Valo5e3dd152013-06-12 20:52:10 +030059 TP_STRUCT__entry(
Michal Kaziord35a6c12014-09-02 11:00:21 +030060 __string(device, dev_name(ar->dev))
61 __string(driver, dev_driver_string(ar->dev))
Kalle Valo5e3dd152013-06-12 20:52:10 +030062 __dynamic_array(char, msg, ATH10K_MSG_MAX)
63 ),
64 TP_fast_assign(
Michal Kaziord35a6c12014-09-02 11:00:21 +030065 __assign_str(device, dev_name(ar->dev));
66 __assign_str(driver, dev_driver_string(ar->dev));
Kalle Valo5e3dd152013-06-12 20:52:10 +030067 WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg),
68 ATH10K_MSG_MAX,
69 vaf->fmt,
70 *vaf->va) >= ATH10K_MSG_MAX);
71 ),
Michal Kaziord35a6c12014-09-02 11:00:21 +030072 TP_printk(
73 "%s %s %s",
74 __get_str(driver),
75 __get_str(device),
76 __get_str(msg)
77 )
Kalle Valo5e3dd152013-06-12 20:52:10 +030078);
79
80DEFINE_EVENT(ath10k_log_event, ath10k_log_err,
Michal Kaziord35a6c12014-09-02 11:00:21 +030081 TP_PROTO(struct ath10k *ar, struct va_format *vaf),
82 TP_ARGS(ar, vaf)
Kalle Valo5e3dd152013-06-12 20:52:10 +030083);
84
85DEFINE_EVENT(ath10k_log_event, ath10k_log_warn,
Michal Kaziord35a6c12014-09-02 11:00:21 +030086 TP_PROTO(struct ath10k *ar, struct va_format *vaf),
87 TP_ARGS(ar, vaf)
Kalle Valo5e3dd152013-06-12 20:52:10 +030088);
89
90DEFINE_EVENT(ath10k_log_event, ath10k_log_info,
Michal Kaziord35a6c12014-09-02 11:00:21 +030091 TP_PROTO(struct ath10k *ar, struct va_format *vaf),
92 TP_ARGS(ar, vaf)
Kalle Valo5e3dd152013-06-12 20:52:10 +030093);
94
95TRACE_EVENT(ath10k_log_dbg,
Michal Kaziord35a6c12014-09-02 11:00:21 +030096 TP_PROTO(struct ath10k *ar, unsigned int level, struct va_format *vaf),
97 TP_ARGS(ar, level, vaf),
Kalle Valo5e3dd152013-06-12 20:52:10 +030098 TP_STRUCT__entry(
Michal Kaziord35a6c12014-09-02 11:00:21 +030099 __string(device, dev_name(ar->dev))
100 __string(driver, dev_driver_string(ar->dev))
Kalle Valo5e3dd152013-06-12 20:52:10 +0300101 __field(unsigned int, level)
102 __dynamic_array(char, msg, ATH10K_MSG_MAX)
103 ),
104 TP_fast_assign(
Michal Kaziord35a6c12014-09-02 11:00:21 +0300105 __assign_str(device, dev_name(ar->dev));
106 __assign_str(driver, dev_driver_string(ar->dev));
Kalle Valo5e3dd152013-06-12 20:52:10 +0300107 __entry->level = level;
108 WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg),
109 ATH10K_MSG_MAX,
110 vaf->fmt,
111 *vaf->va) >= ATH10K_MSG_MAX);
112 ),
Michal Kaziord35a6c12014-09-02 11:00:21 +0300113 TP_printk(
114 "%s %s %s",
115 __get_str(driver),
116 __get_str(device),
117 __get_str(msg)
118 )
Kalle Valo5e3dd152013-06-12 20:52:10 +0300119);
120
121TRACE_EVENT(ath10k_log_dbg_dump,
Michal Kaziord35a6c12014-09-02 11:00:21 +0300122 TP_PROTO(struct ath10k *ar, const char *msg, const char *prefix,
Kalle Valo5e3dd152013-06-12 20:52:10 +0300123 const void *buf, size_t buf_len),
124
Michal Kaziord35a6c12014-09-02 11:00:21 +0300125 TP_ARGS(ar, msg, prefix, buf, buf_len),
Kalle Valo5e3dd152013-06-12 20:52:10 +0300126
127 TP_STRUCT__entry(
Michal Kaziord35a6c12014-09-02 11:00:21 +0300128 __string(device, dev_name(ar->dev))
129 __string(driver, dev_driver_string(ar->dev))
Kalle Valo5e3dd152013-06-12 20:52:10 +0300130 __string(msg, msg)
131 __string(prefix, prefix)
132 __field(size_t, buf_len)
133 __dynamic_array(u8, buf, buf_len)
134 ),
135
136 TP_fast_assign(
Michal Kaziord35a6c12014-09-02 11:00:21 +0300137 __assign_str(device, dev_name(ar->dev));
138 __assign_str(driver, dev_driver_string(ar->dev));
Kalle Valo5e3dd152013-06-12 20:52:10 +0300139 __assign_str(msg, msg);
140 __assign_str(prefix, prefix);
141 __entry->buf_len = buf_len;
142 memcpy(__get_dynamic_array(buf), buf, buf_len);
143 ),
144
145 TP_printk(
Michal Kaziord35a6c12014-09-02 11:00:21 +0300146 "%s %s %s/%s\n",
147 __get_str(driver),
148 __get_str(device),
149 __get_str(prefix),
150 __get_str(msg)
Kalle Valo5e3dd152013-06-12 20:52:10 +0300151 )
152);
153
154TRACE_EVENT(ath10k_wmi_cmd,
Michal Kaziorb22a8f42014-11-27 08:42:11 +0100155 TP_PROTO(struct ath10k *ar, int id, const void *buf, size_t buf_len,
156 int ret),
Kalle Valo5e3dd152013-06-12 20:52:10 +0300157
Michal Kaziord35a6c12014-09-02 11:00:21 +0300158 TP_ARGS(ar, id, buf, buf_len, ret),
Kalle Valo5e3dd152013-06-12 20:52:10 +0300159
160 TP_STRUCT__entry(
Michal Kaziord35a6c12014-09-02 11:00:21 +0300161 __string(device, dev_name(ar->dev))
162 __string(driver, dev_driver_string(ar->dev))
Kalle Valo5e3dd152013-06-12 20:52:10 +0300163 __field(unsigned int, id)
164 __field(size_t, buf_len)
165 __dynamic_array(u8, buf, buf_len)
Michal Kazior9e84f652013-09-19 09:44:09 +0200166 __field(int, ret)
Kalle Valo5e3dd152013-06-12 20:52:10 +0300167 ),
168
169 TP_fast_assign(
Michal Kaziord35a6c12014-09-02 11:00:21 +0300170 __assign_str(device, dev_name(ar->dev));
171 __assign_str(driver, dev_driver_string(ar->dev));
Kalle Valo5e3dd152013-06-12 20:52:10 +0300172 __entry->id = id;
173 __entry->buf_len = buf_len;
Michal Kaziorbe8b3942013-09-13 14:16:54 +0200174 __entry->ret = ret;
Kalle Valo5e3dd152013-06-12 20:52:10 +0300175 memcpy(__get_dynamic_array(buf), buf, buf_len);
176 ),
177
178 TP_printk(
Michal Kaziord35a6c12014-09-02 11:00:21 +0300179 "%s %s id %d len %zu ret %d",
180 __get_str(driver),
181 __get_str(device),
Kalle Valo5e3dd152013-06-12 20:52:10 +0300182 __entry->id,
Michal Kaziorbe8b3942013-09-13 14:16:54 +0200183 __entry->buf_len,
184 __entry->ret
Kalle Valo5e3dd152013-06-12 20:52:10 +0300185 )
186);
187
188TRACE_EVENT(ath10k_wmi_event,
Michal Kaziorb22a8f42014-11-27 08:42:11 +0100189 TP_PROTO(struct ath10k *ar, int id, const void *buf, size_t buf_len),
Kalle Valo5e3dd152013-06-12 20:52:10 +0300190
Michal Kaziord35a6c12014-09-02 11:00:21 +0300191 TP_ARGS(ar, id, buf, buf_len),
Kalle Valo5e3dd152013-06-12 20:52:10 +0300192
193 TP_STRUCT__entry(
Michal Kaziord35a6c12014-09-02 11:00:21 +0300194 __string(device, dev_name(ar->dev))
195 __string(driver, dev_driver_string(ar->dev))
Kalle Valo5e3dd152013-06-12 20:52:10 +0300196 __field(unsigned int, id)
197 __field(size_t, buf_len)
198 __dynamic_array(u8, buf, buf_len)
199 ),
200
201 TP_fast_assign(
Michal Kaziord35a6c12014-09-02 11:00:21 +0300202 __assign_str(device, dev_name(ar->dev));
203 __assign_str(driver, dev_driver_string(ar->dev));
Kalle Valo5e3dd152013-06-12 20:52:10 +0300204 __entry->id = id;
205 __entry->buf_len = buf_len;
206 memcpy(__get_dynamic_array(buf), buf, buf_len);
207 ),
208
209 TP_printk(
Michal Kaziord35a6c12014-09-02 11:00:21 +0300210 "%s %s id %d len %zu",
211 __get_str(driver),
212 __get_str(device),
Kalle Valo5e3dd152013-06-12 20:52:10 +0300213 __entry->id,
214 __entry->buf_len
215 )
216);
217
Kalle Valoa9bf0502013-09-03 11:43:55 +0300218TRACE_EVENT(ath10k_htt_stats,
Michal Kaziorb22a8f42014-11-27 08:42:11 +0100219 TP_PROTO(struct ath10k *ar, const void *buf, size_t buf_len),
Kalle Valoa9bf0502013-09-03 11:43:55 +0300220
Michal Kaziord35a6c12014-09-02 11:00:21 +0300221 TP_ARGS(ar, buf, buf_len),
Kalle Valoa9bf0502013-09-03 11:43:55 +0300222
223 TP_STRUCT__entry(
Michal Kaziord35a6c12014-09-02 11:00:21 +0300224 __string(device, dev_name(ar->dev))
225 __string(driver, dev_driver_string(ar->dev))
Kalle Valoa9bf0502013-09-03 11:43:55 +0300226 __field(size_t, buf_len)
227 __dynamic_array(u8, buf, buf_len)
228 ),
229
230 TP_fast_assign(
Michal Kaziord35a6c12014-09-02 11:00:21 +0300231 __assign_str(device, dev_name(ar->dev));
232 __assign_str(driver, dev_driver_string(ar->dev));
Kalle Valoa9bf0502013-09-03 11:43:55 +0300233 __entry->buf_len = buf_len;
234 memcpy(__get_dynamic_array(buf), buf, buf_len);
235 ),
236
237 TP_printk(
Michal Kaziord35a6c12014-09-02 11:00:21 +0300238 "%s %s len %zu",
239 __get_str(driver),
240 __get_str(device),
Kalle Valoa9bf0502013-09-03 11:43:55 +0300241 __entry->buf_len
242 )
243);
244
Kalle Valo869526b2014-01-03 12:59:26 +0200245TRACE_EVENT(ath10k_wmi_dbglog,
Michal Kaziorb22a8f42014-11-27 08:42:11 +0100246 TP_PROTO(struct ath10k *ar, const void *buf, size_t buf_len),
Kalle Valo869526b2014-01-03 12:59:26 +0200247
Michal Kaziord35a6c12014-09-02 11:00:21 +0300248 TP_ARGS(ar, buf, buf_len),
Kalle Valo869526b2014-01-03 12:59:26 +0200249
250 TP_STRUCT__entry(
Michal Kaziord35a6c12014-09-02 11:00:21 +0300251 __string(device, dev_name(ar->dev))
252 __string(driver, dev_driver_string(ar->dev))
Ashok Raj Nagarajan18353742016-02-05 21:12:49 +0530253 __field(u8, hw_type);
Kalle Valo869526b2014-01-03 12:59:26 +0200254 __field(size_t, buf_len)
255 __dynamic_array(u8, buf, buf_len)
256 ),
257
258 TP_fast_assign(
Michal Kaziord35a6c12014-09-02 11:00:21 +0300259 __assign_str(device, dev_name(ar->dev));
260 __assign_str(driver, dev_driver_string(ar->dev));
Ashok Raj Nagarajan18353742016-02-05 21:12:49 +0530261 __entry->hw_type = ar->hw_rev;
Kalle Valo869526b2014-01-03 12:59:26 +0200262 __entry->buf_len = buf_len;
263 memcpy(__get_dynamic_array(buf), buf, buf_len);
264 ),
265
266 TP_printk(
Ashok Raj Nagarajan18353742016-02-05 21:12:49 +0530267 "%s %s %d len %zu",
Michal Kaziord35a6c12014-09-02 11:00:21 +0300268 __get_str(driver),
269 __get_str(device),
Ashok Raj Nagarajan18353742016-02-05 21:12:49 +0530270 __entry->hw_type,
Kalle Valo869526b2014-01-03 12:59:26 +0200271 __entry->buf_len
272 )
273);
274
Rajkumar Manoharanbfdd7932014-10-03 08:02:40 +0300275TRACE_EVENT(ath10k_htt_pktlog,
Michal Kaziorb22a8f42014-11-27 08:42:11 +0100276 TP_PROTO(struct ath10k *ar, const void *buf, u16 buf_len),
Rajkumar Manoharanbfdd7932014-10-03 08:02:40 +0300277
278 TP_ARGS(ar, buf, buf_len),
279
280 TP_STRUCT__entry(
281 __string(device, dev_name(ar->dev))
282 __string(driver, dev_driver_string(ar->dev))
Ashok Raj Nagarajan18353742016-02-05 21:12:49 +0530283 __field(u8, hw_type);
Rajkumar Manoharanbfdd7932014-10-03 08:02:40 +0300284 __field(u16, buf_len)
285 __dynamic_array(u8, pktlog, buf_len)
286 ),
287
288 TP_fast_assign(
289 __assign_str(device, dev_name(ar->dev));
290 __assign_str(driver, dev_driver_string(ar->dev));
Ashok Raj Nagarajan18353742016-02-05 21:12:49 +0530291 __entry->hw_type = ar->hw_rev;
Rajkumar Manoharanbfdd7932014-10-03 08:02:40 +0300292 __entry->buf_len = buf_len;
293 memcpy(__get_dynamic_array(pktlog), buf, buf_len);
294 ),
295
296 TP_printk(
Ashok Raj Nagarajan18353742016-02-05 21:12:49 +0530297 "%s %s %d size %hu",
Rajkumar Manoharanbfdd7932014-10-03 08:02:40 +0300298 __get_str(driver),
299 __get_str(device),
Ashok Raj Nagarajan18353742016-02-05 21:12:49 +0530300 __entry->hw_type,
Rajkumar Manoharanbfdd7932014-10-03 08:02:40 +0300301 __entry->buf_len
302 )
303);
304
Rajkumar Manoharand1e50f42014-10-03 08:02:54 +0300305TRACE_EVENT(ath10k_htt_tx,
306 TP_PROTO(struct ath10k *ar, u16 msdu_id, u16 msdu_len,
307 u8 vdev_id, u8 tid),
308
309 TP_ARGS(ar, msdu_id, msdu_len, vdev_id, tid),
310
311 TP_STRUCT__entry(
312 __string(device, dev_name(ar->dev))
313 __string(driver, dev_driver_string(ar->dev))
314 __field(u16, msdu_id)
315 __field(u16, msdu_len)
316 __field(u8, vdev_id)
317 __field(u8, tid)
318 ),
319
320 TP_fast_assign(
321 __assign_str(device, dev_name(ar->dev));
322 __assign_str(driver, dev_driver_string(ar->dev));
323 __entry->msdu_id = msdu_id;
324 __entry->msdu_len = msdu_len;
325 __entry->vdev_id = vdev_id;
326 __entry->tid = tid;
327 ),
328
329 TP_printk(
330 "%s %s msdu_id %d msdu_len %d vdev_id %d tid %d",
331 __get_str(driver),
332 __get_str(device),
333 __entry->msdu_id,
334 __entry->msdu_len,
335 __entry->vdev_id,
336 __entry->tid
337 )
338);
339
340TRACE_EVENT(ath10k_txrx_tx_unref,
341 TP_PROTO(struct ath10k *ar, u16 msdu_id),
342
343 TP_ARGS(ar, msdu_id),
344
345 TP_STRUCT__entry(
346 __string(device, dev_name(ar->dev))
347 __string(driver, dev_driver_string(ar->dev))
348 __field(u16, msdu_id)
349 ),
350
351 TP_fast_assign(
352 __assign_str(device, dev_name(ar->dev));
353 __assign_str(driver, dev_driver_string(ar->dev));
354 __entry->msdu_id = msdu_id;
355 ),
356
357 TP_printk(
358 "%s %s msdu_id %d",
359 __get_str(driver),
360 __get_str(device),
361 __entry->msdu_id
362 )
363);
Rajkumar Manoharan9b57f882014-10-06 22:39:06 +0530364
Rajkumar Manoharan5ce8e7f2014-11-05 19:14:31 +0530365DECLARE_EVENT_CLASS(ath10k_hdr_event,
Michal Kaziorb22a8f42014-11-27 08:42:11 +0100366 TP_PROTO(struct ath10k *ar, const void *data, size_t len),
Rajkumar Manoharan9b57f882014-10-06 22:39:06 +0530367
368 TP_ARGS(ar, data, len),
369
370 TP_STRUCT__entry(
371 __string(device, dev_name(ar->dev))
372 __string(driver, dev_driver_string(ar->dev))
373 __field(size_t, len)
Michal Kazior36d82302015-04-10 13:02:28 +0000374 __dynamic_array(u8, data, ath10k_frm_hdr_len(data, len))
Rajkumar Manoharan9b57f882014-10-06 22:39:06 +0530375 ),
376
377 TP_fast_assign(
378 __assign_str(device, dev_name(ar->dev));
379 __assign_str(driver, dev_driver_string(ar->dev));
Michal Kazior36d82302015-04-10 13:02:28 +0000380 __entry->len = ath10k_frm_hdr_len(data, len);
Rajkumar Manoharan5ce8e7f2014-11-05 19:14:31 +0530381 memcpy(__get_dynamic_array(data), data, __entry->len);
Rajkumar Manoharan9b57f882014-10-06 22:39:06 +0530382 ),
383
384 TP_printk(
385 "%s %s len %zu\n",
386 __get_str(driver),
387 __get_str(device),
388 __entry->len
389 )
390);
391
Rajkumar Manoharan5ce8e7f2014-11-05 19:14:31 +0530392DECLARE_EVENT_CLASS(ath10k_payload_event,
Michal Kaziorb22a8f42014-11-27 08:42:11 +0100393 TP_PROTO(struct ath10k *ar, const void *data, size_t len),
Rajkumar Manoharan5ce8e7f2014-11-05 19:14:31 +0530394
395 TP_ARGS(ar, data, len),
396
397 TP_STRUCT__entry(
398 __string(device, dev_name(ar->dev))
399 __string(driver, dev_driver_string(ar->dev))
400 __field(size_t, len)
Michal Kazior36d82302015-04-10 13:02:28 +0000401 __dynamic_array(u8, payload, (len -
402 ath10k_frm_hdr_len(data, len)))
Rajkumar Manoharan5ce8e7f2014-11-05 19:14:31 +0530403 ),
404
405 TP_fast_assign(
406 __assign_str(device, dev_name(ar->dev));
407 __assign_str(driver, dev_driver_string(ar->dev));
Michal Kazior36d82302015-04-10 13:02:28 +0000408 __entry->len = len - ath10k_frm_hdr_len(data, len);
Rajkumar Manoharan5ce8e7f2014-11-05 19:14:31 +0530409 memcpy(__get_dynamic_array(payload),
Michal Kazior36d82302015-04-10 13:02:28 +0000410 data + ath10k_frm_hdr_len(data, len), __entry->len);
Rajkumar Manoharan5ce8e7f2014-11-05 19:14:31 +0530411 ),
412
413 TP_printk(
414 "%s %s len %zu\n",
415 __get_str(driver),
416 __get_str(device),
417 __entry->len
418 )
419);
420
421DEFINE_EVENT(ath10k_hdr_event, ath10k_tx_hdr,
Michal Kaziorb22a8f42014-11-27 08:42:11 +0100422 TP_PROTO(struct ath10k *ar, const void *data, size_t len),
Rajkumar Manoharan9b57f882014-10-06 22:39:06 +0530423 TP_ARGS(ar, data, len)
424);
425
Rajkumar Manoharan5ce8e7f2014-11-05 19:14:31 +0530426DEFINE_EVENT(ath10k_payload_event, ath10k_tx_payload,
Michal Kaziorb22a8f42014-11-27 08:42:11 +0100427 TP_PROTO(struct ath10k *ar, const void *data, size_t len),
Rajkumar Manoharan9b57f882014-10-06 22:39:06 +0530428 TP_ARGS(ar, data, len)
429);
430
Rajkumar Manoharan5ce8e7f2014-11-05 19:14:31 +0530431DEFINE_EVENT(ath10k_hdr_event, ath10k_rx_hdr,
Michal Kaziorb22a8f42014-11-27 08:42:11 +0100432 TP_PROTO(struct ath10k *ar, const void *data, size_t len),
Rajkumar Manoharan9b57f882014-10-06 22:39:06 +0530433 TP_ARGS(ar, data, len)
434);
435
Rajkumar Manoharan5ce8e7f2014-11-05 19:14:31 +0530436DEFINE_EVENT(ath10k_payload_event, ath10k_rx_payload,
Michal Kaziorb22a8f42014-11-27 08:42:11 +0100437 TP_PROTO(struct ath10k *ar, const void *data, size_t len),
Rajkumar Manoharan9b57f882014-10-06 22:39:06 +0530438 TP_ARGS(ar, data, len)
439);
Michal Kaziora5d85f62014-10-23 17:04:28 +0300440
Rajkumar Manoharan5ce8e7f2014-11-05 19:14:31 +0530441TRACE_EVENT(ath10k_htt_rx_desc,
Michal Kaziorb22a8f42014-11-27 08:42:11 +0100442 TP_PROTO(struct ath10k *ar, const void *data, size_t len),
Rajkumar Manoharan5ce8e7f2014-11-05 19:14:31 +0530443
444 TP_ARGS(ar, data, len),
445
446 TP_STRUCT__entry(
447 __string(device, dev_name(ar->dev))
448 __string(driver, dev_driver_string(ar->dev))
Ashok Raj Nagarajan18353742016-02-05 21:12:49 +0530449 __field(u8, hw_type);
Rajkumar Manoharan5ce8e7f2014-11-05 19:14:31 +0530450 __field(u16, len)
451 __dynamic_array(u8, rxdesc, len)
452 ),
453
454 TP_fast_assign(
455 __assign_str(device, dev_name(ar->dev));
456 __assign_str(driver, dev_driver_string(ar->dev));
Ashok Raj Nagarajan18353742016-02-05 21:12:49 +0530457 __entry->hw_type = ar->hw_rev;
Rajkumar Manoharan5ce8e7f2014-11-05 19:14:31 +0530458 __entry->len = len;
459 memcpy(__get_dynamic_array(rxdesc), data, len);
460 ),
461
462 TP_printk(
Ashok Raj Nagarajan18353742016-02-05 21:12:49 +0530463 "%s %s %d rxdesc len %d",
Rajkumar Manoharan5ce8e7f2014-11-05 19:14:31 +0530464 __get_str(driver),
465 __get_str(device),
Ashok Raj Nagarajan18353742016-02-05 21:12:49 +0530466 __entry->hw_type,
Rajkumar Manoharan5ce8e7f2014-11-05 19:14:31 +0530467 __entry->len
468 )
Michal Kaziora5d85f62014-10-23 17:04:28 +0300469);
Rajkumar Manoharan5ce8e7f2014-11-05 19:14:31 +0530470
Michal Kazior04de6c62015-01-24 12:14:47 +0200471TRACE_EVENT(ath10k_wmi_diag_container,
472 TP_PROTO(struct ath10k *ar,
473 u8 type,
474 u32 timestamp,
475 u32 code,
476 u16 len,
477 const void *data),
478
479 TP_ARGS(ar, type, timestamp, code, len, data),
480
481 TP_STRUCT__entry(
482 __string(device, dev_name(ar->dev))
483 __string(driver, dev_driver_string(ar->dev))
484 __field(u8, type)
485 __field(u32, timestamp)
486 __field(u32, code)
487 __field(u16, len)
488 __dynamic_array(u8, data, len)
489 ),
490
491 TP_fast_assign(
492 __assign_str(device, dev_name(ar->dev));
493 __assign_str(driver, dev_driver_string(ar->dev));
494 __entry->type = type;
495 __entry->timestamp = timestamp;
496 __entry->code = code;
497 __entry->len = len;
498 memcpy(__get_dynamic_array(data), data, len);
499 ),
500
501 TP_printk(
502 "%s %s diag container type %hhu timestamp %u code %u len %d",
503 __get_str(driver),
504 __get_str(device),
505 __entry->type,
506 __entry->timestamp,
507 __entry->code,
508 __entry->len
509 )
510);
511
Michal Kaziorc3113c32015-01-24 12:14:47 +0200512TRACE_EVENT(ath10k_wmi_diag,
513 TP_PROTO(struct ath10k *ar, const void *data, size_t len),
514
515 TP_ARGS(ar, data, len),
516
517 TP_STRUCT__entry(
518 __string(device, dev_name(ar->dev))
519 __string(driver, dev_driver_string(ar->dev))
520 __field(u16, len)
521 __dynamic_array(u8, data, len)
522 ),
523
524 TP_fast_assign(
525 __assign_str(device, dev_name(ar->dev));
526 __assign_str(driver, dev_driver_string(ar->dev));
527 __entry->len = len;
528 memcpy(__get_dynamic_array(data), data, len);
529 ),
530
531 TP_printk(
532 "%s %s tlv diag len %d",
533 __get_str(driver),
534 __get_str(device),
535 __entry->len
536 )
537);
538
Kalle Valo5e3dd152013-06-12 20:52:10 +0300539#endif /* _TRACE_H_ || TRACE_HEADER_MULTI_READ*/
540
541/* we don't want to use include/trace/events */
542#undef TRACE_INCLUDE_PATH
543#define TRACE_INCLUDE_PATH .
544#undef TRACE_INCLUDE_FILE
545#define TRACE_INCLUDE_FILE trace
546
547/* This part must be outside protection */
548#include <trace/define_trace.h>