1 /******************************************************************************
3 * Copyright(c) 2009 - 2014 Intel Corporation. All rights reserved.
4 * Copyright(c) 2015 Intel Mobile Communications GmbH
5 * Copyright(c) 2016 Intel Deutschland GmbH
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of version 2 of the GNU General Public License as
9 * published by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 * You should have received a copy of the GNU General Public License along with
17 * this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
20 * The full GNU General Public License is included in this distribution in the
21 * file called LICENSE.
23 * Contact Information:
24 * Intel Linux Wireless <linuxwifi@intel.com>
25 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
27 *****************************************************************************/
29 #if !defined(__IWLWIFI_DEVICE_TRACE_IWLWIFI) || defined(TRACE_HEADER_MULTI_READ)
30 #define __IWLWIFI_DEVICE_TRACE_IWLWIFI
32 #include <linux/tracepoint.h>
35 #define TRACE_SYSTEM iwlwifi
37 TRACE_EVENT(iwlwifi_dev_hcmd
,
38 TP_PROTO(const struct device
*dev
,
39 struct iwl_host_cmd
*cmd
, u16 total_size
,
40 struct iwl_cmd_header_wide
*hdr
),
41 TP_ARGS(dev
, cmd
, total_size
, hdr
),
44 __dynamic_array(u8
, hcmd
, total_size
)
48 int i
, offset
= sizeof(struct iwl_cmd_header
);
51 offset
= sizeof(struct iwl_cmd_header_wide
);
54 __entry
->flags
= cmd
->flags
;
55 memcpy(__get_dynamic_array(hcmd
), hdr
, offset
);
57 for (i
= 0; i
< IWL_MAX_CMD_TBS_PER_TFD
; i
++) {
60 memcpy((u8
*)__get_dynamic_array(hcmd
) + offset
,
61 cmd
->data
[i
], cmd
->len
[i
]);
62 offset
+= cmd
->len
[i
];
65 TP_printk("[%s] hcmd %#.2x.%#.2x (%ssync)",
66 __get_str(dev
), ((u8
*)__get_dynamic_array(hcmd
))[1],
67 ((u8
*)__get_dynamic_array(hcmd
))[0],
68 __entry
->flags
& CMD_ASYNC
? "a" : "")
71 TRACE_EVENT(iwlwifi_dev_rx
,
72 TP_PROTO(const struct device
*dev
, const struct iwl_trans
*trans
,
73 struct iwl_rx_packet
*pkt
, size_t len
),
74 TP_ARGS(dev
, trans
, pkt
, len
),
78 __dynamic_array(u8
, rxbuf
, iwl_rx_trace_len(trans
, pkt
, len
))
82 __entry
->cmd
= WIDE_ID(pkt
->hdr
.group_id
, pkt
->hdr
.cmd
);
83 memcpy(__get_dynamic_array(rxbuf
), pkt
,
84 iwl_rx_trace_len(trans
, pkt
, len
));
86 TP_printk("[%s] RX cmd %#.2x",
87 __get_str(dev
), __entry
->cmd
)
90 TRACE_EVENT(iwlwifi_dev_tx
,
91 TP_PROTO(const struct device
*dev
, struct sk_buff
*skb
,
92 void *tfd
, size_t tfdlen
,
93 void *buf0
, size_t buf0_len
,
94 void *buf1
, size_t buf1_len
),
95 TP_ARGS(dev
, skb
, tfd
, tfdlen
, buf0
, buf0_len
, buf1
, buf1_len
),
99 __field(size_t, framelen
)
100 __dynamic_array(u8
, tfd
, tfdlen
)
103 * Do not insert between or below these items,
104 * we want to keep the frame together (except
105 * for the possible padding).
107 __dynamic_array(u8
, buf0
, buf0_len
)
108 __dynamic_array(u8
, buf1
, iwl_trace_data(skb
) ? 0 : buf1_len
)
112 __entry
->framelen
= buf0_len
+ buf1_len
;
113 memcpy(__get_dynamic_array(tfd
), tfd
, tfdlen
);
114 memcpy(__get_dynamic_array(buf0
), buf0
, buf0_len
);
115 if (!iwl_trace_data(skb
))
116 memcpy(__get_dynamic_array(buf1
), buf1
, buf1_len
);
118 TP_printk("[%s] TX %.2x (%zu bytes)",
119 __get_str(dev
), ((u8
*)__get_dynamic_array(buf0
))[0],
123 TRACE_EVENT(iwlwifi_dev_ucode_error
,
124 TP_PROTO(const struct device
*dev
, u32 desc
, u32 tsf_low
,
125 u32 data1
, u32 data2
, u32 line
, u32 blink2
, u32 ilink1
,
126 u32 ilink2
, u32 bcon_time
, u32 gp1
, u32 gp2
, u32 rev_type
,
127 u32 major
, u32 minor
, u32 hw_ver
, u32 brd_ver
),
128 TP_ARGS(dev
, desc
, tsf_low
, data1
, data2
, line
,
129 blink2
, ilink1
, ilink2
, bcon_time
, gp1
, gp2
,
130 rev_type
, major
, minor
, hw_ver
, brd_ver
),
134 __field(u32
, tsf_low
)
141 __field(u32
, bcon_time
)
144 __field(u32
, rev_type
)
148 __field(u32
, brd_ver
)
152 __entry
->desc
= desc
;
153 __entry
->tsf_low
= tsf_low
;
154 __entry
->data1
= data1
;
155 __entry
->data2
= data2
;
156 __entry
->line
= line
;
157 __entry
->blink2
= blink2
;
158 __entry
->ilink1
= ilink1
;
159 __entry
->ilink2
= ilink2
;
160 __entry
->bcon_time
= bcon_time
;
163 __entry
->rev_type
= rev_type
;
164 __entry
->major
= major
;
165 __entry
->minor
= minor
;
166 __entry
->hw_ver
= hw_ver
;
167 __entry
->brd_ver
= brd_ver
;
169 TP_printk("[%s] #%02d %010u data 0x%08X 0x%08X line %u, "
170 "blink2 0x%05X ilink 0x%05X 0x%05X "
171 "bcon_tm %010u gp 0x%08X 0x%08X rev_type 0x%08X major 0x%08X "
172 "minor 0x%08X hw 0x%08X brd 0x%08X",
173 __get_str(dev
), __entry
->desc
, __entry
->tsf_low
,
174 __entry
->data1
, __entry
->data2
, __entry
->line
,
175 __entry
->blink2
, __entry
->ilink1
, __entry
->ilink2
,
176 __entry
->bcon_time
, __entry
->gp1
, __entry
->gp2
,
177 __entry
->rev_type
, __entry
->major
, __entry
->minor
,
178 __entry
->hw_ver
, __entry
->brd_ver
)
181 TRACE_EVENT(iwlwifi_dev_ucode_event
,
182 TP_PROTO(const struct device
*dev
, u32 time
, u32 data
, u32 ev
),
183 TP_ARGS(dev
, time
, data
, ev
),
193 __entry
->time
= time
;
194 __entry
->data
= data
;
197 TP_printk("[%s] EVT_LOGT:%010u:0x%08x:%04u",
198 __get_str(dev
), __entry
->time
, __entry
->data
, __entry
->ev
)
200 #endif /* __IWLWIFI_DEVICE_TRACE_IWLWIFI */
202 #undef TRACE_INCLUDE_PATH
203 #define TRACE_INCLUDE_PATH .
204 #undef TRACE_INCLUDE_FILE
205 #define TRACE_INCLUDE_FILE iwl-devtrace-iwlwifi
206 #include <trace/define_trace.h>