Kalle Valo | 5e3dd15 | 2013-06-12 20:52:10 +0300 | [diff] [blame] | 1 | /* |
| 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 Kazior | d35a6c1 | 2014-09-02 11:00:21 +0300 | [diff] [blame] | 21 | #include "core.h" |
Kalle Valo | 5e3dd15 | 2013-06-12 20:52:10 +0300 | [diff] [blame] | 22 | |
Rajkumar Manoharan | 5ce8e7f | 2014-11-05 19:14:31 +0530 | [diff] [blame] | 23 | #if !defined(_TRACE_H_) |
Michal Kazior | 36d8230 | 2015-04-10 13:02:28 +0000 | [diff] [blame] | 24 | static inline u32 ath10k_frm_hdr_len(const void *buf, size_t len) |
Rajkumar Manoharan | 5ce8e7f | 2014-11-05 19:14:31 +0530 | [diff] [blame] | 25 | { |
Michal Kazior | b22a8f4 | 2014-11-27 08:42:11 +0100 | [diff] [blame] | 26 | const struct ieee80211_hdr *hdr = buf; |
| 27 | |
Michal Kazior | 36d8230 | 2015-04-10 13:02:28 +0000 | [diff] [blame] | 28 | /* 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 Manoharan | 5ce8e7f | 2014-11-05 19:14:31 +0530 | [diff] [blame] | 34 | } |
| 35 | #endif |
| 36 | |
Kalle Valo | 5e3dd15 | 2013-06-12 20:52:10 +0300 | [diff] [blame] | 37 | #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, ...) \ |
| 43 | static 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, ...) \ |
| 48 | static inline void trace_ ## name(proto) {} |
| 49 | #endif /* !CONFIG_ATH10K_TRACING || __CHECKER__ */ |
| 50 | |
| 51 | #undef TRACE_SYSTEM |
| 52 | #define TRACE_SYSTEM ath10k |
| 53 | |
Michal Kazior | f42f8eb | 2015-04-01 22:53:19 +0300 | [diff] [blame] | 54 | #define ATH10K_MSG_MAX 400 |
Kalle Valo | 5e3dd15 | 2013-06-12 20:52:10 +0300 | [diff] [blame] | 55 | |
| 56 | DECLARE_EVENT_CLASS(ath10k_log_event, |
Michal Kazior | d35a6c1 | 2014-09-02 11:00:21 +0300 | [diff] [blame] | 57 | TP_PROTO(struct ath10k *ar, struct va_format *vaf), |
| 58 | TP_ARGS(ar, vaf), |
Kalle Valo | 5e3dd15 | 2013-06-12 20:52:10 +0300 | [diff] [blame] | 59 | TP_STRUCT__entry( |
Michal Kazior | d35a6c1 | 2014-09-02 11:00:21 +0300 | [diff] [blame] | 60 | __string(device, dev_name(ar->dev)) |
| 61 | __string(driver, dev_driver_string(ar->dev)) |
Kalle Valo | 5e3dd15 | 2013-06-12 20:52:10 +0300 | [diff] [blame] | 62 | __dynamic_array(char, msg, ATH10K_MSG_MAX) |
| 63 | ), |
| 64 | TP_fast_assign( |
Michal Kazior | d35a6c1 | 2014-09-02 11:00:21 +0300 | [diff] [blame] | 65 | __assign_str(device, dev_name(ar->dev)); |
| 66 | __assign_str(driver, dev_driver_string(ar->dev)); |
Kalle Valo | 5e3dd15 | 2013-06-12 20:52:10 +0300 | [diff] [blame] | 67 | WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg), |
| 68 | ATH10K_MSG_MAX, |
| 69 | vaf->fmt, |
| 70 | *vaf->va) >= ATH10K_MSG_MAX); |
| 71 | ), |
Michal Kazior | d35a6c1 | 2014-09-02 11:00:21 +0300 | [diff] [blame] | 72 | TP_printk( |
| 73 | "%s %s %s", |
| 74 | __get_str(driver), |
| 75 | __get_str(device), |
| 76 | __get_str(msg) |
| 77 | ) |
Kalle Valo | 5e3dd15 | 2013-06-12 20:52:10 +0300 | [diff] [blame] | 78 | ); |
| 79 | |
| 80 | DEFINE_EVENT(ath10k_log_event, ath10k_log_err, |
Michal Kazior | d35a6c1 | 2014-09-02 11:00:21 +0300 | [diff] [blame] | 81 | TP_PROTO(struct ath10k *ar, struct va_format *vaf), |
| 82 | TP_ARGS(ar, vaf) |
Kalle Valo | 5e3dd15 | 2013-06-12 20:52:10 +0300 | [diff] [blame] | 83 | ); |
| 84 | |
| 85 | DEFINE_EVENT(ath10k_log_event, ath10k_log_warn, |
Michal Kazior | d35a6c1 | 2014-09-02 11:00:21 +0300 | [diff] [blame] | 86 | TP_PROTO(struct ath10k *ar, struct va_format *vaf), |
| 87 | TP_ARGS(ar, vaf) |
Kalle Valo | 5e3dd15 | 2013-06-12 20:52:10 +0300 | [diff] [blame] | 88 | ); |
| 89 | |
| 90 | DEFINE_EVENT(ath10k_log_event, ath10k_log_info, |
Michal Kazior | d35a6c1 | 2014-09-02 11:00:21 +0300 | [diff] [blame] | 91 | TP_PROTO(struct ath10k *ar, struct va_format *vaf), |
| 92 | TP_ARGS(ar, vaf) |
Kalle Valo | 5e3dd15 | 2013-06-12 20:52:10 +0300 | [diff] [blame] | 93 | ); |
| 94 | |
| 95 | TRACE_EVENT(ath10k_log_dbg, |
Michal Kazior | d35a6c1 | 2014-09-02 11:00:21 +0300 | [diff] [blame] | 96 | TP_PROTO(struct ath10k *ar, unsigned int level, struct va_format *vaf), |
| 97 | TP_ARGS(ar, level, vaf), |
Kalle Valo | 5e3dd15 | 2013-06-12 20:52:10 +0300 | [diff] [blame] | 98 | TP_STRUCT__entry( |
Michal Kazior | d35a6c1 | 2014-09-02 11:00:21 +0300 | [diff] [blame] | 99 | __string(device, dev_name(ar->dev)) |
| 100 | __string(driver, dev_driver_string(ar->dev)) |
Kalle Valo | 5e3dd15 | 2013-06-12 20:52:10 +0300 | [diff] [blame] | 101 | __field(unsigned int, level) |
| 102 | __dynamic_array(char, msg, ATH10K_MSG_MAX) |
| 103 | ), |
| 104 | TP_fast_assign( |
Michal Kazior | d35a6c1 | 2014-09-02 11:00:21 +0300 | [diff] [blame] | 105 | __assign_str(device, dev_name(ar->dev)); |
| 106 | __assign_str(driver, dev_driver_string(ar->dev)); |
Kalle Valo | 5e3dd15 | 2013-06-12 20:52:10 +0300 | [diff] [blame] | 107 | __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 Kazior | d35a6c1 | 2014-09-02 11:00:21 +0300 | [diff] [blame] | 113 | TP_printk( |
| 114 | "%s %s %s", |
| 115 | __get_str(driver), |
| 116 | __get_str(device), |
| 117 | __get_str(msg) |
| 118 | ) |
Kalle Valo | 5e3dd15 | 2013-06-12 20:52:10 +0300 | [diff] [blame] | 119 | ); |
| 120 | |
| 121 | TRACE_EVENT(ath10k_log_dbg_dump, |
Michal Kazior | d35a6c1 | 2014-09-02 11:00:21 +0300 | [diff] [blame] | 122 | TP_PROTO(struct ath10k *ar, const char *msg, const char *prefix, |
Kalle Valo | 5e3dd15 | 2013-06-12 20:52:10 +0300 | [diff] [blame] | 123 | const void *buf, size_t buf_len), |
| 124 | |
Michal Kazior | d35a6c1 | 2014-09-02 11:00:21 +0300 | [diff] [blame] | 125 | TP_ARGS(ar, msg, prefix, buf, buf_len), |
Kalle Valo | 5e3dd15 | 2013-06-12 20:52:10 +0300 | [diff] [blame] | 126 | |
| 127 | TP_STRUCT__entry( |
Michal Kazior | d35a6c1 | 2014-09-02 11:00:21 +0300 | [diff] [blame] | 128 | __string(device, dev_name(ar->dev)) |
| 129 | __string(driver, dev_driver_string(ar->dev)) |
Kalle Valo | 5e3dd15 | 2013-06-12 20:52:10 +0300 | [diff] [blame] | 130 | __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 Kazior | d35a6c1 | 2014-09-02 11:00:21 +0300 | [diff] [blame] | 137 | __assign_str(device, dev_name(ar->dev)); |
| 138 | __assign_str(driver, dev_driver_string(ar->dev)); |
Kalle Valo | 5e3dd15 | 2013-06-12 20:52:10 +0300 | [diff] [blame] | 139 | __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 Kazior | d35a6c1 | 2014-09-02 11:00:21 +0300 | [diff] [blame] | 146 | "%s %s %s/%s\n", |
| 147 | __get_str(driver), |
| 148 | __get_str(device), |
| 149 | __get_str(prefix), |
| 150 | __get_str(msg) |
Kalle Valo | 5e3dd15 | 2013-06-12 20:52:10 +0300 | [diff] [blame] | 151 | ) |
| 152 | ); |
| 153 | |
| 154 | TRACE_EVENT(ath10k_wmi_cmd, |
Michal Kazior | b22a8f4 | 2014-11-27 08:42:11 +0100 | [diff] [blame] | 155 | TP_PROTO(struct ath10k *ar, int id, const void *buf, size_t buf_len, |
| 156 | int ret), |
Kalle Valo | 5e3dd15 | 2013-06-12 20:52:10 +0300 | [diff] [blame] | 157 | |
Michal Kazior | d35a6c1 | 2014-09-02 11:00:21 +0300 | [diff] [blame] | 158 | TP_ARGS(ar, id, buf, buf_len, ret), |
Kalle Valo | 5e3dd15 | 2013-06-12 20:52:10 +0300 | [diff] [blame] | 159 | |
| 160 | TP_STRUCT__entry( |
Michal Kazior | d35a6c1 | 2014-09-02 11:00:21 +0300 | [diff] [blame] | 161 | __string(device, dev_name(ar->dev)) |
| 162 | __string(driver, dev_driver_string(ar->dev)) |
Kalle Valo | 5e3dd15 | 2013-06-12 20:52:10 +0300 | [diff] [blame] | 163 | __field(unsigned int, id) |
| 164 | __field(size_t, buf_len) |
| 165 | __dynamic_array(u8, buf, buf_len) |
Michal Kazior | 9e84f65 | 2013-09-19 09:44:09 +0200 | [diff] [blame] | 166 | __field(int, ret) |
Kalle Valo | 5e3dd15 | 2013-06-12 20:52:10 +0300 | [diff] [blame] | 167 | ), |
| 168 | |
| 169 | TP_fast_assign( |
Michal Kazior | d35a6c1 | 2014-09-02 11:00:21 +0300 | [diff] [blame] | 170 | __assign_str(device, dev_name(ar->dev)); |
| 171 | __assign_str(driver, dev_driver_string(ar->dev)); |
Kalle Valo | 5e3dd15 | 2013-06-12 20:52:10 +0300 | [diff] [blame] | 172 | __entry->id = id; |
| 173 | __entry->buf_len = buf_len; |
Michal Kazior | be8b394 | 2013-09-13 14:16:54 +0200 | [diff] [blame] | 174 | __entry->ret = ret; |
Kalle Valo | 5e3dd15 | 2013-06-12 20:52:10 +0300 | [diff] [blame] | 175 | memcpy(__get_dynamic_array(buf), buf, buf_len); |
| 176 | ), |
| 177 | |
| 178 | TP_printk( |
Michal Kazior | d35a6c1 | 2014-09-02 11:00:21 +0300 | [diff] [blame] | 179 | "%s %s id %d len %zu ret %d", |
| 180 | __get_str(driver), |
| 181 | __get_str(device), |
Kalle Valo | 5e3dd15 | 2013-06-12 20:52:10 +0300 | [diff] [blame] | 182 | __entry->id, |
Michal Kazior | be8b394 | 2013-09-13 14:16:54 +0200 | [diff] [blame] | 183 | __entry->buf_len, |
| 184 | __entry->ret |
Kalle Valo | 5e3dd15 | 2013-06-12 20:52:10 +0300 | [diff] [blame] | 185 | ) |
| 186 | ); |
| 187 | |
| 188 | TRACE_EVENT(ath10k_wmi_event, |
Michal Kazior | b22a8f4 | 2014-11-27 08:42:11 +0100 | [diff] [blame] | 189 | TP_PROTO(struct ath10k *ar, int id, const void *buf, size_t buf_len), |
Kalle Valo | 5e3dd15 | 2013-06-12 20:52:10 +0300 | [diff] [blame] | 190 | |
Michal Kazior | d35a6c1 | 2014-09-02 11:00:21 +0300 | [diff] [blame] | 191 | TP_ARGS(ar, id, buf, buf_len), |
Kalle Valo | 5e3dd15 | 2013-06-12 20:52:10 +0300 | [diff] [blame] | 192 | |
| 193 | TP_STRUCT__entry( |
Michal Kazior | d35a6c1 | 2014-09-02 11:00:21 +0300 | [diff] [blame] | 194 | __string(device, dev_name(ar->dev)) |
| 195 | __string(driver, dev_driver_string(ar->dev)) |
Kalle Valo | 5e3dd15 | 2013-06-12 20:52:10 +0300 | [diff] [blame] | 196 | __field(unsigned int, id) |
| 197 | __field(size_t, buf_len) |
| 198 | __dynamic_array(u8, buf, buf_len) |
| 199 | ), |
| 200 | |
| 201 | TP_fast_assign( |
Michal Kazior | d35a6c1 | 2014-09-02 11:00:21 +0300 | [diff] [blame] | 202 | __assign_str(device, dev_name(ar->dev)); |
| 203 | __assign_str(driver, dev_driver_string(ar->dev)); |
Kalle Valo | 5e3dd15 | 2013-06-12 20:52:10 +0300 | [diff] [blame] | 204 | __entry->id = id; |
| 205 | __entry->buf_len = buf_len; |
| 206 | memcpy(__get_dynamic_array(buf), buf, buf_len); |
| 207 | ), |
| 208 | |
| 209 | TP_printk( |
Michal Kazior | d35a6c1 | 2014-09-02 11:00:21 +0300 | [diff] [blame] | 210 | "%s %s id %d len %zu", |
| 211 | __get_str(driver), |
| 212 | __get_str(device), |
Kalle Valo | 5e3dd15 | 2013-06-12 20:52:10 +0300 | [diff] [blame] | 213 | __entry->id, |
| 214 | __entry->buf_len |
| 215 | ) |
| 216 | ); |
| 217 | |
Kalle Valo | a9bf050 | 2013-09-03 11:43:55 +0300 | [diff] [blame] | 218 | TRACE_EVENT(ath10k_htt_stats, |
Michal Kazior | b22a8f4 | 2014-11-27 08:42:11 +0100 | [diff] [blame] | 219 | TP_PROTO(struct ath10k *ar, const void *buf, size_t buf_len), |
Kalle Valo | a9bf050 | 2013-09-03 11:43:55 +0300 | [diff] [blame] | 220 | |
Michal Kazior | d35a6c1 | 2014-09-02 11:00:21 +0300 | [diff] [blame] | 221 | TP_ARGS(ar, buf, buf_len), |
Kalle Valo | a9bf050 | 2013-09-03 11:43:55 +0300 | [diff] [blame] | 222 | |
| 223 | TP_STRUCT__entry( |
Michal Kazior | d35a6c1 | 2014-09-02 11:00:21 +0300 | [diff] [blame] | 224 | __string(device, dev_name(ar->dev)) |
| 225 | __string(driver, dev_driver_string(ar->dev)) |
Kalle Valo | a9bf050 | 2013-09-03 11:43:55 +0300 | [diff] [blame] | 226 | __field(size_t, buf_len) |
| 227 | __dynamic_array(u8, buf, buf_len) |
| 228 | ), |
| 229 | |
| 230 | TP_fast_assign( |
Michal Kazior | d35a6c1 | 2014-09-02 11:00:21 +0300 | [diff] [blame] | 231 | __assign_str(device, dev_name(ar->dev)); |
| 232 | __assign_str(driver, dev_driver_string(ar->dev)); |
Kalle Valo | a9bf050 | 2013-09-03 11:43:55 +0300 | [diff] [blame] | 233 | __entry->buf_len = buf_len; |
| 234 | memcpy(__get_dynamic_array(buf), buf, buf_len); |
| 235 | ), |
| 236 | |
| 237 | TP_printk( |
Michal Kazior | d35a6c1 | 2014-09-02 11:00:21 +0300 | [diff] [blame] | 238 | "%s %s len %zu", |
| 239 | __get_str(driver), |
| 240 | __get_str(device), |
Kalle Valo | a9bf050 | 2013-09-03 11:43:55 +0300 | [diff] [blame] | 241 | __entry->buf_len |
| 242 | ) |
| 243 | ); |
| 244 | |
Kalle Valo | 869526b | 2014-01-03 12:59:26 +0200 | [diff] [blame] | 245 | TRACE_EVENT(ath10k_wmi_dbglog, |
Michal Kazior | b22a8f4 | 2014-11-27 08:42:11 +0100 | [diff] [blame] | 246 | TP_PROTO(struct ath10k *ar, const void *buf, size_t buf_len), |
Kalle Valo | 869526b | 2014-01-03 12:59:26 +0200 | [diff] [blame] | 247 | |
Michal Kazior | d35a6c1 | 2014-09-02 11:00:21 +0300 | [diff] [blame] | 248 | TP_ARGS(ar, buf, buf_len), |
Kalle Valo | 869526b | 2014-01-03 12:59:26 +0200 | [diff] [blame] | 249 | |
| 250 | TP_STRUCT__entry( |
Michal Kazior | d35a6c1 | 2014-09-02 11:00:21 +0300 | [diff] [blame] | 251 | __string(device, dev_name(ar->dev)) |
| 252 | __string(driver, dev_driver_string(ar->dev)) |
Ashok Raj Nagarajan | 1835374 | 2016-02-05 21:12:49 +0530 | [diff] [blame] | 253 | __field(u8, hw_type); |
Kalle Valo | 869526b | 2014-01-03 12:59:26 +0200 | [diff] [blame] | 254 | __field(size_t, buf_len) |
| 255 | __dynamic_array(u8, buf, buf_len) |
| 256 | ), |
| 257 | |
| 258 | TP_fast_assign( |
Michal Kazior | d35a6c1 | 2014-09-02 11:00:21 +0300 | [diff] [blame] | 259 | __assign_str(device, dev_name(ar->dev)); |
| 260 | __assign_str(driver, dev_driver_string(ar->dev)); |
Ashok Raj Nagarajan | 1835374 | 2016-02-05 21:12:49 +0530 | [diff] [blame] | 261 | __entry->hw_type = ar->hw_rev; |
Kalle Valo | 869526b | 2014-01-03 12:59:26 +0200 | [diff] [blame] | 262 | __entry->buf_len = buf_len; |
| 263 | memcpy(__get_dynamic_array(buf), buf, buf_len); |
| 264 | ), |
| 265 | |
| 266 | TP_printk( |
Ashok Raj Nagarajan | 1835374 | 2016-02-05 21:12:49 +0530 | [diff] [blame] | 267 | "%s %s %d len %zu", |
Michal Kazior | d35a6c1 | 2014-09-02 11:00:21 +0300 | [diff] [blame] | 268 | __get_str(driver), |
| 269 | __get_str(device), |
Ashok Raj Nagarajan | 1835374 | 2016-02-05 21:12:49 +0530 | [diff] [blame] | 270 | __entry->hw_type, |
Kalle Valo | 869526b | 2014-01-03 12:59:26 +0200 | [diff] [blame] | 271 | __entry->buf_len |
| 272 | ) |
| 273 | ); |
| 274 | |
Rajkumar Manoharan | bfdd793 | 2014-10-03 08:02:40 +0300 | [diff] [blame] | 275 | TRACE_EVENT(ath10k_htt_pktlog, |
Michal Kazior | b22a8f4 | 2014-11-27 08:42:11 +0100 | [diff] [blame] | 276 | TP_PROTO(struct ath10k *ar, const void *buf, u16 buf_len), |
Rajkumar Manoharan | bfdd793 | 2014-10-03 08:02:40 +0300 | [diff] [blame] | 277 | |
| 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 Nagarajan | 1835374 | 2016-02-05 21:12:49 +0530 | [diff] [blame] | 283 | __field(u8, hw_type); |
Rajkumar Manoharan | bfdd793 | 2014-10-03 08:02:40 +0300 | [diff] [blame] | 284 | __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 Nagarajan | 1835374 | 2016-02-05 21:12:49 +0530 | [diff] [blame] | 291 | __entry->hw_type = ar->hw_rev; |
Rajkumar Manoharan | bfdd793 | 2014-10-03 08:02:40 +0300 | [diff] [blame] | 292 | __entry->buf_len = buf_len; |
| 293 | memcpy(__get_dynamic_array(pktlog), buf, buf_len); |
| 294 | ), |
| 295 | |
| 296 | TP_printk( |
Ashok Raj Nagarajan | 1835374 | 2016-02-05 21:12:49 +0530 | [diff] [blame] | 297 | "%s %s %d size %hu", |
Rajkumar Manoharan | bfdd793 | 2014-10-03 08:02:40 +0300 | [diff] [blame] | 298 | __get_str(driver), |
| 299 | __get_str(device), |
Ashok Raj Nagarajan | 1835374 | 2016-02-05 21:12:49 +0530 | [diff] [blame] | 300 | __entry->hw_type, |
Rajkumar Manoharan | bfdd793 | 2014-10-03 08:02:40 +0300 | [diff] [blame] | 301 | __entry->buf_len |
| 302 | ) |
| 303 | ); |
| 304 | |
Rajkumar Manoharan | d1e50f4 | 2014-10-03 08:02:54 +0300 | [diff] [blame] | 305 | TRACE_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 | |
| 340 | TRACE_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 Manoharan | 9b57f88 | 2014-10-06 22:39:06 +0530 | [diff] [blame] | 364 | |
Rajkumar Manoharan | 5ce8e7f | 2014-11-05 19:14:31 +0530 | [diff] [blame] | 365 | DECLARE_EVENT_CLASS(ath10k_hdr_event, |
Michal Kazior | b22a8f4 | 2014-11-27 08:42:11 +0100 | [diff] [blame] | 366 | TP_PROTO(struct ath10k *ar, const void *data, size_t len), |
Rajkumar Manoharan | 9b57f88 | 2014-10-06 22:39:06 +0530 | [diff] [blame] | 367 | |
| 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 Kazior | 36d8230 | 2015-04-10 13:02:28 +0000 | [diff] [blame] | 374 | __dynamic_array(u8, data, ath10k_frm_hdr_len(data, len)) |
Rajkumar Manoharan | 9b57f88 | 2014-10-06 22:39:06 +0530 | [diff] [blame] | 375 | ), |
| 376 | |
| 377 | TP_fast_assign( |
| 378 | __assign_str(device, dev_name(ar->dev)); |
| 379 | __assign_str(driver, dev_driver_string(ar->dev)); |
Michal Kazior | 36d8230 | 2015-04-10 13:02:28 +0000 | [diff] [blame] | 380 | __entry->len = ath10k_frm_hdr_len(data, len); |
Rajkumar Manoharan | 5ce8e7f | 2014-11-05 19:14:31 +0530 | [diff] [blame] | 381 | memcpy(__get_dynamic_array(data), data, __entry->len); |
Rajkumar Manoharan | 9b57f88 | 2014-10-06 22:39:06 +0530 | [diff] [blame] | 382 | ), |
| 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 Manoharan | 5ce8e7f | 2014-11-05 19:14:31 +0530 | [diff] [blame] | 392 | DECLARE_EVENT_CLASS(ath10k_payload_event, |
Michal Kazior | b22a8f4 | 2014-11-27 08:42:11 +0100 | [diff] [blame] | 393 | TP_PROTO(struct ath10k *ar, const void *data, size_t len), |
Rajkumar Manoharan | 5ce8e7f | 2014-11-05 19:14:31 +0530 | [diff] [blame] | 394 | |
| 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 Kazior | 36d8230 | 2015-04-10 13:02:28 +0000 | [diff] [blame] | 401 | __dynamic_array(u8, payload, (len - |
| 402 | ath10k_frm_hdr_len(data, len))) |
Rajkumar Manoharan | 5ce8e7f | 2014-11-05 19:14:31 +0530 | [diff] [blame] | 403 | ), |
| 404 | |
| 405 | TP_fast_assign( |
| 406 | __assign_str(device, dev_name(ar->dev)); |
| 407 | __assign_str(driver, dev_driver_string(ar->dev)); |
Michal Kazior | 36d8230 | 2015-04-10 13:02:28 +0000 | [diff] [blame] | 408 | __entry->len = len - ath10k_frm_hdr_len(data, len); |
Rajkumar Manoharan | 5ce8e7f | 2014-11-05 19:14:31 +0530 | [diff] [blame] | 409 | memcpy(__get_dynamic_array(payload), |
Michal Kazior | 36d8230 | 2015-04-10 13:02:28 +0000 | [diff] [blame] | 410 | data + ath10k_frm_hdr_len(data, len), __entry->len); |
Rajkumar Manoharan | 5ce8e7f | 2014-11-05 19:14:31 +0530 | [diff] [blame] | 411 | ), |
| 412 | |
| 413 | TP_printk( |
| 414 | "%s %s len %zu\n", |
| 415 | __get_str(driver), |
| 416 | __get_str(device), |
| 417 | __entry->len |
| 418 | ) |
| 419 | ); |
| 420 | |
| 421 | DEFINE_EVENT(ath10k_hdr_event, ath10k_tx_hdr, |
Michal Kazior | b22a8f4 | 2014-11-27 08:42:11 +0100 | [diff] [blame] | 422 | TP_PROTO(struct ath10k *ar, const void *data, size_t len), |
Rajkumar Manoharan | 9b57f88 | 2014-10-06 22:39:06 +0530 | [diff] [blame] | 423 | TP_ARGS(ar, data, len) |
| 424 | ); |
| 425 | |
Rajkumar Manoharan | 5ce8e7f | 2014-11-05 19:14:31 +0530 | [diff] [blame] | 426 | DEFINE_EVENT(ath10k_payload_event, ath10k_tx_payload, |
Michal Kazior | b22a8f4 | 2014-11-27 08:42:11 +0100 | [diff] [blame] | 427 | TP_PROTO(struct ath10k *ar, const void *data, size_t len), |
Rajkumar Manoharan | 9b57f88 | 2014-10-06 22:39:06 +0530 | [diff] [blame] | 428 | TP_ARGS(ar, data, len) |
| 429 | ); |
| 430 | |
Rajkumar Manoharan | 5ce8e7f | 2014-11-05 19:14:31 +0530 | [diff] [blame] | 431 | DEFINE_EVENT(ath10k_hdr_event, ath10k_rx_hdr, |
Michal Kazior | b22a8f4 | 2014-11-27 08:42:11 +0100 | [diff] [blame] | 432 | TP_PROTO(struct ath10k *ar, const void *data, size_t len), |
Rajkumar Manoharan | 9b57f88 | 2014-10-06 22:39:06 +0530 | [diff] [blame] | 433 | TP_ARGS(ar, data, len) |
| 434 | ); |
| 435 | |
Rajkumar Manoharan | 5ce8e7f | 2014-11-05 19:14:31 +0530 | [diff] [blame] | 436 | DEFINE_EVENT(ath10k_payload_event, ath10k_rx_payload, |
Michal Kazior | b22a8f4 | 2014-11-27 08:42:11 +0100 | [diff] [blame] | 437 | TP_PROTO(struct ath10k *ar, const void *data, size_t len), |
Rajkumar Manoharan | 9b57f88 | 2014-10-06 22:39:06 +0530 | [diff] [blame] | 438 | TP_ARGS(ar, data, len) |
| 439 | ); |
Michal Kazior | a5d85f6 | 2014-10-23 17:04:28 +0300 | [diff] [blame] | 440 | |
Rajkumar Manoharan | 5ce8e7f | 2014-11-05 19:14:31 +0530 | [diff] [blame] | 441 | TRACE_EVENT(ath10k_htt_rx_desc, |
Michal Kazior | b22a8f4 | 2014-11-27 08:42:11 +0100 | [diff] [blame] | 442 | TP_PROTO(struct ath10k *ar, const void *data, size_t len), |
Rajkumar Manoharan | 5ce8e7f | 2014-11-05 19:14:31 +0530 | [diff] [blame] | 443 | |
| 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 Nagarajan | 1835374 | 2016-02-05 21:12:49 +0530 | [diff] [blame] | 449 | __field(u8, hw_type); |
Rajkumar Manoharan | 5ce8e7f | 2014-11-05 19:14:31 +0530 | [diff] [blame] | 450 | __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 Nagarajan | 1835374 | 2016-02-05 21:12:49 +0530 | [diff] [blame] | 457 | __entry->hw_type = ar->hw_rev; |
Rajkumar Manoharan | 5ce8e7f | 2014-11-05 19:14:31 +0530 | [diff] [blame] | 458 | __entry->len = len; |
| 459 | memcpy(__get_dynamic_array(rxdesc), data, len); |
| 460 | ), |
| 461 | |
| 462 | TP_printk( |
Ashok Raj Nagarajan | 1835374 | 2016-02-05 21:12:49 +0530 | [diff] [blame] | 463 | "%s %s %d rxdesc len %d", |
Rajkumar Manoharan | 5ce8e7f | 2014-11-05 19:14:31 +0530 | [diff] [blame] | 464 | __get_str(driver), |
| 465 | __get_str(device), |
Ashok Raj Nagarajan | 1835374 | 2016-02-05 21:12:49 +0530 | [diff] [blame] | 466 | __entry->hw_type, |
Rajkumar Manoharan | 5ce8e7f | 2014-11-05 19:14:31 +0530 | [diff] [blame] | 467 | __entry->len |
| 468 | ) |
Michal Kazior | a5d85f6 | 2014-10-23 17:04:28 +0300 | [diff] [blame] | 469 | ); |
Rajkumar Manoharan | 5ce8e7f | 2014-11-05 19:14:31 +0530 | [diff] [blame] | 470 | |
Michal Kazior | 04de6c6 | 2015-01-24 12:14:47 +0200 | [diff] [blame] | 471 | TRACE_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 Kazior | c3113c3 | 2015-01-24 12:14:47 +0200 | [diff] [blame] | 512 | TRACE_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 Valo | 5e3dd15 | 2013-06-12 20:52:10 +0300 | [diff] [blame] | 539 | #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> |