Reinette Chatre | bb5d2db | 2010-01-15 13:42:59 -0800 | [diff] [blame] | 1 | /****************************************************************************** |
| 2 | * |
Wey-Yi Guy | fb4961d | 2012-01-06 13:16:33 -0800 | [diff] [blame] | 3 | * Copyright(c) 2009 - 2012 Intel Corporation. All rights reserved. |
Reinette Chatre | bb5d2db | 2010-01-15 13:42:59 -0800 | [diff] [blame] | 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify it |
| 6 | * under the terms of version 2 of the GNU General Public License as |
| 7 | * published by the Free Software Foundation. |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, but WITHOUT |
| 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
| 12 | * more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License along with |
| 15 | * this program; if not, write to the Free Software Foundation, Inc., |
| 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA |
| 17 | * |
| 18 | * The full GNU General Public License is included in this distribution in the |
| 19 | * file called LICENSE. |
| 20 | * |
| 21 | * Contact Information: |
| 22 | * Intel Linux Wireless <ilw@linux.intel.com> |
| 23 | * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 |
| 24 | * |
| 25 | *****************************************************************************/ |
| 26 | |
Johannes Berg | be1a71a | 2009-10-02 13:44:02 -0700 | [diff] [blame] | 27 | #if !defined(__IWLWIFI_DEVICE_TRACE) || defined(TRACE_HEADER_MULTI_READ) |
| 28 | #define __IWLWIFI_DEVICE_TRACE |
| 29 | |
| 30 | #include <linux/tracepoint.h> |
Johannes Berg | be1a71a | 2009-10-02 13:44:02 -0700 | [diff] [blame] | 31 | |
Emmanuel Grumbach | 83ed901 | 2011-08-25 23:11:14 -0700 | [diff] [blame] | 32 | |
Johannes Berg | be1a71a | 2009-10-02 13:44:02 -0700 | [diff] [blame] | 33 | #if !defined(CONFIG_IWLWIFI_DEVICE_TRACING) || defined(__CHECKER__) |
| 34 | #undef TRACE_EVENT |
| 35 | #define TRACE_EVENT(name, proto, ...) \ |
| 36 | static inline void trace_ ## name(proto) {} |
Johannes Berg | 2655e31 | 2012-01-31 21:08:37 -0800 | [diff] [blame] | 37 | #undef DECLARE_EVENT_CLASS |
| 38 | #define DECLARE_EVENT_CLASS(...) |
| 39 | #undef DEFINE_EVENT |
| 40 | #define DEFINE_EVENT(evt_class, name, proto, ...) \ |
| 41 | static inline void trace_ ## name(proto) {} |
Johannes Berg | be1a71a | 2009-10-02 13:44:02 -0700 | [diff] [blame] | 42 | #endif |
| 43 | |
Johannes Berg | 6c1011e | 2012-03-06 13:30:48 -0800 | [diff] [blame] | 44 | #define DEV_ENTRY __string(dev, dev_name(dev)) |
| 45 | #define DEV_ASSIGN __assign_str(dev, dev_name(dev)) |
Johannes Berg | be1a71a | 2009-10-02 13:44:02 -0700 | [diff] [blame] | 46 | |
| 47 | #undef TRACE_SYSTEM |
Johannes Berg | 0fd95af | 2009-11-20 12:05:02 -0800 | [diff] [blame] | 48 | #define TRACE_SYSTEM iwlwifi_io |
Johannes Berg | be1a71a | 2009-10-02 13:44:02 -0700 | [diff] [blame] | 49 | |
| 50 | TRACE_EVENT(iwlwifi_dev_ioread32, |
Johannes Berg | 6c1011e | 2012-03-06 13:30:48 -0800 | [diff] [blame] | 51 | TP_PROTO(const struct device *dev, u32 offs, u32 val), |
| 52 | TP_ARGS(dev, offs, val), |
Johannes Berg | be1a71a | 2009-10-02 13:44:02 -0700 | [diff] [blame] | 53 | TP_STRUCT__entry( |
Johannes Berg | 6c1011e | 2012-03-06 13:30:48 -0800 | [diff] [blame] | 54 | DEV_ENTRY |
Johannes Berg | be1a71a | 2009-10-02 13:44:02 -0700 | [diff] [blame] | 55 | __field(u32, offs) |
| 56 | __field(u32, val) |
| 57 | ), |
| 58 | TP_fast_assign( |
Johannes Berg | 6c1011e | 2012-03-06 13:30:48 -0800 | [diff] [blame] | 59 | DEV_ASSIGN; |
Johannes Berg | be1a71a | 2009-10-02 13:44:02 -0700 | [diff] [blame] | 60 | __entry->offs = offs; |
| 61 | __entry->val = val; |
| 62 | ), |
Johannes Berg | 6c1011e | 2012-03-06 13:30:48 -0800 | [diff] [blame] | 63 | TP_printk("[%s] read io[%#x] = %#x", |
| 64 | __get_str(dev), __entry->offs, __entry->val) |
Johannes Berg | be1a71a | 2009-10-02 13:44:02 -0700 | [diff] [blame] | 65 | ); |
| 66 | |
Ben Cahill | 4e03185 | 2009-11-20 12:04:52 -0800 | [diff] [blame] | 67 | TRACE_EVENT(iwlwifi_dev_iowrite8, |
Johannes Berg | 6c1011e | 2012-03-06 13:30:48 -0800 | [diff] [blame] | 68 | TP_PROTO(const struct device *dev, u32 offs, u8 val), |
| 69 | TP_ARGS(dev, offs, val), |
Ben Cahill | 4e03185 | 2009-11-20 12:04:52 -0800 | [diff] [blame] | 70 | TP_STRUCT__entry( |
Johannes Berg | 6c1011e | 2012-03-06 13:30:48 -0800 | [diff] [blame] | 71 | DEV_ENTRY |
Ben Cahill | 4e03185 | 2009-11-20 12:04:52 -0800 | [diff] [blame] | 72 | __field(u32, offs) |
| 73 | __field(u8, val) |
| 74 | ), |
| 75 | TP_fast_assign( |
Johannes Berg | 6c1011e | 2012-03-06 13:30:48 -0800 | [diff] [blame] | 76 | DEV_ASSIGN; |
Ben Cahill | 4e03185 | 2009-11-20 12:04:52 -0800 | [diff] [blame] | 77 | __entry->offs = offs; |
| 78 | __entry->val = val; |
| 79 | ), |
Johannes Berg | 6c1011e | 2012-03-06 13:30:48 -0800 | [diff] [blame] | 80 | TP_printk("[%s] write io[%#x] = %#x)", |
| 81 | __get_str(dev), __entry->offs, __entry->val) |
Ben Cahill | 4e03185 | 2009-11-20 12:04:52 -0800 | [diff] [blame] | 82 | ); |
| 83 | |
Johannes Berg | be1a71a | 2009-10-02 13:44:02 -0700 | [diff] [blame] | 84 | TRACE_EVENT(iwlwifi_dev_iowrite32, |
Johannes Berg | 6c1011e | 2012-03-06 13:30:48 -0800 | [diff] [blame] | 85 | TP_PROTO(const struct device *dev, u32 offs, u32 val), |
| 86 | TP_ARGS(dev, offs, val), |
Johannes Berg | be1a71a | 2009-10-02 13:44:02 -0700 | [diff] [blame] | 87 | TP_STRUCT__entry( |
Johannes Berg | 6c1011e | 2012-03-06 13:30:48 -0800 | [diff] [blame] | 88 | DEV_ENTRY |
Johannes Berg | be1a71a | 2009-10-02 13:44:02 -0700 | [diff] [blame] | 89 | __field(u32, offs) |
| 90 | __field(u32, val) |
| 91 | ), |
| 92 | TP_fast_assign( |
Johannes Berg | 6c1011e | 2012-03-06 13:30:48 -0800 | [diff] [blame] | 93 | DEV_ASSIGN; |
Johannes Berg | be1a71a | 2009-10-02 13:44:02 -0700 | [diff] [blame] | 94 | __entry->offs = offs; |
| 95 | __entry->val = val; |
| 96 | ), |
Johannes Berg | 6c1011e | 2012-03-06 13:30:48 -0800 | [diff] [blame] | 97 | TP_printk("[%s] write io[%#x] = %#x)", |
| 98 | __get_str(dev), __entry->offs, __entry->val) |
Johannes Berg | be1a71a | 2009-10-02 13:44:02 -0700 | [diff] [blame] | 99 | ); |
| 100 | |
Johannes Berg | b80667e | 2011-12-09 07:26:13 -0800 | [diff] [blame] | 101 | TRACE_EVENT(iwlwifi_dev_irq, |
Johannes Berg | 6c1011e | 2012-03-06 13:30:48 -0800 | [diff] [blame] | 102 | TP_PROTO(const struct device *dev), |
| 103 | TP_ARGS(dev), |
Johannes Berg | b80667e | 2011-12-09 07:26:13 -0800 | [diff] [blame] | 104 | TP_STRUCT__entry( |
Johannes Berg | 6c1011e | 2012-03-06 13:30:48 -0800 | [diff] [blame] | 105 | DEV_ENTRY |
Johannes Berg | b80667e | 2011-12-09 07:26:13 -0800 | [diff] [blame] | 106 | ), |
| 107 | TP_fast_assign( |
Johannes Berg | 6c1011e | 2012-03-06 13:30:48 -0800 | [diff] [blame] | 108 | DEV_ASSIGN; |
Johannes Berg | b80667e | 2011-12-09 07:26:13 -0800 | [diff] [blame] | 109 | ), |
| 110 | /* TP_printk("") doesn't compile */ |
| 111 | TP_printk("%d", 0) |
| 112 | ); |
| 113 | |
| 114 | TRACE_EVENT(iwlwifi_dev_ict_read, |
Johannes Berg | 6c1011e | 2012-03-06 13:30:48 -0800 | [diff] [blame] | 115 | TP_PROTO(const struct device *dev, u32 index, u32 value), |
| 116 | TP_ARGS(dev, index, value), |
Johannes Berg | b80667e | 2011-12-09 07:26:13 -0800 | [diff] [blame] | 117 | TP_STRUCT__entry( |
Johannes Berg | 6c1011e | 2012-03-06 13:30:48 -0800 | [diff] [blame] | 118 | DEV_ENTRY |
Johannes Berg | b80667e | 2011-12-09 07:26:13 -0800 | [diff] [blame] | 119 | __field(u32, index) |
| 120 | __field(u32, value) |
| 121 | ), |
| 122 | TP_fast_assign( |
Johannes Berg | 6c1011e | 2012-03-06 13:30:48 -0800 | [diff] [blame] | 123 | DEV_ASSIGN; |
Johannes Berg | b80667e | 2011-12-09 07:26:13 -0800 | [diff] [blame] | 124 | __entry->index = index; |
| 125 | __entry->value = value; |
| 126 | ), |
Johannes Berg | 6c1011e | 2012-03-06 13:30:48 -0800 | [diff] [blame] | 127 | TP_printk("[%s] read ict[%d] = %#.8x", |
| 128 | __get_str(dev), __entry->index, __entry->value) |
Johannes Berg | b80667e | 2011-12-09 07:26:13 -0800 | [diff] [blame] | 129 | ); |
| 130 | |
Johannes Berg | 0fd95af | 2009-11-20 12:05:02 -0800 | [diff] [blame] | 131 | #undef TRACE_SYSTEM |
Wey-Yi Guy | a9e1cb6 | 2009-12-10 14:37:26 -0800 | [diff] [blame] | 132 | #define TRACE_SYSTEM iwlwifi_ucode |
| 133 | |
| 134 | TRACE_EVENT(iwlwifi_dev_ucode_cont_event, |
Johannes Berg | 6c1011e | 2012-03-06 13:30:48 -0800 | [diff] [blame] | 135 | TP_PROTO(const struct device *dev, u32 time, u32 data, u32 ev), |
| 136 | TP_ARGS(dev, time, data, ev), |
Wey-Yi Guy | a9e1cb6 | 2009-12-10 14:37:26 -0800 | [diff] [blame] | 137 | TP_STRUCT__entry( |
Johannes Berg | 6c1011e | 2012-03-06 13:30:48 -0800 | [diff] [blame] | 138 | DEV_ENTRY |
Wey-Yi Guy | a9e1cb6 | 2009-12-10 14:37:26 -0800 | [diff] [blame] | 139 | |
| 140 | __field(u32, time) |
| 141 | __field(u32, data) |
| 142 | __field(u32, ev) |
| 143 | ), |
| 144 | TP_fast_assign( |
Johannes Berg | 6c1011e | 2012-03-06 13:30:48 -0800 | [diff] [blame] | 145 | DEV_ASSIGN; |
Wey-Yi Guy | a9e1cb6 | 2009-12-10 14:37:26 -0800 | [diff] [blame] | 146 | __entry->time = time; |
| 147 | __entry->data = data; |
| 148 | __entry->ev = ev; |
| 149 | ), |
Johannes Berg | 6c1011e | 2012-03-06 13:30:48 -0800 | [diff] [blame] | 150 | TP_printk("[%s] EVT_LOGT:%010u:0x%08x:%04u", |
| 151 | __get_str(dev), __entry->time, __entry->data, __entry->ev) |
Wey-Yi Guy | a9e1cb6 | 2009-12-10 14:37:26 -0800 | [diff] [blame] | 152 | ); |
| 153 | |
| 154 | TRACE_EVENT(iwlwifi_dev_ucode_wrap_event, |
Johannes Berg | 6c1011e | 2012-03-06 13:30:48 -0800 | [diff] [blame] | 155 | TP_PROTO(const struct device *dev, u32 wraps, u32 n_entry, u32 p_entry), |
| 156 | TP_ARGS(dev, wraps, n_entry, p_entry), |
Wey-Yi Guy | a9e1cb6 | 2009-12-10 14:37:26 -0800 | [diff] [blame] | 157 | TP_STRUCT__entry( |
Johannes Berg | 6c1011e | 2012-03-06 13:30:48 -0800 | [diff] [blame] | 158 | DEV_ENTRY |
Wey-Yi Guy | a9e1cb6 | 2009-12-10 14:37:26 -0800 | [diff] [blame] | 159 | |
| 160 | __field(u32, wraps) |
| 161 | __field(u32, n_entry) |
| 162 | __field(u32, p_entry) |
| 163 | ), |
| 164 | TP_fast_assign( |
Johannes Berg | 6c1011e | 2012-03-06 13:30:48 -0800 | [diff] [blame] | 165 | DEV_ASSIGN; |
Wey-Yi Guy | a9e1cb6 | 2009-12-10 14:37:26 -0800 | [diff] [blame] | 166 | __entry->wraps = wraps; |
| 167 | __entry->n_entry = n_entry; |
| 168 | __entry->p_entry = p_entry; |
| 169 | ), |
Johannes Berg | 6c1011e | 2012-03-06 13:30:48 -0800 | [diff] [blame] | 170 | TP_printk("[%s] wraps=#%02d n=0x%X p=0x%X", |
| 171 | __get_str(dev), __entry->wraps, __entry->n_entry, |
Wey-Yi Guy | a9e1cb6 | 2009-12-10 14:37:26 -0800 | [diff] [blame] | 172 | __entry->p_entry) |
| 173 | ); |
| 174 | |
| 175 | #undef TRACE_SYSTEM |
Johannes Berg | 2655e31 | 2012-01-31 21:08:37 -0800 | [diff] [blame] | 176 | #define TRACE_SYSTEM iwlwifi_msg |
| 177 | |
| 178 | #define MAX_MSG_LEN 100 |
| 179 | |
| 180 | DECLARE_EVENT_CLASS(iwlwifi_msg_event, |
| 181 | TP_PROTO(struct va_format *vaf), |
| 182 | TP_ARGS(vaf), |
| 183 | TP_STRUCT__entry( |
| 184 | __dynamic_array(char, msg, MAX_MSG_LEN) |
| 185 | ), |
| 186 | TP_fast_assign( |
| 187 | WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg), |
| 188 | MAX_MSG_LEN, vaf->fmt, |
| 189 | *vaf->va) >= MAX_MSG_LEN); |
| 190 | ), |
| 191 | TP_printk("%s", (char *)__get_dynamic_array(msg)) |
| 192 | ); |
| 193 | |
| 194 | DEFINE_EVENT(iwlwifi_msg_event, iwlwifi_err, |
| 195 | TP_PROTO(struct va_format *vaf), |
| 196 | TP_ARGS(vaf) |
| 197 | ); |
| 198 | |
| 199 | DEFINE_EVENT(iwlwifi_msg_event, iwlwifi_warn, |
| 200 | TP_PROTO(struct va_format *vaf), |
| 201 | TP_ARGS(vaf) |
| 202 | ); |
| 203 | |
| 204 | DEFINE_EVENT(iwlwifi_msg_event, iwlwifi_info, |
| 205 | TP_PROTO(struct va_format *vaf), |
| 206 | TP_ARGS(vaf) |
| 207 | ); |
| 208 | |
| 209 | DEFINE_EVENT(iwlwifi_msg_event, iwlwifi_crit, |
| 210 | TP_PROTO(struct va_format *vaf), |
| 211 | TP_ARGS(vaf) |
| 212 | ); |
| 213 | |
| 214 | TRACE_EVENT(iwlwifi_dbg, |
| 215 | TP_PROTO(u32 level, bool in_interrupt, const char *function, |
| 216 | struct va_format *vaf), |
| 217 | TP_ARGS(level, in_interrupt, function, vaf), |
| 218 | TP_STRUCT__entry( |
| 219 | __field(u32, level) |
| 220 | __field(u8, in_interrupt) |
| 221 | __string(function, function) |
| 222 | __dynamic_array(char, msg, MAX_MSG_LEN) |
| 223 | ), |
| 224 | TP_fast_assign( |
| 225 | __entry->level = level; |
| 226 | __entry->in_interrupt = in_interrupt; |
| 227 | __assign_str(function, function); |
| 228 | WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg), |
| 229 | MAX_MSG_LEN, vaf->fmt, |
| 230 | *vaf->va) >= MAX_MSG_LEN); |
| 231 | ), |
| 232 | TP_printk("%s", (char *)__get_dynamic_array(msg)) |
| 233 | ); |
| 234 | |
| 235 | #undef TRACE_SYSTEM |
Johannes Berg | 0fd95af | 2009-11-20 12:05:02 -0800 | [diff] [blame] | 236 | #define TRACE_SYSTEM iwlwifi |
| 237 | |
Johannes Berg | be1a71a | 2009-10-02 13:44:02 -0700 | [diff] [blame] | 238 | TRACE_EVENT(iwlwifi_dev_hcmd, |
Johannes Berg | 6c1011e | 2012-03-06 13:30:48 -0800 | [diff] [blame] | 239 | TP_PROTO(const struct device *dev, u32 flags, |
Johannes Berg | 4ce7cc2 | 2011-05-13 11:57:40 -0700 | [diff] [blame] | 240 | const void *hcmd0, size_t len0, |
| 241 | const void *hcmd1, size_t len1, |
| 242 | const void *hcmd2, size_t len2), |
Johannes Berg | 6c1011e | 2012-03-06 13:30:48 -0800 | [diff] [blame] | 243 | TP_ARGS(dev, flags, hcmd0, len0, hcmd1, len1, hcmd2, len2), |
Johannes Berg | be1a71a | 2009-10-02 13:44:02 -0700 | [diff] [blame] | 244 | TP_STRUCT__entry( |
Johannes Berg | 6c1011e | 2012-03-06 13:30:48 -0800 | [diff] [blame] | 245 | DEV_ENTRY |
Johannes Berg | 4ce7cc2 | 2011-05-13 11:57:40 -0700 | [diff] [blame] | 246 | __dynamic_array(u8, hcmd0, len0) |
| 247 | __dynamic_array(u8, hcmd1, len1) |
| 248 | __dynamic_array(u8, hcmd2, len2) |
Johannes Berg | be1a71a | 2009-10-02 13:44:02 -0700 | [diff] [blame] | 249 | __field(u32, flags) |
| 250 | ), |
| 251 | TP_fast_assign( |
Johannes Berg | 6c1011e | 2012-03-06 13:30:48 -0800 | [diff] [blame] | 252 | DEV_ASSIGN; |
Johannes Berg | 4ce7cc2 | 2011-05-13 11:57:40 -0700 | [diff] [blame] | 253 | memcpy(__get_dynamic_array(hcmd0), hcmd0, len0); |
| 254 | memcpy(__get_dynamic_array(hcmd1), hcmd1, len1); |
| 255 | memcpy(__get_dynamic_array(hcmd2), hcmd2, len2); |
Johannes Berg | be1a71a | 2009-10-02 13:44:02 -0700 | [diff] [blame] | 256 | __entry->flags = flags; |
| 257 | ), |
Johannes Berg | 6c1011e | 2012-03-06 13:30:48 -0800 | [diff] [blame] | 258 | TP_printk("[%s] hcmd %#.2x (%ssync)", |
| 259 | __get_str(dev), ((u8 *)__get_dynamic_array(hcmd0))[0], |
Johannes Berg | be1a71a | 2009-10-02 13:44:02 -0700 | [diff] [blame] | 260 | __entry->flags & CMD_ASYNC ? "a" : "") |
| 261 | ); |
| 262 | |
| 263 | TRACE_EVENT(iwlwifi_dev_rx, |
Johannes Berg | 6c1011e | 2012-03-06 13:30:48 -0800 | [diff] [blame] | 264 | TP_PROTO(const struct device *dev, void *rxbuf, size_t len), |
| 265 | TP_ARGS(dev, rxbuf, len), |
Johannes Berg | be1a71a | 2009-10-02 13:44:02 -0700 | [diff] [blame] | 266 | TP_STRUCT__entry( |
Johannes Berg | 6c1011e | 2012-03-06 13:30:48 -0800 | [diff] [blame] | 267 | DEV_ENTRY |
Johannes Berg | be1a71a | 2009-10-02 13:44:02 -0700 | [diff] [blame] | 268 | __dynamic_array(u8, rxbuf, len) |
| 269 | ), |
| 270 | TP_fast_assign( |
Johannes Berg | 6c1011e | 2012-03-06 13:30:48 -0800 | [diff] [blame] | 271 | DEV_ASSIGN; |
Johannes Berg | be1a71a | 2009-10-02 13:44:02 -0700 | [diff] [blame] | 272 | memcpy(__get_dynamic_array(rxbuf), rxbuf, len); |
| 273 | ), |
Johannes Berg | 6c1011e | 2012-03-06 13:30:48 -0800 | [diff] [blame] | 274 | TP_printk("[%s] RX cmd %#.2x", |
| 275 | __get_str(dev), ((u8 *)__get_dynamic_array(rxbuf))[4]) |
Johannes Berg | be1a71a | 2009-10-02 13:44:02 -0700 | [diff] [blame] | 276 | ); |
| 277 | |
| 278 | TRACE_EVENT(iwlwifi_dev_tx, |
Johannes Berg | 6c1011e | 2012-03-06 13:30:48 -0800 | [diff] [blame] | 279 | TP_PROTO(const struct device *dev, void *tfd, size_t tfdlen, |
Johannes Berg | be1a71a | 2009-10-02 13:44:02 -0700 | [diff] [blame] | 280 | void *buf0, size_t buf0_len, |
| 281 | void *buf1, size_t buf1_len), |
Johannes Berg | 6c1011e | 2012-03-06 13:30:48 -0800 | [diff] [blame] | 282 | TP_ARGS(dev, tfd, tfdlen, buf0, buf0_len, buf1, buf1_len), |
Johannes Berg | be1a71a | 2009-10-02 13:44:02 -0700 | [diff] [blame] | 283 | TP_STRUCT__entry( |
Johannes Berg | 6c1011e | 2012-03-06 13:30:48 -0800 | [diff] [blame] | 284 | DEV_ENTRY |
Johannes Berg | be1a71a | 2009-10-02 13:44:02 -0700 | [diff] [blame] | 285 | |
| 286 | __field(size_t, framelen) |
| 287 | __dynamic_array(u8, tfd, tfdlen) |
| 288 | |
| 289 | /* |
| 290 | * Do not insert between or below these items, |
| 291 | * we want to keep the frame together (except |
| 292 | * for the possible padding). |
| 293 | */ |
| 294 | __dynamic_array(u8, buf0, buf0_len) |
| 295 | __dynamic_array(u8, buf1, buf1_len) |
| 296 | ), |
| 297 | TP_fast_assign( |
Johannes Berg | 6c1011e | 2012-03-06 13:30:48 -0800 | [diff] [blame] | 298 | DEV_ASSIGN; |
Johannes Berg | be1a71a | 2009-10-02 13:44:02 -0700 | [diff] [blame] | 299 | __entry->framelen = buf0_len + buf1_len; |
| 300 | memcpy(__get_dynamic_array(tfd), tfd, tfdlen); |
| 301 | memcpy(__get_dynamic_array(buf0), buf0, buf0_len); |
Johannes Berg | e95b743 | 2010-08-06 16:00:48 +0200 | [diff] [blame] | 302 | memcpy(__get_dynamic_array(buf1), buf1, buf1_len); |
Johannes Berg | be1a71a | 2009-10-02 13:44:02 -0700 | [diff] [blame] | 303 | ), |
Johannes Berg | 6c1011e | 2012-03-06 13:30:48 -0800 | [diff] [blame] | 304 | TP_printk("[%s] TX %.2x (%zu bytes)", |
| 305 | __get_str(dev), ((u8 *)__get_dynamic_array(buf0))[0], |
Johannes Berg | be1a71a | 2009-10-02 13:44:02 -0700 | [diff] [blame] | 306 | __entry->framelen) |
| 307 | ); |
| 308 | |
| 309 | TRACE_EVENT(iwlwifi_dev_ucode_error, |
Johannes Berg | 6c1011e | 2012-03-06 13:30:48 -0800 | [diff] [blame] | 310 | TP_PROTO(const struct device *dev, u32 desc, u32 tsf_low, |
Johannes Berg | be1a71a | 2009-10-02 13:44:02 -0700 | [diff] [blame] | 311 | u32 data1, u32 data2, u32 line, u32 blink1, |
Wey-Yi Guy | 5065054 | 2011-05-04 16:56:52 -0700 | [diff] [blame] | 312 | u32 blink2, u32 ilink1, u32 ilink2, u32 bcon_time, |
| 313 | u32 gp1, u32 gp2, u32 gp3, u32 ucode_ver, u32 hw_ver, |
| 314 | u32 brd_ver), |
Johannes Berg | 6c1011e | 2012-03-06 13:30:48 -0800 | [diff] [blame] | 315 | TP_ARGS(dev, desc, tsf_low, data1, data2, line, |
Wey-Yi Guy | 5065054 | 2011-05-04 16:56:52 -0700 | [diff] [blame] | 316 | blink1, blink2, ilink1, ilink2, bcon_time, gp1, gp2, |
| 317 | gp3, ucode_ver, hw_ver, brd_ver), |
Johannes Berg | be1a71a | 2009-10-02 13:44:02 -0700 | [diff] [blame] | 318 | TP_STRUCT__entry( |
Johannes Berg | 6c1011e | 2012-03-06 13:30:48 -0800 | [diff] [blame] | 319 | DEV_ENTRY |
Johannes Berg | be1a71a | 2009-10-02 13:44:02 -0700 | [diff] [blame] | 320 | __field(u32, desc) |
Wey-Yi Guy | 5065054 | 2011-05-04 16:56:52 -0700 | [diff] [blame] | 321 | __field(u32, tsf_low) |
Johannes Berg | be1a71a | 2009-10-02 13:44:02 -0700 | [diff] [blame] | 322 | __field(u32, data1) |
| 323 | __field(u32, data2) |
| 324 | __field(u32, line) |
| 325 | __field(u32, blink1) |
| 326 | __field(u32, blink2) |
| 327 | __field(u32, ilink1) |
| 328 | __field(u32, ilink2) |
Wey-Yi Guy | 5065054 | 2011-05-04 16:56:52 -0700 | [diff] [blame] | 329 | __field(u32, bcon_time) |
| 330 | __field(u32, gp1) |
| 331 | __field(u32, gp2) |
| 332 | __field(u32, gp3) |
| 333 | __field(u32, ucode_ver) |
| 334 | __field(u32, hw_ver) |
| 335 | __field(u32, brd_ver) |
Johannes Berg | be1a71a | 2009-10-02 13:44:02 -0700 | [diff] [blame] | 336 | ), |
| 337 | TP_fast_assign( |
Johannes Berg | 6c1011e | 2012-03-06 13:30:48 -0800 | [diff] [blame] | 338 | DEV_ASSIGN; |
Johannes Berg | be1a71a | 2009-10-02 13:44:02 -0700 | [diff] [blame] | 339 | __entry->desc = desc; |
Wey-Yi Guy | 5065054 | 2011-05-04 16:56:52 -0700 | [diff] [blame] | 340 | __entry->tsf_low = tsf_low; |
Johannes Berg | be1a71a | 2009-10-02 13:44:02 -0700 | [diff] [blame] | 341 | __entry->data1 = data1; |
| 342 | __entry->data2 = data2; |
| 343 | __entry->line = line; |
| 344 | __entry->blink1 = blink1; |
| 345 | __entry->blink2 = blink2; |
| 346 | __entry->ilink1 = ilink1; |
| 347 | __entry->ilink2 = ilink2; |
Wey-Yi Guy | 5065054 | 2011-05-04 16:56:52 -0700 | [diff] [blame] | 348 | __entry->bcon_time = bcon_time; |
| 349 | __entry->gp1 = gp1; |
| 350 | __entry->gp2 = gp2; |
| 351 | __entry->gp3 = gp3; |
| 352 | __entry->ucode_ver = ucode_ver; |
| 353 | __entry->hw_ver = hw_ver; |
| 354 | __entry->brd_ver = brd_ver; |
Johannes Berg | be1a71a | 2009-10-02 13:44:02 -0700 | [diff] [blame] | 355 | ), |
Johannes Berg | 6c1011e | 2012-03-06 13:30:48 -0800 | [diff] [blame] | 356 | TP_printk("[%s] #%02d %010u data 0x%08X 0x%08X line %u, " |
Wey-Yi Guy | 5065054 | 2011-05-04 16:56:52 -0700 | [diff] [blame] | 357 | "blink 0x%05X 0x%05X ilink 0x%05X 0x%05X " |
| 358 | "bcon_tm %010u gp 0x%08X 0x%08X 0x%08X uCode 0x%08X " |
| 359 | "hw 0x%08X brd 0x%08X", |
Johannes Berg | 6c1011e | 2012-03-06 13:30:48 -0800 | [diff] [blame] | 360 | __get_str(dev), __entry->desc, __entry->tsf_low, |
Wey-Yi Guy | 5065054 | 2011-05-04 16:56:52 -0700 | [diff] [blame] | 361 | __entry->data1, |
Johannes Berg | be1a71a | 2009-10-02 13:44:02 -0700 | [diff] [blame] | 362 | __entry->data2, __entry->line, __entry->blink1, |
Wey-Yi Guy | 5065054 | 2011-05-04 16:56:52 -0700 | [diff] [blame] | 363 | __entry->blink2, __entry->ilink1, __entry->ilink2, |
| 364 | __entry->bcon_time, __entry->gp1, __entry->gp2, |
| 365 | __entry->gp3, __entry->ucode_ver, __entry->hw_ver, |
| 366 | __entry->brd_ver) |
Johannes Berg | be1a71a | 2009-10-02 13:44:02 -0700 | [diff] [blame] | 367 | ); |
| 368 | |
| 369 | TRACE_EVENT(iwlwifi_dev_ucode_event, |
Johannes Berg | 6c1011e | 2012-03-06 13:30:48 -0800 | [diff] [blame] | 370 | TP_PROTO(const struct device *dev, u32 time, u32 data, u32 ev), |
| 371 | TP_ARGS(dev, time, data, ev), |
Johannes Berg | be1a71a | 2009-10-02 13:44:02 -0700 | [diff] [blame] | 372 | TP_STRUCT__entry( |
Johannes Berg | 6c1011e | 2012-03-06 13:30:48 -0800 | [diff] [blame] | 373 | DEV_ENTRY |
Johannes Berg | be1a71a | 2009-10-02 13:44:02 -0700 | [diff] [blame] | 374 | |
| 375 | __field(u32, time) |
| 376 | __field(u32, data) |
| 377 | __field(u32, ev) |
| 378 | ), |
| 379 | TP_fast_assign( |
Johannes Berg | 6c1011e | 2012-03-06 13:30:48 -0800 | [diff] [blame] | 380 | DEV_ASSIGN; |
Johannes Berg | be1a71a | 2009-10-02 13:44:02 -0700 | [diff] [blame] | 381 | __entry->time = time; |
| 382 | __entry->data = data; |
| 383 | __entry->ev = ev; |
| 384 | ), |
Johannes Berg | 6c1011e | 2012-03-06 13:30:48 -0800 | [diff] [blame] | 385 | TP_printk("[%s] EVT_LOGT:%010u:0x%08x:%04u", |
| 386 | __get_str(dev), __entry->time, __entry->data, __entry->ev) |
Johannes Berg | be1a71a | 2009-10-02 13:44:02 -0700 | [diff] [blame] | 387 | ); |
| 388 | #endif /* __IWLWIFI_DEVICE_TRACE */ |
| 389 | |
| 390 | #undef TRACE_INCLUDE_PATH |
| 391 | #define TRACE_INCLUDE_PATH . |
| 392 | #undef TRACE_INCLUDE_FILE |
| 393 | #define TRACE_INCLUDE_FILE iwl-devtrace |
| 394 | #include <trace/define_trace.h> |