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 *, sdata) \
29 __string(vif_name, sdata->dev ? sdata->dev->name : "<nodev>")
30 #define VIF_ASSIGN __entry->vif_type = sdata->vif.type; __entry->sdata = sdata; \
31 __assign_str(vif_name, sdata->dev ? sdata->dev->name : "<nodev>")
32 #define VIF_PR_FMT " vif:%s(%d)"
33 #define VIF_PR_ARG __get_str(vif_name), __entry->vif_type
35 TRACE_EVENT(drv_start
,
36 TP_PROTO(struct ieee80211_local
*local
, int ret
),
51 LOCAL_PR_FMT
, LOCAL_PR_ARG
56 TP_PROTO(struct ieee80211_local
*local
),
69 LOCAL_PR_FMT
, LOCAL_PR_ARG
73 TRACE_EVENT(drv_add_interface
,
74 TP_PROTO(struct ieee80211_local
*local
,
75 struct ieee80211_sub_if_data
*sdata
,
78 TP_ARGS(local
, sdata
, ret
),
83 __array(char, addr
, 6)
90 memcpy(__entry
->addr
, sdata
->vif
.addr
, 6);
95 LOCAL_PR_FMT VIF_PR_FMT
" addr:%pM ret:%d",
96 LOCAL_PR_ARG
, VIF_PR_ARG
, __entry
->addr
, __entry
->ret
100 TRACE_EVENT(drv_remove_interface
,
101 TP_PROTO(struct ieee80211_local
*local
, struct ieee80211_sub_if_data
*sdata
),
103 TP_ARGS(local
, sdata
),
108 __array(char, addr
, 6)
114 memcpy(__entry
->addr
, sdata
->vif
.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
)
135 __field(int, power_level
)
136 __field(int, dynamic_ps_timeout
)
137 __field(int, max_sleep_period
)
138 __field(u16
, listen_interval
)
139 __field(u8
, long_frame_max_tx_count
)
140 __field(u8
, short_frame_max_tx_count
)
141 __field(int, center_freq
)
142 __field(int, channel_type
)
148 __entry
->changed
= changed
;
150 __entry
->flags
= local
->hw
.conf
.flags
;
151 __entry
->power_level
= local
->hw
.conf
.power_level
;
152 __entry
->dynamic_ps_timeout
= local
->hw
.conf
.dynamic_ps_timeout
;
153 __entry
->max_sleep_period
= local
->hw
.conf
.max_sleep_period
;
154 __entry
->listen_interval
= local
->hw
.conf
.listen_interval
;
155 __entry
->long_frame_max_tx_count
= local
->hw
.conf
.long_frame_max_tx_count
;
156 __entry
->short_frame_max_tx_count
= local
->hw
.conf
.short_frame_max_tx_count
;
157 __entry
->center_freq
= local
->hw
.conf
.channel
->center_freq
;
158 __entry
->channel_type
= local
->hw
.conf
.channel_type
;
159 __entry
->smps
= local
->hw
.conf
.smps_mode
;
163 LOCAL_PR_FMT
" ch:%#x freq:%d ret:%d",
164 LOCAL_PR_ARG
, __entry
->changed
, __entry
->center_freq
, __entry
->ret
168 TRACE_EVENT(drv_bss_info_changed
,
169 TP_PROTO(struct ieee80211_local
*local
,
170 struct ieee80211_sub_if_data
*sdata
,
171 struct ieee80211_bss_conf
*info
,
174 TP_ARGS(local
, sdata
, info
, changed
),
182 __field(bool, shortpre
)
183 __field(bool, shortslot
)
186 __field(u16
, assoc_cap
)
187 __field(u64
, timestamp
)
188 __field(u32
, basic_rates
)
189 __field(u32
, changed
)
190 __field(bool, enable_beacon
)
191 __field(u16
, ht_operation_mode
)
197 __entry
->changed
= changed
;
198 __entry
->aid
= info
->aid
;
199 __entry
->assoc
= info
->assoc
;
200 __entry
->shortpre
= info
->use_short_preamble
;
201 __entry
->cts
= info
->use_cts_prot
;
202 __entry
->shortslot
= info
->use_short_slot
;
203 __entry
->dtimper
= info
->dtim_period
;
204 __entry
->bcnint
= info
->beacon_int
;
205 __entry
->assoc_cap
= info
->assoc_capability
;
206 __entry
->timestamp
= info
->timestamp
;
207 __entry
->basic_rates
= info
->basic_rates
;
208 __entry
->enable_beacon
= info
->enable_beacon
;
209 __entry
->ht_operation_mode
= info
->ht_operation_mode
;
213 LOCAL_PR_FMT VIF_PR_FMT
" changed:%#x",
214 LOCAL_PR_ARG
, VIF_PR_ARG
, __entry
->changed
218 TRACE_EVENT(drv_prepare_multicast
,
219 TP_PROTO(struct ieee80211_local
*local
, int mc_count
, u64 ret
),
221 TP_ARGS(local
, mc_count
, ret
),
225 __field(int, mc_count
)
231 __entry
->mc_count
= mc_count
;
236 LOCAL_PR_FMT
" prepare mc (%d): %llx",
237 LOCAL_PR_ARG
, __entry
->mc_count
,
238 (unsigned long long) __entry
->ret
242 TRACE_EVENT(drv_configure_filter
,
243 TP_PROTO(struct ieee80211_local
*local
,
244 unsigned int changed_flags
,
245 unsigned int *total_flags
,
248 TP_ARGS(local
, changed_flags
, total_flags
, multicast
),
252 __field(unsigned int, changed
)
253 __field(unsigned int, total
)
254 __field(u64
, multicast
)
259 __entry
->changed
= changed_flags
;
260 __entry
->total
= *total_flags
;
261 __entry
->multicast
= multicast
;
265 LOCAL_PR_FMT
" changed:%#x total:%#x",
266 LOCAL_PR_ARG
, __entry
->changed
, __entry
->total
270 TRACE_EVENT(drv_set_tim
,
271 TP_PROTO(struct ieee80211_local
*local
,
272 struct ieee80211_sta
*sta
, bool set
, int ret
),
274 TP_ARGS(local
, sta
, set
, ret
),
291 LOCAL_PR_FMT STA_PR_FMT
" set:%d ret:%d",
292 LOCAL_PR_ARG
, STA_PR_FMT
, __entry
->set
, __entry
->ret
296 TRACE_EVENT(drv_set_key
,
297 TP_PROTO(struct ieee80211_local
*local
,
298 enum set_key_cmd cmd
, struct ieee80211_sub_if_data
*sdata
,
299 struct ieee80211_sta
*sta
,
300 struct ieee80211_key_conf
*key
, int ret
),
302 TP_ARGS(local
, cmd
, sdata
, sta
, key
, ret
),
308 __field(enum ieee80211_key_alg
, alg
)
309 __field(u8
, hw_key_idx
)
319 __entry
->alg
= key
->alg
;
320 __entry
->flags
= key
->flags
;
321 __entry
->keyidx
= key
->keyidx
;
322 __entry
->hw_key_idx
= key
->hw_key_idx
;
327 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT
" ret:%d",
328 LOCAL_PR_ARG
, VIF_PR_ARG
, STA_PR_ARG
, __entry
->ret
332 TRACE_EVENT(drv_update_tkip_key
,
333 TP_PROTO(struct ieee80211_local
*local
,
334 struct ieee80211_sub_if_data
*sdata
,
335 struct ieee80211_key_conf
*conf
,
336 struct ieee80211_sta
*sta
, u32 iv32
),
338 TP_ARGS(local
, sdata
, conf
, sta
, iv32
),
351 __entry
->iv32
= iv32
;
355 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT
" iv32:%#x",
356 LOCAL_PR_ARG
,VIF_PR_ARG
,STA_PR_ARG
, __entry
->iv32
360 TRACE_EVENT(drv_hw_scan
,
361 TP_PROTO(struct ieee80211_local
*local
,
362 struct cfg80211_scan_request
*req
, int ret
),
364 TP_ARGS(local
, req
, ret
),
377 LOCAL_PR_FMT
" ret:%d",
378 LOCAL_PR_ARG
, __entry
->ret
382 TRACE_EVENT(drv_sw_scan_start
,
383 TP_PROTO(struct ieee80211_local
*local
),
396 LOCAL_PR_FMT
, LOCAL_PR_ARG
400 TRACE_EVENT(drv_sw_scan_complete
,
401 TP_PROTO(struct ieee80211_local
*local
),
414 LOCAL_PR_FMT
, LOCAL_PR_ARG
418 TRACE_EVENT(drv_get_stats
,
419 TP_PROTO(struct ieee80211_local
*local
,
420 struct ieee80211_low_level_stats
*stats
,
423 TP_ARGS(local
, stats
, ret
),
428 __field(unsigned int, ackfail
)
429 __field(unsigned int, rtsfail
)
430 __field(unsigned int, fcserr
)
431 __field(unsigned int, rtssucc
)
437 __entry
->ackfail
= stats
->dot11ACKFailureCount
;
438 __entry
->rtsfail
= stats
->dot11RTSFailureCount
;
439 __entry
->fcserr
= stats
->dot11FCSErrorCount
;
440 __entry
->rtssucc
= stats
->dot11RTSSuccessCount
;
444 LOCAL_PR_FMT
" ret:%d",
445 LOCAL_PR_ARG
, __entry
->ret
449 TRACE_EVENT(drv_get_tkip_seq
,
450 TP_PROTO(struct ieee80211_local
*local
,
451 u8 hw_key_idx
, u32
*iv32
, u16
*iv16
),
453 TP_ARGS(local
, hw_key_idx
, iv32
, iv16
),
457 __field(u8
, hw_key_idx
)
464 __entry
->hw_key_idx
= hw_key_idx
;
465 __entry
->iv32
= *iv32
;
466 __entry
->iv16
= *iv16
;
470 LOCAL_PR_FMT
, LOCAL_PR_ARG
474 TRACE_EVENT(drv_set_rts_threshold
,
475 TP_PROTO(struct ieee80211_local
*local
, u32 value
, int ret
),
477 TP_ARGS(local
, value
, ret
),
488 __entry
->value
= value
;
492 LOCAL_PR_FMT
" value:%d ret:%d",
493 LOCAL_PR_ARG
, __entry
->value
, __entry
->ret
497 TRACE_EVENT(drv_set_coverage_class
,
498 TP_PROTO(struct ieee80211_local
*local
, u8 value
, int ret
),
500 TP_ARGS(local
, value
, ret
),
511 __entry
->value
= value
;
515 LOCAL_PR_FMT
" value:%d ret:%d",
516 LOCAL_PR_ARG
, __entry
->value
, __entry
->ret
520 TRACE_EVENT(drv_sta_notify
,
521 TP_PROTO(struct ieee80211_local
*local
,
522 struct ieee80211_sub_if_data
*sdata
,
523 enum sta_notify_cmd cmd
,
524 struct ieee80211_sta
*sta
),
526 TP_ARGS(local
, sdata
, cmd
, sta
),
543 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT
" cmd:%d",
544 LOCAL_PR_ARG
, VIF_PR_ARG
, STA_PR_ARG
, __entry
->cmd
548 TRACE_EVENT(drv_sta_add
,
549 TP_PROTO(struct ieee80211_local
*local
,
550 struct ieee80211_sub_if_data
*sdata
,
551 struct ieee80211_sta
*sta
, int ret
),
553 TP_ARGS(local
, sdata
, sta
, ret
),
570 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT
" ret:%d",
571 LOCAL_PR_ARG
, VIF_PR_ARG
, STA_PR_ARG
, __entry
->ret
575 TRACE_EVENT(drv_sta_remove
,
576 TP_PROTO(struct ieee80211_local
*local
,
577 struct ieee80211_sub_if_data
*sdata
,
578 struct ieee80211_sta
*sta
),
580 TP_ARGS(local
, sdata
, sta
),
595 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT
,
596 LOCAL_PR_ARG
, VIF_PR_ARG
, STA_PR_ARG
600 TRACE_EVENT(drv_conf_tx
,
601 TP_PROTO(struct ieee80211_local
*local
, u16 queue
,
602 const struct ieee80211_tx_queue_params
*params
,
605 TP_ARGS(local
, queue
, params
, ret
),
619 __entry
->queue
= queue
;
621 __entry
->txop
= params
->txop
;
622 __entry
->cw_max
= params
->cw_max
;
623 __entry
->cw_min
= params
->cw_min
;
624 __entry
->aifs
= params
->aifs
;
628 LOCAL_PR_FMT
" queue:%d ret:%d",
629 LOCAL_PR_ARG
, __entry
->queue
, __entry
->ret
633 TRACE_EVENT(drv_get_tsf
,
634 TP_PROTO(struct ieee80211_local
*local
, u64 ret
),
649 LOCAL_PR_FMT
" ret:%llu",
650 LOCAL_PR_ARG
, (unsigned long long)__entry
->ret
654 TRACE_EVENT(drv_set_tsf
,
655 TP_PROTO(struct ieee80211_local
*local
, u64 tsf
),
670 LOCAL_PR_FMT
" tsf:%llu",
671 LOCAL_PR_ARG
, (unsigned long long)__entry
->tsf
675 TRACE_EVENT(drv_reset_tsf
,
676 TP_PROTO(struct ieee80211_local
*local
),
689 LOCAL_PR_FMT
, LOCAL_PR_ARG
693 TRACE_EVENT(drv_tx_last_beacon
,
694 TP_PROTO(struct ieee80211_local
*local
, int ret
),
709 LOCAL_PR_FMT
" ret:%d",
710 LOCAL_PR_ARG
, __entry
->ret
714 TRACE_EVENT(drv_ampdu_action
,
715 TP_PROTO(struct ieee80211_local
*local
,
716 struct ieee80211_sub_if_data
*sdata
,
717 enum ieee80211_ampdu_mlme_action action
,
718 struct ieee80211_sta
*sta
, u16 tid
,
721 TP_ARGS(local
, sdata
, action
, sta
, tid
, ssn
, ret
),
738 __entry
->action
= action
;
740 __entry
->ssn
= ssn
? *ssn
: 0;
744 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT
" action:%d tid:%d ret:%d",
745 LOCAL_PR_ARG
, VIF_PR_ARG
, STA_PR_ARG
, __entry
->action
, __entry
->tid
, __entry
->ret
749 TRACE_EVENT(drv_flush
,
750 TP_PROTO(struct ieee80211_local
*local
, bool drop
),
752 TP_ARGS(local
, drop
),
761 __entry
->drop
= drop
;
765 LOCAL_PR_FMT
" drop:%d",
766 LOCAL_PR_ARG
, __entry
->drop
769 #endif /* !__MAC80211_DRIVER_TRACE || TRACE_HEADER_MULTI_READ */
771 #undef TRACE_INCLUDE_PATH
772 #define TRACE_INCLUDE_PATH .
773 #undef TRACE_INCLUDE_FILE
774 #define TRACE_INCLUDE_FILE driver-trace
775 #include <trace/define_trace.h>