diff options
Diffstat (limited to 'net/tipc/trace.h')
-rw-r--r-- | net/tipc/trace.h | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/net/tipc/trace.h b/net/tipc/trace.h index 535c8958651f..ebbfcd14627e 100644 --- a/net/tipc/trace.h +++ b/net/tipc/trace.h | |||
@@ -113,11 +113,14 @@ enum { | |||
113 | {(0xcbe), "SYNCH_BEGIN_EVT" },\ | 113 | {(0xcbe), "SYNCH_BEGIN_EVT" },\ |
114 | {(0xcee), "SYNCH_END_EVT" }) | 114 | {(0xcee), "SYNCH_END_EVT" }) |
115 | 115 | ||
116 | extern unsigned long sysctl_tipc_sk_filter[5] __read_mostly; | ||
117 | |||
116 | int tipc_skb_dump(struct sk_buff *skb, bool more, char *buf); | 118 | int tipc_skb_dump(struct sk_buff *skb, bool more, char *buf); |
117 | int tipc_list_dump(struct sk_buff_head *list, bool more, char *buf); | 119 | int tipc_list_dump(struct sk_buff_head *list, bool more, char *buf); |
118 | int tipc_sk_dump(struct sock *sk, u16 dqueues, char *buf); | 120 | int tipc_sk_dump(struct sock *sk, u16 dqueues, char *buf); |
119 | int tipc_link_dump(struct tipc_link *l, u16 dqueues, char *buf); | 121 | int tipc_link_dump(struct tipc_link *l, u16 dqueues, char *buf); |
120 | int tipc_node_dump(struct tipc_node *n, bool more, char *buf); | 122 | int tipc_node_dump(struct tipc_node *n, bool more, char *buf); |
123 | bool tipc_sk_filtering(struct sock *sk); | ||
121 | 124 | ||
122 | DECLARE_EVENT_CLASS(tipc_skb_class, | 125 | DECLARE_EVENT_CLASS(tipc_skb_class, |
123 | 126 | ||
@@ -199,12 +202,33 @@ DECLARE_EVENT_CLASS(tipc_sk_class, | |||
199 | __get_str(skb_buf), __get_str(buf)) | 202 | __get_str(skb_buf), __get_str(buf)) |
200 | ); | 203 | ); |
201 | 204 | ||
202 | #define DEFINE_SK_EVENT(name) \ | 205 | #define DEFINE_SK_EVENT_FILTER(name) \ |
203 | DEFINE_EVENT(tipc_sk_class, name, \ | 206 | DEFINE_EVENT_CONDITION(tipc_sk_class, name, \ |
207 | TP_PROTO(struct sock *sk, struct sk_buff *skb, u16 dqueues, \ | ||
208 | const char *header), \ | ||
209 | TP_ARGS(sk, skb, dqueues, header), \ | ||
210 | TP_CONDITION(tipc_sk_filtering(sk))) | ||
211 | DEFINE_SK_EVENT_FILTER(tipc_sk_dump); | ||
212 | DEFINE_SK_EVENT_FILTER(tipc_sk_create); | ||
213 | DEFINE_SK_EVENT_FILTER(tipc_sk_sendmcast); | ||
214 | DEFINE_SK_EVENT_FILTER(tipc_sk_sendmsg); | ||
215 | DEFINE_SK_EVENT_FILTER(tipc_sk_sendstream); | ||
216 | DEFINE_SK_EVENT_FILTER(tipc_sk_poll); | ||
217 | DEFINE_SK_EVENT_FILTER(tipc_sk_filter_rcv); | ||
218 | DEFINE_SK_EVENT_FILTER(tipc_sk_advance_rx); | ||
219 | DEFINE_SK_EVENT_FILTER(tipc_sk_rej_msg); | ||
220 | DEFINE_SK_EVENT_FILTER(tipc_sk_drop_msg); | ||
221 | DEFINE_SK_EVENT_FILTER(tipc_sk_release); | ||
222 | DEFINE_SK_EVENT_FILTER(tipc_sk_shutdown); | ||
223 | |||
224 | #define DEFINE_SK_EVENT_FILTER_COND(name, cond) \ | ||
225 | DEFINE_EVENT_CONDITION(tipc_sk_class, name, \ | ||
204 | TP_PROTO(struct sock *sk, struct sk_buff *skb, u16 dqueues, \ | 226 | TP_PROTO(struct sock *sk, struct sk_buff *skb, u16 dqueues, \ |
205 | const char *header), \ | 227 | const char *header), \ |
206 | TP_ARGS(sk, skb, dqueues, header)) | 228 | TP_ARGS(sk, skb, dqueues, header), \ |
207 | DEFINE_SK_EVENT(tipc_sk_dump); | 229 | TP_CONDITION(tipc_sk_filtering(sk) && (cond))) |
230 | DEFINE_SK_EVENT_FILTER_COND(tipc_sk_overlimit1, tipc_sk_overlimit1(sk, skb)); | ||
231 | DEFINE_SK_EVENT_FILTER_COND(tipc_sk_overlimit2, tipc_sk_overlimit2(sk, skb)); | ||
208 | 232 | ||
209 | DECLARE_EVENT_CLASS(tipc_link_class, | 233 | DECLARE_EVENT_CLASS(tipc_link_class, |
210 | 234 | ||