diff options
Diffstat (limited to 'net/tipc/trace.h')
-rw-r--r-- | net/tipc/trace.h | 124 |
1 files changed, 124 insertions, 0 deletions
diff --git a/net/tipc/trace.h b/net/tipc/trace.h index 4c74927df685..535c8958651f 100644 --- a/net/tipc/trace.h +++ b/net/tipc/trace.h | |||
@@ -74,6 +74,45 @@ enum { | |||
74 | }; | 74 | }; |
75 | #endif | 75 | #endif |
76 | 76 | ||
77 | /* Link & Node FSM states: */ | ||
78 | #define state_sym(val) \ | ||
79 | __print_symbolic(val, \ | ||
80 | {(0xe), "ESTABLISHED" },\ | ||
81 | {(0xe << 4), "ESTABLISHING" },\ | ||
82 | {(0x1 << 8), "RESET" },\ | ||
83 | {(0x2 << 12), "RESETTING" },\ | ||
84 | {(0xd << 16), "PEER_RESET" },\ | ||
85 | {(0xf << 20), "FAILINGOVER" },\ | ||
86 | {(0xc << 24), "SYNCHING" },\ | ||
87 | {(0xdd), "SELF_DOWN_PEER_DOWN" },\ | ||
88 | {(0xaa), "SELF_UP_PEER_UP" },\ | ||
89 | {(0xd1), "SELF_DOWN_PEER_LEAVING" },\ | ||
90 | {(0xac), "SELF_UP_PEER_COMING" },\ | ||
91 | {(0xca), "SELF_COMING_PEER_UP" },\ | ||
92 | {(0x1d), "SELF_LEAVING_PEER_DOWN" },\ | ||
93 | {(0xf0), "FAILINGOVER" },\ | ||
94 | {(0xcc), "SYNCHING" }) | ||
95 | |||
96 | /* Link & Node FSM events: */ | ||
97 | #define evt_sym(val) \ | ||
98 | __print_symbolic(val, \ | ||
99 | {(0xec1ab1e), "ESTABLISH_EVT" },\ | ||
100 | {(0x9eed0e), "PEER_RESET_EVT" },\ | ||
101 | {(0xfa110e), "FAILURE_EVT" },\ | ||
102 | {(0x10ca1d0e), "RESET_EVT" },\ | ||
103 | {(0xfa110bee), "FAILOVER_BEGIN_EVT" },\ | ||
104 | {(0xfa110ede), "FAILOVER_END_EVT" },\ | ||
105 | {(0xc1ccbee), "SYNCH_BEGIN_EVT" },\ | ||
106 | {(0xc1ccede), "SYNCH_END_EVT" },\ | ||
107 | {(0xece), "SELF_ESTABL_CONTACT_EVT" },\ | ||
108 | {(0x1ce), "SELF_LOST_CONTACT_EVT" },\ | ||
109 | {(0x9ece), "PEER_ESTABL_CONTACT_EVT" },\ | ||
110 | {(0x91ce), "PEER_LOST_CONTACT_EVT" },\ | ||
111 | {(0xfbe), "FAILOVER_BEGIN_EVT" },\ | ||
112 | {(0xfee), "FAILOVER_END_EVT" },\ | ||
113 | {(0xcbe), "SYNCH_BEGIN_EVT" },\ | ||
114 | {(0xcee), "SYNCH_END_EVT" }) | ||
115 | |||
77 | int tipc_skb_dump(struct sk_buff *skb, bool more, char *buf); | 116 | int tipc_skb_dump(struct sk_buff *skb, bool more, char *buf); |
78 | int tipc_list_dump(struct sk_buff_head *list, bool more, char *buf); | 117 | int tipc_list_dump(struct sk_buff_head *list, bool more, char *buf); |
79 | int tipc_sk_dump(struct sock *sk, u16 dqueues, char *buf); | 118 | int tipc_sk_dump(struct sock *sk, u16 dqueues, char *buf); |
@@ -104,6 +143,8 @@ DEFINE_EVENT(tipc_skb_class, name, \ | |||
104 | TP_PROTO(struct sk_buff *skb, bool more, const char *header), \ | 143 | TP_PROTO(struct sk_buff *skb, bool more, const char *header), \ |
105 | TP_ARGS(skb, more, header)) | 144 | TP_ARGS(skb, more, header)) |
106 | DEFINE_SKB_EVENT(tipc_skb_dump); | 145 | DEFINE_SKB_EVENT(tipc_skb_dump); |
146 | DEFINE_SKB_EVENT(tipc_proto_build); | ||
147 | DEFINE_SKB_EVENT(tipc_proto_rcv); | ||
107 | 148 | ||
108 | DECLARE_EVENT_CLASS(tipc_list_class, | 149 | DECLARE_EVENT_CLASS(tipc_list_class, |
109 | 150 | ||
@@ -192,6 +233,58 @@ DEFINE_EVENT(tipc_link_class, name, \ | |||
192 | TP_PROTO(struct tipc_link *l, u16 dqueues, const char *header), \ | 233 | TP_PROTO(struct tipc_link *l, u16 dqueues, const char *header), \ |
193 | TP_ARGS(l, dqueues, header)) | 234 | TP_ARGS(l, dqueues, header)) |
194 | DEFINE_LINK_EVENT(tipc_link_dump); | 235 | DEFINE_LINK_EVENT(tipc_link_dump); |
236 | DEFINE_LINK_EVENT(tipc_link_conges); | ||
237 | DEFINE_LINK_EVENT(tipc_link_timeout); | ||
238 | DEFINE_LINK_EVENT(tipc_link_reset); | ||
239 | |||
240 | #define DEFINE_LINK_EVENT_COND(name, cond) \ | ||
241 | DEFINE_EVENT_CONDITION(tipc_link_class, name, \ | ||
242 | TP_PROTO(struct tipc_link *l, u16 dqueues, const char *header), \ | ||
243 | TP_ARGS(l, dqueues, header), \ | ||
244 | TP_CONDITION(cond)) | ||
245 | DEFINE_LINK_EVENT_COND(tipc_link_too_silent, tipc_link_too_silent(l)); | ||
246 | |||
247 | DECLARE_EVENT_CLASS(tipc_link_transmq_class, | ||
248 | |||
249 | TP_PROTO(struct tipc_link *r, u16 f, u16 t, struct sk_buff_head *tq), | ||
250 | |||
251 | TP_ARGS(r, f, t, tq), | ||
252 | |||
253 | TP_STRUCT__entry( | ||
254 | __array(char, name, TIPC_MAX_LINK_NAME) | ||
255 | __field(u16, from) | ||
256 | __field(u16, to) | ||
257 | __field(u32, len) | ||
258 | __field(u16, fseqno) | ||
259 | __field(u16, lseqno) | ||
260 | ), | ||
261 | |||
262 | TP_fast_assign( | ||
263 | tipc_link_name_ext(r, __entry->name); | ||
264 | __entry->from = f; | ||
265 | __entry->to = t; | ||
266 | __entry->len = skb_queue_len(tq); | ||
267 | __entry->fseqno = msg_seqno(buf_msg(skb_peek(tq))); | ||
268 | __entry->lseqno = msg_seqno(buf_msg(skb_peek_tail(tq))); | ||
269 | ), | ||
270 | |||
271 | TP_printk("<%s> retrans req: [%u-%u] transmq: %u [%u-%u]\n", | ||
272 | __entry->name, __entry->from, __entry->to, | ||
273 | __entry->len, __entry->fseqno, __entry->lseqno) | ||
274 | ); | ||
275 | |||
276 | DEFINE_EVENT(tipc_link_transmq_class, tipc_link_retrans, | ||
277 | TP_PROTO(struct tipc_link *r, u16 f, u16 t, struct sk_buff_head *tq), | ||
278 | TP_ARGS(r, f, t, tq) | ||
279 | ); | ||
280 | |||
281 | DEFINE_EVENT_PRINT(tipc_link_transmq_class, tipc_link_bc_ack, | ||
282 | TP_PROTO(struct tipc_link *r, u16 f, u16 t, struct sk_buff_head *tq), | ||
283 | TP_ARGS(r, f, t, tq), | ||
284 | TP_printk("<%s> acked: [%u-%u] transmq: %u [%u-%u]\n", | ||
285 | __entry->name, __entry->from, __entry->to, | ||
286 | __entry->len, __entry->fseqno, __entry->lseqno) | ||
287 | ); | ||
195 | 288 | ||
196 | DECLARE_EVENT_CLASS(tipc_node_class, | 289 | DECLARE_EVENT_CLASS(tipc_node_class, |
197 | 290 | ||
@@ -221,6 +314,37 @@ DEFINE_EVENT(tipc_node_class, name, \ | |||
221 | TP_ARGS(n, more, header)) | 314 | TP_ARGS(n, more, header)) |
222 | DEFINE_NODE_EVENT(tipc_node_dump); | 315 | DEFINE_NODE_EVENT(tipc_node_dump); |
223 | 316 | ||
317 | DECLARE_EVENT_CLASS(tipc_fsm_class, | ||
318 | |||
319 | TP_PROTO(const char *name, u32 os, u32 ns, int evt), | ||
320 | |||
321 | TP_ARGS(name, os, ns, evt), | ||
322 | |||
323 | TP_STRUCT__entry( | ||
324 | __string(name, name) | ||
325 | __field(u32, os) | ||
326 | __field(u32, ns) | ||
327 | __field(u32, evt) | ||
328 | ), | ||
329 | |||
330 | TP_fast_assign( | ||
331 | __assign_str(name, name); | ||
332 | __entry->os = os; | ||
333 | __entry->ns = ns; | ||
334 | __entry->evt = evt; | ||
335 | ), | ||
336 | |||
337 | TP_printk("<%s> %s--(%s)->%s\n", __get_str(name), | ||
338 | state_sym(__entry->os), evt_sym(__entry->evt), | ||
339 | state_sym(__entry->ns)) | ||
340 | ); | ||
341 | |||
342 | #define DEFINE_FSM_EVENT(fsm_name) \ | ||
343 | DEFINE_EVENT(tipc_fsm_class, fsm_name, \ | ||
344 | TP_PROTO(const char *name, u32 os, u32 ns, int evt), \ | ||
345 | TP_ARGS(name, os, ns, evt)) | ||
346 | DEFINE_FSM_EVENT(tipc_link_fsm); | ||
347 | |||
224 | #endif /* _TIPC_TRACE_H */ | 348 | #endif /* _TIPC_TRACE_H */ |
225 | 349 | ||
226 | /* This part must be outside protection */ | 350 | /* This part must be outside protection */ |