1 /******************************************************************************
3 * Copyright(c) 2009 - 2014 Intel Corporation. All rights reserved.
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.
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
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
18 * The full GNU General Public License is included in this distribution in the
19 * file called LICENSE.
21 * Contact Information:
22 * Intel Linux Wireless <ilw@linux.intel.com>
23 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
25 *****************************************************************************/
27 #if !defined(__IWLWIFI_DEVICE_TRACE_IWLWIFI) || defined(TRACE_HEADER_MULTI_READ)
28 #define __IWLWIFI_DEVICE_TRACE_IWLWIFI
30 #include <linux/tracepoint.h>
33 #define TRACE_SYSTEM iwlwifi
35 TRACE_EVENT(iwlwifi_dev_hcmd,
36 TP_PROTO(const struct device *dev,
37 struct iwl_host_cmd *cmd, u16 total_size,
38 struct iwl_cmd_header *hdr),
39 TP_ARGS(dev, cmd, total_size, hdr),
42 __dynamic_array(u8, hcmd, total_size)
46 int i, offset = sizeof(*hdr);
49 __entry->flags = cmd->flags;
50 memcpy(__get_dynamic_array(hcmd), hdr, sizeof(*hdr));
52 for (i = 0; i < IWL_MAX_CMD_TBS_PER_TFD; i++) {
55 memcpy((u8 *)__get_dynamic_array(hcmd) + offset,
56 cmd->data[i], cmd->len[i]);
57 offset += cmd->len[i];
60 TP_printk("[%s] hcmd %#.2x (%ssync)",
61 __get_str(dev), ((u8 *)__get_dynamic_array(hcmd))[0],
62 __entry->flags & CMD_ASYNC ? "a" : "")
65 TRACE_EVENT(iwlwifi_dev_rx,
66 TP_PROTO(const struct device *dev, const struct iwl_trans *trans,
67 void *rxbuf, size_t len),
68 TP_ARGS(dev, trans, rxbuf, len),
71 __dynamic_array(u8, rxbuf, iwl_rx_trace_len(trans, rxbuf, len))
75 memcpy(__get_dynamic_array(rxbuf), rxbuf,
76 iwl_rx_trace_len(trans, rxbuf, len));
78 TP_printk("[%s] RX cmd %#.2x",
79 __get_str(dev), ((u8 *)__get_dynamic_array(rxbuf))[4])
82 TRACE_EVENT(iwlwifi_dev_tx,
83 TP_PROTO(const struct device *dev, struct sk_buff *skb,
84 void *tfd, size_t tfdlen,
85 void *buf0, size_t buf0_len,
86 void *buf1, size_t buf1_len),
87 TP_ARGS(dev, skb, tfd, tfdlen, buf0, buf0_len, buf1, buf1_len),
91 __field(size_t, framelen)
92 __dynamic_array(u8, tfd, tfdlen)
95 * Do not insert between or below these items,
96 * we want to keep the frame together (except
97 * for the possible padding).
99 __dynamic_array(u8, buf0, buf0_len)
100 __dynamic_array(u8, buf1, iwl_trace_data(skb) ? 0 : buf1_len)
104 __entry->framelen = buf0_len + buf1_len;
105 memcpy(__get_dynamic_array(tfd), tfd, tfdlen);
106 memcpy(__get_dynamic_array(buf0), buf0, buf0_len);
107 if (!iwl_trace_data(skb))
108 memcpy(__get_dynamic_array(buf1), buf1, buf1_len);
110 TP_printk("[%s] TX %.2x (%zu bytes)",
111 __get_str(dev), ((u8 *)__get_dynamic_array(buf0))[0],
115 TRACE_EVENT(iwlwifi_dev_ucode_error,
116 TP_PROTO(const struct device *dev, u32 desc, u32 tsf_low,
117 u32 data1, u32 data2, u32 line, u32 blink1,
118 u32 blink2, u32 ilink1, u32 ilink2, u32 bcon_time,
119 u32 gp1, u32 gp2, u32 gp3, u32 major, u32 minor, u32 hw_ver,
121 TP_ARGS(dev, desc, tsf_low, data1, data2, line,
122 blink1, blink2, ilink1, ilink2, bcon_time, gp1, gp2,
123 gp3, major, minor, hw_ver, brd_ver),
127 __field(u32, tsf_low)
135 __field(u32, bcon_time)
142 __field(u32, brd_ver)
146 __entry->desc = desc;
147 __entry->tsf_low = tsf_low;
148 __entry->data1 = data1;
149 __entry->data2 = data2;
150 __entry->line = line;
151 __entry->blink1 = blink1;
152 __entry->blink2 = blink2;
153 __entry->ilink1 = ilink1;
154 __entry->ilink2 = ilink2;
155 __entry->bcon_time = bcon_time;
159 __entry->major = major;
160 __entry->minor = minor;
161 __entry->hw_ver = hw_ver;
162 __entry->brd_ver = brd_ver;
164 TP_printk("[%s] #%02d %010u data 0x%08X 0x%08X line %u, "
165 "blink 0x%05X 0x%05X ilink 0x%05X 0x%05X "
166 "bcon_tm %010u gp 0x%08X 0x%08X 0x%08X major 0x%08X "
167 "minor 0x%08X hw 0x%08X brd 0x%08X",
168 __get_str(dev), __entry->desc, __entry->tsf_low,
170 __entry->data2, __entry->line, __entry->blink1,
171 __entry->blink2, __entry->ilink1, __entry->ilink2,
172 __entry->bcon_time, __entry->gp1, __entry->gp2,
173 __entry->gp3, __entry->major, __entry->minor,
174 __entry->hw_ver, __entry->brd_ver)
177 TRACE_EVENT(iwlwifi_dev_ucode_event,
178 TP_PROTO(const struct device *dev, u32 time, u32 data, u32 ev),
179 TP_ARGS(dev, time, data, ev),
189 __entry->time = time;
190 __entry->data = data;
193 TP_printk("[%s] EVT_LOGT:%010u:0x%08x:%04u",
194 __get_str(dev), __entry->time, __entry->data, __entry->ev)
196 #endif /* __IWLWIFI_DEVICE_TRACE_IWLWIFI */
198 #undef TRACE_INCLUDE_PATH
199 #define TRACE_INCLUDE_PATH .
200 #undef TRACE_INCLUDE_FILE
201 #define TRACE_INCLUDE_FILE iwl-devtrace-iwlwifi
202 #include <trace/define_trace.h>