diff options
author | Luciano Coelho <coelho@ti.com> | 2011-05-09 07:40:06 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-05-11 14:50:38 -0400 |
commit | 92ddc111c4bc7216673bce7c49a2d54bedb1593c (patch) | |
tree | 05460bd8b32bcc1cf041a5f902fcbe099599f866 /net/mac80211 | |
parent | d381f221199c58d2bf25a7024e786fc58562487c (diff) |
mac80211: add a couple of trace event classes to reduce duplicated code
The functions drv_add_interface() and drv_remove_interface() print out
the same values in the traces. Combine the traces of these two
functions into one event class to remove some duplicate code.
Also add a new class for functions drv_set_frag_threshold() and
drv_set_rts_threshold().
Cc: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/driver-trace.h | 130 |
1 files changed, 53 insertions, 77 deletions
diff --git a/net/mac80211/driver-trace.h b/net/mac80211/driver-trace.h index 11e1ea5111ea..dd9779d41d2b 100644 --- a/net/mac80211/driver-trace.h +++ b/net/mac80211/driver-trace.h | |||
@@ -55,6 +55,49 @@ DECLARE_EVENT_CLASS(local_only_evt, | |||
55 | TP_printk(LOCAL_PR_FMT, LOCAL_PR_ARG) | 55 | TP_printk(LOCAL_PR_FMT, LOCAL_PR_ARG) |
56 | ); | 56 | ); |
57 | 57 | ||
58 | DECLARE_EVENT_CLASS(local_sdata_addr_evt, | ||
59 | TP_PROTO(struct ieee80211_local *local, | ||
60 | struct ieee80211_sub_if_data *sdata), | ||
61 | TP_ARGS(local, sdata), | ||
62 | |||
63 | TP_STRUCT__entry( | ||
64 | LOCAL_ENTRY | ||
65 | VIF_ENTRY | ||
66 | __array(char, addr, 6) | ||
67 | ), | ||
68 | |||
69 | TP_fast_assign( | ||
70 | LOCAL_ASSIGN; | ||
71 | VIF_ASSIGN; | ||
72 | memcpy(__entry->addr, sdata->vif.addr, 6); | ||
73 | ), | ||
74 | |||
75 | TP_printk( | ||
76 | LOCAL_PR_FMT VIF_PR_FMT " addr:%pM", | ||
77 | LOCAL_PR_ARG, VIF_PR_ARG, __entry->addr | ||
78 | ) | ||
79 | ); | ||
80 | |||
81 | DECLARE_EVENT_CLASS(local_u32_evt, | ||
82 | TP_PROTO(struct ieee80211_local *local, u32 value), | ||
83 | TP_ARGS(local, value), | ||
84 | |||
85 | TP_STRUCT__entry( | ||
86 | LOCAL_ENTRY | ||
87 | __field(u32, value) | ||
88 | ), | ||
89 | |||
90 | TP_fast_assign( | ||
91 | LOCAL_ASSIGN; | ||
92 | __entry->value = value; | ||
93 | ), | ||
94 | |||
95 | TP_printk( | ||
96 | LOCAL_PR_FMT " value:%d", | ||
97 | LOCAL_PR_ARG, __entry->value | ||
98 | ) | ||
99 | ); | ||
100 | |||
58 | DEFINE_EVENT(local_only_evt, drv_return_void, | 101 | DEFINE_EVENT(local_only_evt, drv_return_void, |
59 | TP_PROTO(struct ieee80211_local *local), | 102 | TP_PROTO(struct ieee80211_local *local), |
60 | TP_ARGS(local) | 103 | TP_ARGS(local) |
@@ -123,28 +166,10 @@ DEFINE_EVENT(local_only_evt, drv_stop, | |||
123 | TP_ARGS(local) | 166 | TP_ARGS(local) |
124 | ); | 167 | ); |
125 | 168 | ||
126 | TRACE_EVENT(drv_add_interface, | 169 | DEFINE_EVENT(local_sdata_addr_evt, drv_add_interface, |
127 | TP_PROTO(struct ieee80211_local *local, | 170 | TP_PROTO(struct ieee80211_local *local, |
128 | struct ieee80211_sub_if_data *sdata), | 171 | struct ieee80211_sub_if_data *sdata), |
129 | 172 | TP_ARGS(local, sdata) | |
130 | TP_ARGS(local, sdata), | ||
131 | |||
132 | TP_STRUCT__entry( | ||
133 | LOCAL_ENTRY | ||
134 | VIF_ENTRY | ||
135 | __array(char, addr, 6) | ||
136 | ), | ||
137 | |||
138 | TP_fast_assign( | ||
139 | LOCAL_ASSIGN; | ||
140 | VIF_ASSIGN; | ||
141 | memcpy(__entry->addr, sdata->vif.addr, 6); | ||
142 | ), | ||
143 | |||
144 | TP_printk( | ||
145 | LOCAL_PR_FMT VIF_PR_FMT " addr:%pM", | ||
146 | LOCAL_PR_ARG, VIF_PR_ARG, __entry->addr | ||
147 | ) | ||
148 | ); | 173 | ); |
149 | 174 | ||
150 | TRACE_EVENT(drv_change_interface, | 175 | TRACE_EVENT(drv_change_interface, |
@@ -175,27 +200,10 @@ TRACE_EVENT(drv_change_interface, | |||
175 | ) | 200 | ) |
176 | ); | 201 | ); |
177 | 202 | ||
178 | TRACE_EVENT(drv_remove_interface, | 203 | DEFINE_EVENT(local_sdata_addr_evt, drv_remove_interface, |
179 | TP_PROTO(struct ieee80211_local *local, struct ieee80211_sub_if_data *sdata), | 204 | TP_PROTO(struct ieee80211_local *local, |
180 | 205 | struct ieee80211_sub_if_data *sdata), | |
181 | TP_ARGS(local, sdata), | 206 | TP_ARGS(local, sdata) |
182 | |||
183 | TP_STRUCT__entry( | ||
184 | LOCAL_ENTRY | ||
185 | VIF_ENTRY | ||
186 | __array(char, addr, 6) | ||
187 | ), | ||
188 | |||
189 | TP_fast_assign( | ||
190 | LOCAL_ASSIGN; | ||
191 | VIF_ASSIGN; | ||
192 | memcpy(__entry->addr, sdata->vif.addr, 6); | ||
193 | ), | ||
194 | |||
195 | TP_printk( | ||
196 | LOCAL_PR_FMT VIF_PR_FMT " addr:%pM", | ||
197 | LOCAL_PR_ARG, VIF_PR_ARG, __entry->addr | ||
198 | ) | ||
199 | ); | 207 | ); |
200 | 208 | ||
201 | TRACE_EVENT(drv_config, | 209 | TRACE_EVENT(drv_config, |
@@ -514,46 +522,14 @@ TRACE_EVENT(drv_get_tkip_seq, | |||
514 | ) | 522 | ) |
515 | ); | 523 | ); |
516 | 524 | ||
517 | TRACE_EVENT(drv_set_frag_threshold, | 525 | DEFINE_EVENT(local_u32_evt, drv_set_frag_threshold, |
518 | TP_PROTO(struct ieee80211_local *local, u32 value), | 526 | TP_PROTO(struct ieee80211_local *local, u32 value), |
519 | 527 | TP_ARGS(local, value) | |
520 | TP_ARGS(local, value), | ||
521 | |||
522 | TP_STRUCT__entry( | ||
523 | LOCAL_ENTRY | ||
524 | __field(u32, value) | ||
525 | ), | ||
526 | |||
527 | TP_fast_assign( | ||
528 | LOCAL_ASSIGN; | ||
529 | __entry->value = value; | ||
530 | ), | ||
531 | |||
532 | TP_printk( | ||
533 | LOCAL_PR_FMT " value:%d", | ||
534 | LOCAL_PR_ARG, __entry->value | ||
535 | ) | ||
536 | ); | 528 | ); |
537 | 529 | ||
538 | TRACE_EVENT(drv_set_rts_threshold, | 530 | DEFINE_EVENT(local_u32_evt, drv_set_rts_threshold, |
539 | TP_PROTO(struct ieee80211_local *local, u32 value), | 531 | TP_PROTO(struct ieee80211_local *local, u32 value), |
540 | 532 | TP_ARGS(local, value) | |
541 | TP_ARGS(local, value), | ||
542 | |||
543 | TP_STRUCT__entry( | ||
544 | LOCAL_ENTRY | ||
545 | __field(u32, value) | ||
546 | ), | ||
547 | |||
548 | TP_fast_assign( | ||
549 | LOCAL_ASSIGN; | ||
550 | __entry->value = value; | ||
551 | ), | ||
552 | |||
553 | TP_printk( | ||
554 | LOCAL_PR_FMT " value:%d", | ||
555 | LOCAL_PR_ARG, __entry->value | ||
556 | ) | ||
557 | ); | 533 | ); |
558 | 534 | ||
559 | TRACE_EVENT(drv_set_coverage_class, | 535 | TRACE_EVENT(drv_set_coverage_class, |