1 #if !defined(__IWLWIFI_DEVICE_TRACE) || defined(TRACE_HEADER_MULTI_READ)
2 #define __IWLWIFI_DEVICE_TRACE
4 #include <linux/tracepoint.h>
7 #if !defined(CONFIG_IWLWIFI_DEVICE_TRACING) || defined(__CHECKER__)
9 #define TRACE_EVENT(name, proto, ...) \
10 static inline void trace_ ## name(proto) {}
13 #define PRIV_ENTRY __field(struct iwl_priv *, priv)
14 #define PRIV_ASSIGN __entry->priv = priv
17 #define TRACE_SYSTEM iwlwifi
19 TRACE_EVENT(iwlwifi_dev_ioread32
,
20 TP_PROTO(struct iwl_priv
*priv
, u32 offs
, u32 val
),
21 TP_ARGS(priv
, offs
, val
),
32 TP_printk("[%p] read io[%#x] = %#x", __entry
->priv
, __entry
->offs
, __entry
->val
)
35 TRACE_EVENT(iwlwifi_dev_iowrite32
,
36 TP_PROTO(struct iwl_priv
*priv
, u32 offs
, u32 val
),
37 TP_ARGS(priv
, offs
, val
),
48 TP_printk("[%p] write io[%#x] = %#x)", __entry
->priv
, __entry
->offs
, __entry
->val
)
51 TRACE_EVENT(iwlwifi_dev_hcmd
,
52 TP_PROTO(struct iwl_priv
*priv
, void *hcmd
, size_t len
, u32 flags
),
53 TP_ARGS(priv
, hcmd
, len
, flags
),
56 __dynamic_array(u8
, hcmd
, len
)
61 memcpy(__get_dynamic_array(hcmd
), hcmd
, len
);
62 __entry
->flags
= flags
;
64 TP_printk("[%p] hcmd %#.2x (%ssync)",
65 __entry
->priv
, ((u8
*)__get_dynamic_array(hcmd
))[0],
66 __entry
->flags
& CMD_ASYNC
? "a" : "")
69 TRACE_EVENT(iwlwifi_dev_rx
,
70 TP_PROTO(struct iwl_priv
*priv
, void *rxbuf
, size_t len
),
71 TP_ARGS(priv
, rxbuf
, len
),
74 __dynamic_array(u8
, rxbuf
, len
)
78 memcpy(__get_dynamic_array(rxbuf
), rxbuf
, len
);
80 TP_printk("[%p] RX cmd %#.2x",
81 __entry
->priv
, ((u8
*)__get_dynamic_array(rxbuf
))[4])
84 TRACE_EVENT(iwlwifi_dev_tx
,
85 TP_PROTO(struct iwl_priv
*priv
, void *tfd
, size_t tfdlen
,
86 void *buf0
, size_t buf0_len
,
87 void *buf1
, size_t buf1_len
),
88 TP_ARGS(priv
, tfd
, tfdlen
, buf0
, buf0_len
, buf1
, buf1_len
),
92 __field(size_t, framelen
)
93 __dynamic_array(u8
, tfd
, tfdlen
)
96 * Do not insert between or below these items,
97 * we want to keep the frame together (except
98 * for the possible padding).
100 __dynamic_array(u8
, buf0
, buf0_len
)
101 __dynamic_array(u8
, buf1
, buf1_len
)
105 __entry
->framelen
= buf0_len
+ buf1_len
;
106 memcpy(__get_dynamic_array(tfd
), tfd
, tfdlen
);
107 memcpy(__get_dynamic_array(buf0
), buf0
, buf0_len
);
108 memcpy(__get_dynamic_array(buf1
), buf1
, buf0_len
);
110 TP_printk("[%p] TX %.2x (%zu bytes)",
112 ((u8
*)__get_dynamic_array(buf0
))[0],
116 TRACE_EVENT(iwlwifi_dev_ucode_error
,
117 TP_PROTO(struct iwl_priv
*priv
, u32 desc
, u32 time
,
118 u32 data1
, u32 data2
, u32 line
, u32 blink1
,
119 u32 blink2
, u32 ilink1
, u32 ilink2
),
120 TP_ARGS(priv
, desc
, time
, data1
, data2
, line
,
121 blink1
, blink2
, ilink1
, ilink2
),
136 __entry
->desc
= desc
;
137 __entry
->time
= time
;
138 __entry
->data1
= data1
;
139 __entry
->data2
= data2
;
140 __entry
->line
= line
;
141 __entry
->blink1
= blink1
;
142 __entry
->blink2
= blink2
;
143 __entry
->ilink1
= ilink1
;
144 __entry
->ilink2
= ilink2
;
146 TP_printk("[%p] #%02d %010u data 0x%08X 0x%08X line %u, "
147 "blink 0x%05X 0x%05X ilink 0x%05X 0x%05X",
148 __entry
->priv
, __entry
->desc
, __entry
->time
, __entry
->data1
,
149 __entry
->data2
, __entry
->line
, __entry
->blink1
,
150 __entry
->blink2
, __entry
->ilink1
, __entry
->ilink2
)
153 TRACE_EVENT(iwlwifi_dev_ucode_event
,
154 TP_PROTO(struct iwl_priv
*priv
, u32 time
, u32 data
, u32 ev
),
155 TP_ARGS(priv
, time
, data
, ev
),
165 __entry
->time
= time
;
166 __entry
->data
= data
;
169 TP_printk("[%p] EVT_LOGT:%010u:0x%08x:%04u",
170 __entry
->priv
, __entry
->time
, __entry
->data
, __entry
->ev
)
172 #endif /* __IWLWIFI_DEVICE_TRACE */
174 #undef TRACE_INCLUDE_PATH
175 #define TRACE_INCLUDE_PATH .
176 #undef TRACE_INCLUDE_FILE
177 #define TRACE_INCLUDE_FILE iwl-devtrace
178 #include <trace/define_trace.h>