1 #if !defined(__MAC80211_DRIVER_TRACE) || defined(TRACE_HEADER_MULTI_READ)
2 #define __MAC80211_DRIVER_TRACE
4 #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,27))
5 #include <linux/tracepoint.h>
6 #endif /* (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,27)) */
7 #include <net/mac80211.h>
8 #include "ieee80211_i.h"
10 #if !defined(CONFIG_MAC80211_DRIVER_API_TRACER) || defined(__CHECKER__)
12 #define TRACE_EVENT(name, proto, ...) \
13 static inline void trace_ ## name(proto) {}
17 #define TRACE_SYSTEM mac80211
20 #define LOCAL_ENTRY __array(char, wiphy_name, 32)
21 #define LOCAL_ASSIGN strlcpy(__entry->wiphy_name, wiphy_name(local->hw.wiphy), MAXNAME)
22 #define LOCAL_PR_FMT "%s"
23 #define LOCAL_PR_ARG __entry->wiphy_name
25 #define STA_ENTRY __array(char, sta_addr, ETH_ALEN)
26 #define STA_ASSIGN (sta ? memcpy(__entry->sta_addr, sta->addr, ETH_ALEN) : memset(__entry->sta_addr, 0, ETH_ALEN))
27 #define STA_PR_FMT " sta:%pM"
28 #define STA_PR_ARG __entry->sta_addr
30 #define VIF_ENTRY __field(enum nl80211_iftype, vif_type) __field(void *, sdata) \
31 __string(vif_name, sdata->dev ? sdata->dev->name : "<nodev>")
32 #define VIF_ASSIGN __entry->vif_type = sdata->vif.type; __entry->sdata = sdata; \
33 __assign_str(vif_name, sdata->dev ? sdata->dev->name : "<nodev>")
34 #define VIF_PR_FMT " vif:%s(%d)"
35 #define VIF_PR_ARG __get_str(vif_name), __entry->vif_type
37 TRACE_EVENT(drv_start,
38 TP_PROTO(struct ieee80211_local *local, int ret),
53 LOCAL_PR_FMT, LOCAL_PR_ARG
58 TP_PROTO(struct ieee80211_local *local),
71 LOCAL_PR_FMT, LOCAL_PR_ARG
75 TRACE_EVENT(drv_add_interface,
76 TP_PROTO(struct ieee80211_local *local,
77 struct ieee80211_sub_if_data *sdata,
80 TP_ARGS(local, sdata, ret),
85 __array(char, addr, 6)
92 memcpy(__entry->addr, sdata->vif.addr, 6);
97 LOCAL_PR_FMT VIF_PR_FMT " addr:%pM ret:%d",
98 LOCAL_PR_ARG, VIF_PR_ARG, __entry->addr, __entry->ret
102 TRACE_EVENT(drv_remove_interface,
103 TP_PROTO(struct ieee80211_local *local, struct ieee80211_sub_if_data *sdata),
105 TP_ARGS(local, sdata),
110 __array(char, addr, 6)
116 memcpy(__entry->addr, sdata->vif.addr, 6);
120 LOCAL_PR_FMT VIF_PR_FMT " addr:%pM",
121 LOCAL_PR_ARG, VIF_PR_ARG, __entry->addr
125 TRACE_EVENT(drv_config,
126 TP_PROTO(struct ieee80211_local *local,
130 TP_ARGS(local, changed, ret),
134 __field(u32, changed)
137 __field(int, power_level)
138 __field(int, dynamic_ps_timeout)
139 __field(int, max_sleep_period)
140 __field(u16, listen_interval)
141 __field(u8, long_frame_max_tx_count)
142 __field(u8, short_frame_max_tx_count)
143 __field(int, center_freq)
144 __field(int, channel_type)
150 __entry->changed = changed;
152 __entry->flags = local->hw.conf.flags;
153 __entry->power_level = local->hw.conf.power_level;
154 __entry->dynamic_ps_timeout = local->hw.conf.dynamic_ps_timeout;
155 __entry->max_sleep_period = local->hw.conf.max_sleep_period;
156 __entry->listen_interval = local->hw.conf.listen_interval;
157 __entry->long_frame_max_tx_count = local->hw.conf.long_frame_max_tx_count;
158 __entry->short_frame_max_tx_count = local->hw.conf.short_frame_max_tx_count;
159 __entry->center_freq = local->hw.conf.channel->center_freq;
160 __entry->channel_type = local->hw.conf.channel_type;
161 __entry->smps = local->hw.conf.smps_mode;
165 LOCAL_PR_FMT " ch:%#x freq:%d ret:%d",
166 LOCAL_PR_ARG, __entry->changed, __entry->center_freq, __entry->ret
170 TRACE_EVENT(drv_bss_info_changed,
171 TP_PROTO(struct ieee80211_local *local,
172 struct ieee80211_sub_if_data *sdata,
173 struct ieee80211_bss_conf *info,
176 TP_ARGS(local, sdata, info, changed),
184 __field(bool, shortpre)
185 __field(bool, shortslot)
188 __field(u16, assoc_cap)
189 __field(u64, timestamp)
190 __field(u32, basic_rates)
191 __field(u32, changed)
192 __field(bool, enable_beacon)
193 __field(u16, ht_operation_mode)
199 __entry->changed = changed;
200 __entry->aid = info->aid;
201 __entry->assoc = info->assoc;
202 __entry->shortpre = info->use_short_preamble;
203 __entry->cts = info->use_cts_prot;
204 __entry->shortslot = info->use_short_slot;
205 __entry->dtimper = info->dtim_period;
206 __entry->bcnint = info->beacon_int;
207 __entry->assoc_cap = info->assoc_capability;
208 __entry->timestamp = info->timestamp;
209 __entry->basic_rates = info->basic_rates;
210 __entry->enable_beacon = info->enable_beacon;
211 __entry->ht_operation_mode = info->ht_operation_mode;
215 LOCAL_PR_FMT VIF_PR_FMT " changed:%#x",
216 LOCAL_PR_ARG, VIF_PR_ARG, __entry->changed
220 TRACE_EVENT(drv_prepare_multicast,
221 TP_PROTO(struct ieee80211_local *local, int mc_count, u64 ret),
223 TP_ARGS(local, mc_count, ret),
227 __field(int, mc_count)
233 __entry->mc_count = mc_count;
238 LOCAL_PR_FMT " prepare mc (%d): %llx",
239 LOCAL_PR_ARG, __entry->mc_count,
240 (unsigned long long) __entry->ret
244 TRACE_EVENT(drv_configure_filter,
245 TP_PROTO(struct ieee80211_local *local,
246 unsigned int changed_flags,
247 unsigned int *total_flags,
250 TP_ARGS(local, changed_flags, total_flags, multicast),
254 __field(unsigned int, changed)
255 __field(unsigned int, total)
256 __field(u64, multicast)
261 __entry->changed = changed_flags;
262 __entry->total = *total_flags;
263 __entry->multicast = multicast;
267 LOCAL_PR_FMT " changed:%#x total:%#x",
268 LOCAL_PR_ARG, __entry->changed, __entry->total
272 TRACE_EVENT(drv_set_tim,
273 TP_PROTO(struct ieee80211_local *local,
274 struct ieee80211_sta *sta, bool set, int ret),
276 TP_ARGS(local, sta, set, ret),
293 LOCAL_PR_FMT STA_PR_FMT " set:%d ret:%d",
294 LOCAL_PR_ARG, STA_PR_FMT, __entry->set, __entry->ret
298 TRACE_EVENT(drv_set_key,
299 TP_PROTO(struct ieee80211_local *local,
300 enum set_key_cmd cmd, struct ieee80211_sub_if_data *sdata,
301 struct ieee80211_sta *sta,
302 struct ieee80211_key_conf *key, int ret),
304 TP_ARGS(local, cmd, sdata, sta, key, ret),
310 __field(enum ieee80211_key_alg, alg)
311 __field(u8, hw_key_idx)
321 __entry->alg = key->alg;
322 __entry->flags = key->flags;
323 __entry->keyidx = key->keyidx;
324 __entry->hw_key_idx = key->hw_key_idx;
329 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " ret:%d",
330 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->ret
334 TRACE_EVENT(drv_update_tkip_key,
335 TP_PROTO(struct ieee80211_local *local,
336 struct ieee80211_sub_if_data *sdata,
337 struct ieee80211_key_conf *conf,
338 struct ieee80211_sta *sta, u32 iv32),
340 TP_ARGS(local, sdata, conf, sta, iv32),
353 __entry->iv32 = iv32;
357 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " iv32:%#x",
358 LOCAL_PR_ARG,VIF_PR_ARG,STA_PR_ARG, __entry->iv32
362 TRACE_EVENT(drv_hw_scan,
363 TP_PROTO(struct ieee80211_local *local,
364 struct cfg80211_scan_request *req, int ret),
366 TP_ARGS(local, req, ret),
379 LOCAL_PR_FMT " ret:%d",
380 LOCAL_PR_ARG, __entry->ret
384 TRACE_EVENT(drv_sw_scan_start,
385 TP_PROTO(struct ieee80211_local *local),
398 LOCAL_PR_FMT, LOCAL_PR_ARG
402 TRACE_EVENT(drv_sw_scan_complete,
403 TP_PROTO(struct ieee80211_local *local),
416 LOCAL_PR_FMT, LOCAL_PR_ARG
420 TRACE_EVENT(drv_get_stats,
421 TP_PROTO(struct ieee80211_local *local,
422 struct ieee80211_low_level_stats *stats,
425 TP_ARGS(local, stats, ret),
430 __field(unsigned int, ackfail)
431 __field(unsigned int, rtsfail)
432 __field(unsigned int, fcserr)
433 __field(unsigned int, rtssucc)
439 __entry->ackfail = stats->dot11ACKFailureCount;
440 __entry->rtsfail = stats->dot11RTSFailureCount;
441 __entry->fcserr = stats->dot11FCSErrorCount;
442 __entry->rtssucc = stats->dot11RTSSuccessCount;
446 LOCAL_PR_FMT " ret:%d",
447 LOCAL_PR_ARG, __entry->ret
451 TRACE_EVENT(drv_get_tkip_seq,
452 TP_PROTO(struct ieee80211_local *local,
453 u8 hw_key_idx, u32 *iv32, u16 *iv16),
455 TP_ARGS(local, hw_key_idx, iv32, iv16),
459 __field(u8, hw_key_idx)
466 __entry->hw_key_idx = hw_key_idx;
467 __entry->iv32 = *iv32;
468 __entry->iv16 = *iv16;
472 LOCAL_PR_FMT, LOCAL_PR_ARG
476 TRACE_EVENT(drv_set_rts_threshold,
477 TP_PROTO(struct ieee80211_local *local, u32 value, int ret),
479 TP_ARGS(local, value, ret),
490 __entry->value = value;
494 LOCAL_PR_FMT " value:%d ret:%d",
495 LOCAL_PR_ARG, __entry->value, __entry->ret
499 TRACE_EVENT(drv_set_coverage_class,
500 TP_PROTO(struct ieee80211_local *local, u8 value, int ret),
502 TP_ARGS(local, value, ret),
513 __entry->value = value;
517 LOCAL_PR_FMT " value:%d ret:%d",
518 LOCAL_PR_ARG, __entry->value, __entry->ret
522 TRACE_EVENT(drv_sta_notify,
523 TP_PROTO(struct ieee80211_local *local,
524 struct ieee80211_sub_if_data *sdata,
525 enum sta_notify_cmd cmd,
526 struct ieee80211_sta *sta),
528 TP_ARGS(local, sdata, cmd, sta),
545 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " cmd:%d",
546 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->cmd
550 TRACE_EVENT(drv_sta_add,
551 TP_PROTO(struct ieee80211_local *local,
552 struct ieee80211_sub_if_data *sdata,
553 struct ieee80211_sta *sta, int ret),
555 TP_ARGS(local, sdata, sta, ret),
572 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " ret:%d",
573 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->ret
577 TRACE_EVENT(drv_sta_remove,
578 TP_PROTO(struct ieee80211_local *local,
579 struct ieee80211_sub_if_data *sdata,
580 struct ieee80211_sta *sta),
582 TP_ARGS(local, sdata, sta),
597 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT,
598 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG
602 TRACE_EVENT(drv_conf_tx,
603 TP_PROTO(struct ieee80211_local *local, u16 queue,
604 const struct ieee80211_tx_queue_params *params,
607 TP_ARGS(local, queue, params, ret),
621 __entry->queue = queue;
623 __entry->txop = params->txop;
624 __entry->cw_max = params->cw_max;
625 __entry->cw_min = params->cw_min;
626 __entry->aifs = params->aifs;
630 LOCAL_PR_FMT " queue:%d ret:%d",
631 LOCAL_PR_ARG, __entry->queue, __entry->ret
635 TRACE_EVENT(drv_get_tsf,
636 TP_PROTO(struct ieee80211_local *local, u64 ret),
651 LOCAL_PR_FMT " ret:%llu",
652 LOCAL_PR_ARG, (unsigned long long)__entry->ret
656 TRACE_EVENT(drv_set_tsf,
657 TP_PROTO(struct ieee80211_local *local, u64 tsf),
672 LOCAL_PR_FMT " tsf:%llu",
673 LOCAL_PR_ARG, (unsigned long long)__entry->tsf
677 TRACE_EVENT(drv_reset_tsf,
678 TP_PROTO(struct ieee80211_local *local),
691 LOCAL_PR_FMT, LOCAL_PR_ARG
695 TRACE_EVENT(drv_tx_last_beacon,
696 TP_PROTO(struct ieee80211_local *local, int ret),
711 LOCAL_PR_FMT " ret:%d",
712 LOCAL_PR_ARG, __entry->ret
716 TRACE_EVENT(drv_ampdu_action,
717 TP_PROTO(struct ieee80211_local *local,
718 struct ieee80211_sub_if_data *sdata,
719 enum ieee80211_ampdu_mlme_action action,
720 struct ieee80211_sta *sta, u16 tid,
723 TP_ARGS(local, sdata, action, sta, tid, ssn, ret),
740 __entry->action = action;
742 __entry->ssn = ssn ? *ssn : 0;
746 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " action:%d tid:%d ret:%d",
747 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->action, __entry->tid, __entry->ret
751 TRACE_EVENT(drv_flush,
752 TP_PROTO(struct ieee80211_local *local, bool drop),
754 TP_ARGS(local, drop),
763 __entry->drop = drop;
767 LOCAL_PR_FMT " drop:%d",
768 LOCAL_PR_ARG, __entry->drop
771 #endif /* !__MAC80211_DRIVER_TRACE || TRACE_HEADER_MULTI_READ */
773 #undef TRACE_INCLUDE_PATH
774 #define TRACE_INCLUDE_PATH .
775 #undef TRACE_INCLUDE_FILE
776 #define TRACE_INCLUDE_FILE driver-trace
777 #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,30))
778 #include <trace/define_trace.h>
779 #endif /* (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,30)) */