Commit | Line | Data |
---|---|---|
bb5d2db5 RC |
1 | /****************************************************************************** |
2 | * | |
3 | * Copyright(c) 2009 - 2010 Intel Corporation. All rights reserved. | |
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 | ||
be1a71a1 JB |
27 | #if !defined(__IWLWIFI_DEVICE_TRACE) || defined(TRACE_HEADER_MULTI_READ) |
28 | #define __IWLWIFI_DEVICE_TRACE | |
29 | ||
30 | #include <linux/tracepoint.h> | |
31 | #include "iwl-dev.h" | |
32 | ||
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) {} | |
37 | #endif | |
38 | ||
39 | #define PRIV_ENTRY __field(struct iwl_priv *, priv) | |
40 | #define PRIV_ASSIGN __entry->priv = priv | |
41 | ||
42 | #undef TRACE_SYSTEM | |
0fd95afc | 43 | #define TRACE_SYSTEM iwlwifi_io |
be1a71a1 JB |
44 | |
45 | TRACE_EVENT(iwlwifi_dev_ioread32, | |
46 | TP_PROTO(struct iwl_priv *priv, u32 offs, u32 val), | |
47 | TP_ARGS(priv, offs, val), | |
48 | TP_STRUCT__entry( | |
49 | PRIV_ENTRY | |
50 | __field(u32, offs) | |
51 | __field(u32, val) | |
52 | ), | |
53 | TP_fast_assign( | |
54 | PRIV_ASSIGN; | |
55 | __entry->offs = offs; | |
56 | __entry->val = val; | |
57 | ), | |
58 | TP_printk("[%p] read io[%#x] = %#x", __entry->priv, __entry->offs, __entry->val) | |
59 | ); | |
60 | ||
4e03185f BC |
61 | TRACE_EVENT(iwlwifi_dev_iowrite8, |
62 | TP_PROTO(struct iwl_priv *priv, u32 offs, u8 val), | |
63 | TP_ARGS(priv, offs, val), | |
64 | TP_STRUCT__entry( | |
65 | PRIV_ENTRY | |
66 | __field(u32, offs) | |
67 | __field(u8, val) | |
68 | ), | |
69 | TP_fast_assign( | |
70 | PRIV_ASSIGN; | |
71 | __entry->offs = offs; | |
72 | __entry->val = val; | |
73 | ), | |
74 | TP_printk("[%p] write io[%#x] = %#x)", __entry->priv, __entry->offs, __entry->val) | |
75 | ); | |
76 | ||
be1a71a1 JB |
77 | TRACE_EVENT(iwlwifi_dev_iowrite32, |
78 | TP_PROTO(struct iwl_priv *priv, u32 offs, u32 val), | |
79 | TP_ARGS(priv, offs, val), | |
80 | TP_STRUCT__entry( | |
81 | PRIV_ENTRY | |
82 | __field(u32, offs) | |
83 | __field(u32, val) | |
84 | ), | |
85 | TP_fast_assign( | |
86 | PRIV_ASSIGN; | |
87 | __entry->offs = offs; | |
88 | __entry->val = val; | |
89 | ), | |
90 | TP_printk("[%p] write io[%#x] = %#x)", __entry->priv, __entry->offs, __entry->val) | |
91 | ); | |
92 | ||
0fd95afc JB |
93 | #undef TRACE_SYSTEM |
94 | #define TRACE_SYSTEM iwlwifi | |
95 | ||
be1a71a1 JB |
96 | TRACE_EVENT(iwlwifi_dev_hcmd, |
97 | TP_PROTO(struct iwl_priv *priv, void *hcmd, size_t len, u32 flags), | |
98 | TP_ARGS(priv, hcmd, len, flags), | |
99 | TP_STRUCT__entry( | |
100 | PRIV_ENTRY | |
101 | __dynamic_array(u8, hcmd, len) | |
102 | __field(u32, flags) | |
103 | ), | |
104 | TP_fast_assign( | |
105 | PRIV_ASSIGN; | |
106 | memcpy(__get_dynamic_array(hcmd), hcmd, len); | |
107 | __entry->flags = flags; | |
108 | ), | |
109 | TP_printk("[%p] hcmd %#.2x (%ssync)", | |
110 | __entry->priv, ((u8 *)__get_dynamic_array(hcmd))[0], | |
111 | __entry->flags & CMD_ASYNC ? "a" : "") | |
112 | ); | |
113 | ||
114 | TRACE_EVENT(iwlwifi_dev_rx, | |
115 | TP_PROTO(struct iwl_priv *priv, void *rxbuf, size_t len), | |
116 | TP_ARGS(priv, rxbuf, len), | |
117 | TP_STRUCT__entry( | |
118 | PRIV_ENTRY | |
119 | __dynamic_array(u8, rxbuf, len) | |
120 | ), | |
121 | TP_fast_assign( | |
122 | PRIV_ASSIGN; | |
123 | memcpy(__get_dynamic_array(rxbuf), rxbuf, len); | |
124 | ), | |
125 | TP_printk("[%p] RX cmd %#.2x", | |
126 | __entry->priv, ((u8 *)__get_dynamic_array(rxbuf))[4]) | |
127 | ); | |
128 | ||
129 | TRACE_EVENT(iwlwifi_dev_tx, | |
130 | TP_PROTO(struct iwl_priv *priv, void *tfd, size_t tfdlen, | |
131 | void *buf0, size_t buf0_len, | |
132 | void *buf1, size_t buf1_len), | |
133 | TP_ARGS(priv, tfd, tfdlen, buf0, buf0_len, buf1, buf1_len), | |
134 | TP_STRUCT__entry( | |
135 | PRIV_ENTRY | |
136 | ||
137 | __field(size_t, framelen) | |
138 | __dynamic_array(u8, tfd, tfdlen) | |
139 | ||
140 | /* | |
141 | * Do not insert between or below these items, | |
142 | * we want to keep the frame together (except | |
143 | * for the possible padding). | |
144 | */ | |
145 | __dynamic_array(u8, buf0, buf0_len) | |
146 | __dynamic_array(u8, buf1, buf1_len) | |
147 | ), | |
148 | TP_fast_assign( | |
149 | PRIV_ASSIGN; | |
150 | __entry->framelen = buf0_len + buf1_len; | |
151 | memcpy(__get_dynamic_array(tfd), tfd, tfdlen); | |
152 | memcpy(__get_dynamic_array(buf0), buf0, buf0_len); | |
153 | memcpy(__get_dynamic_array(buf1), buf1, buf0_len); | |
154 | ), | |
155 | TP_printk("[%p] TX %.2x (%zu bytes)", | |
156 | __entry->priv, | |
157 | ((u8 *)__get_dynamic_array(buf0))[0], | |
158 | __entry->framelen) | |
159 | ); | |
160 | ||
161 | TRACE_EVENT(iwlwifi_dev_ucode_error, | |
162 | TP_PROTO(struct iwl_priv *priv, u32 desc, u32 time, | |
163 | u32 data1, u32 data2, u32 line, u32 blink1, | |
164 | u32 blink2, u32 ilink1, u32 ilink2), | |
165 | TP_ARGS(priv, desc, time, data1, data2, line, | |
166 | blink1, blink2, ilink1, ilink2), | |
167 | TP_STRUCT__entry( | |
168 | PRIV_ENTRY | |
169 | __field(u32, desc) | |
170 | __field(u32, time) | |
171 | __field(u32, data1) | |
172 | __field(u32, data2) | |
173 | __field(u32, line) | |
174 | __field(u32, blink1) | |
175 | __field(u32, blink2) | |
176 | __field(u32, ilink1) | |
177 | __field(u32, ilink2) | |
178 | ), | |
179 | TP_fast_assign( | |
180 | PRIV_ASSIGN; | |
181 | __entry->desc = desc; | |
182 | __entry->time = time; | |
183 | __entry->data1 = data1; | |
184 | __entry->data2 = data2; | |
185 | __entry->line = line; | |
186 | __entry->blink1 = blink1; | |
187 | __entry->blink2 = blink2; | |
188 | __entry->ilink1 = ilink1; | |
189 | __entry->ilink2 = ilink2; | |
190 | ), | |
191 | TP_printk("[%p] #%02d %010u data 0x%08X 0x%08X line %u, " | |
192 | "blink 0x%05X 0x%05X ilink 0x%05X 0x%05X", | |
193 | __entry->priv, __entry->desc, __entry->time, __entry->data1, | |
194 | __entry->data2, __entry->line, __entry->blink1, | |
195 | __entry->blink2, __entry->ilink1, __entry->ilink2) | |
196 | ); | |
197 | ||
198 | TRACE_EVENT(iwlwifi_dev_ucode_event, | |
199 | TP_PROTO(struct iwl_priv *priv, u32 time, u32 data, u32 ev), | |
200 | TP_ARGS(priv, time, data, ev), | |
201 | TP_STRUCT__entry( | |
202 | PRIV_ENTRY | |
203 | ||
204 | __field(u32, time) | |
205 | __field(u32, data) | |
206 | __field(u32, ev) | |
207 | ), | |
208 | TP_fast_assign( | |
209 | PRIV_ASSIGN; | |
210 | __entry->time = time; | |
211 | __entry->data = data; | |
212 | __entry->ev = ev; | |
213 | ), | |
214 | TP_printk("[%p] EVT_LOGT:%010u:0x%08x:%04u", | |
215 | __entry->priv, __entry->time, __entry->data, __entry->ev) | |
216 | ); | |
217 | #endif /* __IWLWIFI_DEVICE_TRACE */ | |
218 | ||
219 | #undef TRACE_INCLUDE_PATH | |
220 | #define TRACE_INCLUDE_PATH . | |
221 | #undef TRACE_INCLUDE_FILE | |
222 | #define TRACE_INCLUDE_FILE iwl-devtrace | |
223 | #include <trace/define_trace.h> |