1 #if !defined(__MAC80211_DRIVER_TRACE) || defined(TRACE_HEADER_MULTI_READ)
2 #define __MAC80211_DRIVER_TRACE
4 #include <linux/tracepoint.h>
5 #include <net/mac80211.h>
6 #include "ieee80211_i.h"
8 #if !defined(CONFIG_MAC80211_DRIVER_API_TRACER) || defined(__CHECKER__)
10 #define TRACE_EVENT(name, proto, ...) \
11 static inline void trace_ ## name(proto) {}
15 #define TRACE_SYSTEM mac80211
18 #define LOCAL_ENTRY __array(char, wiphy_name, 32)
19 #define LOCAL_ASSIGN strlcpy(__entry->wiphy_name, wiphy_name(local->hw.wiphy), MAXNAME)
20 #define LOCAL_PR_FMT "%s"
21 #define LOCAL_PR_ARG __entry->wiphy_name
23 #define STA_ENTRY __array(char, sta_addr, ETH_ALEN)
24 #define STA_ASSIGN (sta ? memcpy(__entry->sta_addr, sta->addr, ETH_ALEN) : memset(__entry->sta_addr, 0, ETH_ALEN))
25 #define STA_PR_FMT " sta:%pM"
26 #define STA_PR_ARG __entry->sta_addr
28 #define VIF_ENTRY __field(enum nl80211_iftype, vif_type) __field(void *, vif)
29 #define VIF_ASSIGN __entry->vif_type = vif ? vif->type : 0; __entry->vif = vif
30 #define VIF_PR_FMT " vif:%p(%d)"
31 #define VIF_PR_ARG __entry->vif, __entry->vif_type
33 TRACE_EVENT(drv_start
,
34 TP_PROTO(struct ieee80211_local
*local
, int ret
),
49 LOCAL_PR_FMT
, LOCAL_PR_ARG
54 TP_PROTO(struct ieee80211_local
*local
),
67 LOCAL_PR_FMT
, LOCAL_PR_ARG
71 TRACE_EVENT(drv_add_interface
,
72 TP_PROTO(struct ieee80211_local
*local
,
74 struct ieee80211_vif
*vif
,
77 TP_ARGS(local
, addr
, vif
, ret
),
82 __array(char, addr
, 6)
89 memcpy(__entry
->addr
, addr
, 6);
94 LOCAL_PR_FMT VIF_PR_FMT
" addr:%pM ret:%d",
95 LOCAL_PR_ARG
, VIF_PR_ARG
, __entry
->addr
, __entry
->ret
99 TRACE_EVENT(drv_remove_interface
,
100 TP_PROTO(struct ieee80211_local
*local
,
101 const u8
*addr
, struct ieee80211_vif
*vif
),
103 TP_ARGS(local
, addr
, vif
),
108 __array(char, addr
, 6)
114 memcpy(__entry
->addr
, addr
, 6);
118 LOCAL_PR_FMT VIF_PR_FMT
" addr:%pM",
119 LOCAL_PR_ARG
, VIF_PR_ARG
, __entry
->addr
123 TRACE_EVENT(drv_config
,
124 TP_PROTO(struct ieee80211_local
*local
,
128 TP_ARGS(local
, changed
, ret
),
132 __field(u32
, changed
)
138 __entry
->changed
= changed
;
143 LOCAL_PR_FMT
" ch:%#x ret:%d",
144 LOCAL_PR_ARG
, __entry
->changed
, __entry
->ret
148 TRACE_EVENT(drv_bss_info_changed
,
149 TP_PROTO(struct ieee80211_local
*local
,
150 struct ieee80211_vif
*vif
,
151 struct ieee80211_bss_conf
*info
,
154 TP_ARGS(local
, vif
, info
, changed
),
162 __field(bool, shortpre
)
163 __field(bool, shortslot
)
166 __field(u16
, assoc_cap
)
167 __field(u64
, timestamp
)
168 __field(u32
, basic_rates
)
169 __field(u32
, changed
)
175 __entry
->changed
= changed
;
176 __entry
->aid
= info
->aid
;
177 __entry
->assoc
= info
->assoc
;
178 __entry
->shortpre
= info
->use_short_preamble
;
179 __entry
->cts
= info
->use_cts_prot
;
180 __entry
->shortslot
= info
->use_short_slot
;
181 __entry
->dtimper
= info
->dtim_period
;
182 __entry
->bcnint
= info
->beacon_int
;
183 __entry
->assoc_cap
= info
->assoc_capability
;
184 __entry
->timestamp
= info
->timestamp
;
185 __entry
->basic_rates
= info
->basic_rates
;
189 LOCAL_PR_FMT VIF_PR_FMT
" changed:%#x",
190 LOCAL_PR_ARG
, VIF_PR_ARG
, __entry
->changed
194 TRACE_EVENT(drv_prepare_multicast
,
195 TP_PROTO(struct ieee80211_local
*local
, int mc_count
, u64 ret
),
197 TP_ARGS(local
, mc_count
, ret
),
201 __field(int, mc_count
)
207 __entry
->mc_count
= mc_count
;
212 LOCAL_PR_FMT
" prepare mc (%d): %llx",
213 LOCAL_PR_ARG
, __entry
->mc_count
,
214 (unsigned long long) __entry
->ret
218 TRACE_EVENT(drv_configure_filter
,
219 TP_PROTO(struct ieee80211_local
*local
,
220 unsigned int changed_flags
,
221 unsigned int *total_flags
,
224 TP_ARGS(local
, changed_flags
, total_flags
, multicast
),
228 __field(unsigned int, changed
)
229 __field(unsigned int, total
)
230 __field(u64
, multicast
)
235 __entry
->changed
= changed_flags
;
236 __entry
->total
= *total_flags
;
237 __entry
->multicast
= multicast
;
241 LOCAL_PR_FMT
" changed:%#x total:%#x",
242 LOCAL_PR_ARG
, __entry
->changed
, __entry
->total
246 TRACE_EVENT(drv_set_tim
,
247 TP_PROTO(struct ieee80211_local
*local
,
248 struct ieee80211_sta
*sta
, bool set
, int ret
),
250 TP_ARGS(local
, sta
, set
, ret
),
267 LOCAL_PR_FMT STA_PR_FMT
" set:%d ret:%d",
268 LOCAL_PR_ARG
, STA_PR_FMT
, __entry
->set
, __entry
->ret
272 TRACE_EVENT(drv_set_key
,
273 TP_PROTO(struct ieee80211_local
*local
,
274 enum set_key_cmd cmd
, struct ieee80211_vif
*vif
,
275 struct ieee80211_sta
*sta
,
276 struct ieee80211_key_conf
*key
, int ret
),
278 TP_ARGS(local
, cmd
, vif
, sta
, key
, ret
),
284 __field(enum ieee80211_key_alg
, alg
)
285 __field(u8
, hw_key_idx
)
295 __entry
->alg
= key
->alg
;
296 __entry
->flags
= key
->flags
;
297 __entry
->keyidx
= key
->keyidx
;
298 __entry
->hw_key_idx
= key
->hw_key_idx
;
303 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT
" ret:%d",
304 LOCAL_PR_ARG
, VIF_PR_ARG
, STA_PR_ARG
, __entry
->ret
308 TRACE_EVENT(drv_update_tkip_key
,
309 TP_PROTO(struct ieee80211_local
*local
,
310 struct ieee80211_key_conf
*conf
,
311 const u8
*address
, u32 iv32
),
313 TP_ARGS(local
, conf
, address
, iv32
),
323 memcpy(__entry
->addr
, address
, 6);
324 __entry
->iv32
= iv32
;
328 LOCAL_PR_FMT
" addr:%pM iv32:%#x",
329 LOCAL_PR_ARG
, __entry
->addr
, __entry
->iv32
333 TRACE_EVENT(drv_hw_scan
,
334 TP_PROTO(struct ieee80211_local
*local
,
335 struct cfg80211_scan_request
*req
, int ret
),
337 TP_ARGS(local
, req
, ret
),
350 LOCAL_PR_FMT
" ret:%d",
351 LOCAL_PR_ARG
, __entry
->ret
355 TRACE_EVENT(drv_sw_scan_start
,
356 TP_PROTO(struct ieee80211_local
*local
),
369 LOCAL_PR_FMT
, LOCAL_PR_ARG
373 TRACE_EVENT(drv_sw_scan_complete
,
374 TP_PROTO(struct ieee80211_local
*local
),
387 LOCAL_PR_FMT
, LOCAL_PR_ARG
391 TRACE_EVENT(drv_get_stats
,
392 TP_PROTO(struct ieee80211_local
*local
,
393 struct ieee80211_low_level_stats
*stats
,
396 TP_ARGS(local
, stats
, ret
),
401 __field(unsigned int, ackfail
)
402 __field(unsigned int, rtsfail
)
403 __field(unsigned int, fcserr
)
404 __field(unsigned int, rtssucc
)
410 __entry
->ackfail
= stats
->dot11ACKFailureCount
;
411 __entry
->rtsfail
= stats
->dot11RTSFailureCount
;
412 __entry
->fcserr
= stats
->dot11FCSErrorCount
;
413 __entry
->rtssucc
= stats
->dot11RTSSuccessCount
;
417 LOCAL_PR_FMT
" ret:%d",
418 LOCAL_PR_ARG
, __entry
->ret
422 TRACE_EVENT(drv_get_tkip_seq
,
423 TP_PROTO(struct ieee80211_local
*local
,
424 u8 hw_key_idx
, u32
*iv32
, u16
*iv16
),
426 TP_ARGS(local
, hw_key_idx
, iv32
, iv16
),
430 __field(u8
, hw_key_idx
)
437 __entry
->hw_key_idx
= hw_key_idx
;
438 __entry
->iv32
= *iv32
;
439 __entry
->iv16
= *iv16
;
443 LOCAL_PR_FMT
, LOCAL_PR_ARG
447 TRACE_EVENT(drv_set_rts_threshold
,
448 TP_PROTO(struct ieee80211_local
*local
, u32 value
, int ret
),
450 TP_ARGS(local
, value
, ret
),
461 __entry
->value
= value
;
465 LOCAL_PR_FMT
" value:%d ret:%d",
466 LOCAL_PR_ARG
, __entry
->value
, __entry
->ret
470 TRACE_EVENT(drv_sta_notify
,
471 TP_PROTO(struct ieee80211_local
*local
,
472 struct ieee80211_vif
*vif
,
473 enum sta_notify_cmd cmd
,
474 struct ieee80211_sta
*sta
),
476 TP_ARGS(local
, vif
, cmd
, sta
),
493 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT
" cmd:%d",
494 LOCAL_PR_ARG
, VIF_PR_ARG
, STA_PR_ARG
, __entry
->cmd
498 TRACE_EVENT(drv_conf_tx
,
499 TP_PROTO(struct ieee80211_local
*local
, u16 queue
,
500 const struct ieee80211_tx_queue_params
*params
,
503 TP_ARGS(local
, queue
, params
, ret
),
517 __entry
->queue
= queue
;
519 __entry
->txop
= params
->txop
;
520 __entry
->cw_max
= params
->cw_max
;
521 __entry
->cw_min
= params
->cw_min
;
522 __entry
->aifs
= params
->aifs
;
526 LOCAL_PR_FMT
" queue:%d ret:%d",
527 LOCAL_PR_ARG
, __entry
->queue
, __entry
->ret
531 TRACE_EVENT(drv_get_tx_stats
,
532 TP_PROTO(struct ieee80211_local
*local
,
533 struct ieee80211_tx_queue_stats
*stats
,
536 TP_ARGS(local
, stats
, ret
),
549 LOCAL_PR_FMT
" ret:%d",
550 LOCAL_PR_ARG
, __entry
->ret
554 TRACE_EVENT(drv_get_tsf
,
555 TP_PROTO(struct ieee80211_local
*local
, u64 ret
),
570 LOCAL_PR_FMT
" ret:%llu",
571 LOCAL_PR_ARG
, (unsigned long long)__entry
->ret
575 TRACE_EVENT(drv_set_tsf
,
576 TP_PROTO(struct ieee80211_local
*local
, u64 tsf
),
591 LOCAL_PR_FMT
" tsf:%llu",
592 LOCAL_PR_ARG
, (unsigned long long)__entry
->tsf
596 TRACE_EVENT(drv_reset_tsf
,
597 TP_PROTO(struct ieee80211_local
*local
),
610 LOCAL_PR_FMT
, LOCAL_PR_ARG
614 TRACE_EVENT(drv_tx_last_beacon
,
615 TP_PROTO(struct ieee80211_local
*local
, int ret
),
630 LOCAL_PR_FMT
" ret:%d",
631 LOCAL_PR_ARG
, __entry
->ret
635 TRACE_EVENT(drv_ampdu_action
,
636 TP_PROTO(struct ieee80211_local
*local
,
637 struct ieee80211_vif
*vif
,
638 enum ieee80211_ampdu_mlme_action action
,
639 struct ieee80211_sta
*sta
, u16 tid
,
642 TP_ARGS(local
, vif
, action
, sta
, tid
, ssn
, ret
),
659 __entry
->action
= action
;
665 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT
" action:%d tid:%d ret:%d",
666 LOCAL_PR_ARG
, VIF_PR_ARG
, STA_PR_ARG
, __entry
->action
, __entry
->tid
, __entry
->ret
669 #endif /* !__MAC80211_DRIVER_TRACE || TRACE_HEADER_MULTI_READ */
671 #undef TRACE_INCLUDE_PATH
672 #define TRACE_INCLUDE_PATH .
673 #undef TRACE_INCLUDE_FILE
674 #define TRACE_INCLUDE_FILE driver-trace
675 #include <trace/define_trace.h>