1 /******************************************************************************
3 * Copyright(c) 2009 - 2014 Intel Corporation. All rights reserved.
4 * Copyright(c) 2015 Intel Mobile Communications GmbH
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of version 2 of the GNU General Public License as
8 * published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 * You should have received a copy of the GNU General Public License along with
16 * this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
19 * The full GNU General Public License is included in this distribution in the
20 * file called LICENSE.
22 * Contact Information:
23 * Intel Linux Wireless <ilw@linux.intel.com>
24 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
26 *****************************************************************************/
28 #if !defined(__IWLWIFI_DEVICE_TRACE_IWLWIFI) || defined(TRACE_HEADER_MULTI_READ)
29 #define __IWLWIFI_DEVICE_TRACE_IWLWIFI
31 #include <linux/tracepoint.h>
34 #define TRACE_SYSTEM iwlwifi
36 TRACE_EVENT(iwlwifi_dev_hcmd,
37 TP_PROTO(const struct device *dev,
38 struct iwl_host_cmd *cmd, u16 total_size,
39 struct iwl_cmd_header *hdr),
40 TP_ARGS(dev, cmd, total_size, hdr),
43 __dynamic_array(u8, hcmd, total_size)
47 int i, offset = sizeof(*hdr);
50 __entry->flags = cmd->flags;
51 memcpy(__get_dynamic_array(hcmd), hdr, sizeof(*hdr));
53 for (i = 0; i < IWL_MAX_CMD_TBS_PER_TFD; i++) {
56 memcpy((u8 *)__get_dynamic_array(hcmd) + offset,
57 cmd->data[i], cmd->len[i]);
58 offset += cmd->len[i];
61 TP_printk("[%s] hcmd %#.2x (%ssync)",
62 __get_str(dev), ((u8 *)__get_dynamic_array(hcmd))[0],
63 __entry->flags & CMD_ASYNC ? "a" : "")
66 TRACE_EVENT(iwlwifi_dev_rx,
67 TP_PROTO(const struct device *dev, const struct iwl_trans *trans,
68 struct iwl_rx_packet *pkt, size_t len),
69 TP_ARGS(dev, trans, pkt, len),
73 __dynamic_array(u8, rxbuf, iwl_rx_trace_len(trans, pkt, len))
77 __entry->cmd = pkt->hdr.cmd;
78 memcpy(__get_dynamic_array(rxbuf), pkt,
79 iwl_rx_trace_len(trans, pkt, len));
81 TP_printk("[%s] RX cmd %#.2x",
82 __get_str(dev), __entry->cmd)
85 TRACE_EVENT(iwlwifi_dev_tx,
86 TP_PROTO(const struct device *dev, struct sk_buff *skb,
87 void *tfd, size_t tfdlen,
88 void *buf0, size_t buf0_len,
89 void *buf1, size_t buf1_len),
90 TP_ARGS(dev, skb, tfd, tfdlen, buf0, buf0_len, buf1, buf1_len),
94 __field(size_t, framelen)
95 __dynamic_array(u8, tfd, tfdlen)
98 * Do not insert between or below these items,
99 * we want to keep the frame together (except
100 * for the possible padding).
102 __dynamic_array(u8, buf0, buf0_len)
103 __dynamic_array(u8, buf1, iwl_trace_data(skb) ? 0 : buf1_len)
107 __entry->framelen = buf0_len + buf1_len;
108 memcpy(__get_dynamic_array(tfd), tfd, tfdlen);
109 memcpy(__get_dynamic_array(buf0), buf0, buf0_len);
110 if (!iwl_trace_data(skb))
111 memcpy(__get_dynamic_array(buf1), buf1, buf1_len);
113 TP_printk("[%s] TX %.2x (%zu bytes)",
114 __get_str(dev), ((u8 *)__get_dynamic_array(buf0))[0],
118 TRACE_EVENT(iwlwifi_dev_ucode_error,
119 TP_PROTO(const struct device *dev, u32 desc, u32 tsf_low,
120 u32 data1, u32 data2, u32 line, u32 blink1,
121 u32 blink2, u32 ilink1, u32 ilink2, u32 bcon_time,
122 u32 gp1, u32 gp2, u32 gp3, u32 major, u32 minor, u32 hw_ver,
124 TP_ARGS(dev, desc, tsf_low, data1, data2, line,
125 blink1, blink2, ilink1, ilink2, bcon_time, gp1, gp2,
126 gp3, major, minor, hw_ver, brd_ver),
130 __field(u32, tsf_low)
138 __field(u32, bcon_time)
145 __field(u32, brd_ver)
149 __entry->desc = desc;
150 __entry->tsf_low = tsf_low;
151 __entry->data1 = data1;
152 __entry->data2 = data2;
153 __entry->line = line;
154 __entry->blink1 = blink1;
155 __entry->blink2 = blink2;
156 __entry->ilink1 = ilink1;
157 __entry->ilink2 = ilink2;
158 __entry->bcon_time = bcon_time;
162 __entry->major = major;
163 __entry->minor = minor;
164 __entry->hw_ver = hw_ver;
165 __entry->brd_ver = brd_ver;
167 TP_printk("[%s] #%02d %010u data 0x%08X 0x%08X line %u, "
168 "blink 0x%05X 0x%05X ilink 0x%05X 0x%05X "
169 "bcon_tm %010u gp 0x%08X 0x%08X 0x%08X major 0x%08X "
170 "minor 0x%08X hw 0x%08X brd 0x%08X",
171 __get_str(dev), __entry->desc, __entry->tsf_low,
173 __entry->data2, __entry->line, __entry->blink1,
174 __entry->blink2, __entry->ilink1, __entry->ilink2,
175 __entry->bcon_time, __entry->gp1, __entry->gp2,
176 __entry->gp3, __entry->major, __entry->minor,
177 __entry->hw_ver, __entry->brd_ver)
180 TRACE_EVENT(iwlwifi_dev_ucode_event,
181 TP_PROTO(const struct device *dev, u32 time, u32 data, u32 ev),
182 TP_ARGS(dev, time, data, ev),
192 __entry->time = time;
193 __entry->data = data;
196 TP_printk("[%s] EVT_LOGT:%010u:0x%08x:%04u",
197 __get_str(dev), __entry->time, __entry->data, __entry->ev)
199 #endif /* __IWLWIFI_DEVICE_TRACE_IWLWIFI */
201 #undef TRACE_INCLUDE_PATH
202 #define TRACE_INCLUDE_PATH .
203 #undef TRACE_INCLUDE_FILE
204 #define TRACE_INCLUDE_FILE iwl-devtrace-iwlwifi
205 #include <trace/define_trace.h>