Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / include / trace / events / tcp.h
bloba27c4b619dffd7dcc72fffa71bf0fd5e34fe6681
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #undef TRACE_SYSTEM
3 #define TRACE_SYSTEM tcp
5 #if !defined(_TRACE_TCP_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define _TRACE_TCP_H
8 #include <linux/ipv6.h>
9 #include <linux/tcp.h>
10 #include <linux/tracepoint.h>
11 #include <net/ipv6.h>
12 #include <net/tcp.h>
13 #include <linux/sock_diag.h>
14 #include <net/rstreason.h>
17 * tcp event with arguments sk and skb
19 * Note: this class requires a valid sk pointer; while skb pointer could
20 * be NULL.
22 DECLARE_EVENT_CLASS(tcp_event_sk_skb,
24 TP_PROTO(const struct sock *sk, const struct sk_buff *skb),
26 TP_ARGS(sk, skb),
28 TP_STRUCT__entry(
29 __field(const void *, skbaddr)
30 __field(const void *, skaddr)
31 __field(int, state)
32 __field(__u16, sport)
33 __field(__u16, dport)
34 __field(__u16, family)
35 __array(__u8, saddr, 4)
36 __array(__u8, daddr, 4)
37 __array(__u8, saddr_v6, 16)
38 __array(__u8, daddr_v6, 16)
41 TP_fast_assign(
42 const struct inet_sock *inet = inet_sk(sk);
43 __be32 *p32;
45 __entry->skbaddr = skb;
46 __entry->skaddr = sk;
47 __entry->state = sk->sk_state;
49 __entry->sport = ntohs(inet->inet_sport);
50 __entry->dport = ntohs(inet->inet_dport);
51 __entry->family = sk->sk_family;
53 p32 = (__be32 *) __entry->saddr;
54 *p32 = inet->inet_saddr;
56 p32 = (__be32 *) __entry->daddr;
57 *p32 = inet->inet_daddr;
59 TP_STORE_ADDRS(__entry, inet->inet_saddr, inet->inet_daddr,
60 sk->sk_v6_rcv_saddr, sk->sk_v6_daddr);
63 TP_printk("skbaddr=%p skaddr=%p family=%s sport=%hu dport=%hu saddr=%pI4 daddr=%pI4 saddrv6=%pI6c daddrv6=%pI6c state=%s",
64 __entry->skbaddr, __entry->skaddr,
65 show_family_name(__entry->family),
66 __entry->sport, __entry->dport, __entry->saddr, __entry->daddr,
67 __entry->saddr_v6, __entry->daddr_v6,
68 show_tcp_state_name(__entry->state))
71 DEFINE_EVENT(tcp_event_sk_skb, tcp_retransmit_skb,
73 TP_PROTO(const struct sock *sk, const struct sk_buff *skb),
75 TP_ARGS(sk, skb)
78 #undef FN
79 #define FN(reason) TRACE_DEFINE_ENUM(SK_RST_REASON_##reason);
80 DEFINE_RST_REASON(FN, FN)
82 #undef FN
83 #undef FNe
84 #define FN(reason) { SK_RST_REASON_##reason, #reason },
85 #define FNe(reason) { SK_RST_REASON_##reason, #reason }
88 * skb of trace_tcp_send_reset is the skb that caused RST. In case of
89 * active reset, skb should be NULL
91 TRACE_EVENT(tcp_send_reset,
93 TP_PROTO(const struct sock *sk,
94 const struct sk_buff *skb__nullable,
95 const enum sk_rst_reason reason),
97 TP_ARGS(sk, skb__nullable, reason),
99 TP_STRUCT__entry(
100 __field(const void *, skbaddr)
101 __field(const void *, skaddr)
102 __field(int, state)
103 __field(enum sk_rst_reason, reason)
104 __array(__u8, saddr, sizeof(struct sockaddr_in6))
105 __array(__u8, daddr, sizeof(struct sockaddr_in6))
108 TP_fast_assign(
109 __entry->skbaddr = skb__nullable;
110 __entry->skaddr = sk;
111 /* Zero means unknown state. */
112 __entry->state = sk ? sk->sk_state : 0;
114 memset(__entry->saddr, 0, sizeof(struct sockaddr_in6));
115 memset(__entry->daddr, 0, sizeof(struct sockaddr_in6));
117 if (sk && sk_fullsock(sk)) {
118 const struct inet_sock *inet = inet_sk(sk);
120 TP_STORE_ADDR_PORTS(__entry, inet, sk);
121 } else if (skb__nullable) {
122 const struct tcphdr *th = (const struct tcphdr *)skb__nullable->data;
124 * We should reverse the 4-tuple of skb, so later
125 * it can print the right flow direction of rst.
127 TP_STORE_ADDR_PORTS_SKB(skb__nullable, th, entry->daddr, entry->saddr);
129 __entry->reason = reason;
132 TP_printk("skbaddr=%p skaddr=%p src=%pISpc dest=%pISpc state=%s reason=%s",
133 __entry->skbaddr, __entry->skaddr,
134 __entry->saddr, __entry->daddr,
135 __entry->state ? show_tcp_state_name(__entry->state) : "UNKNOWN",
136 __print_symbolic(__entry->reason, DEFINE_RST_REASON(FN, FNe)))
139 #undef FN
140 #undef FNe
143 * tcp event with arguments sk
145 * Note: this class requires a valid sk pointer.
147 DECLARE_EVENT_CLASS(tcp_event_sk,
149 TP_PROTO(struct sock *sk),
151 TP_ARGS(sk),
153 TP_STRUCT__entry(
154 __field(const void *, skaddr)
155 __field(__u16, sport)
156 __field(__u16, dport)
157 __field(__u16, family)
158 __array(__u8, saddr, 4)
159 __array(__u8, daddr, 4)
160 __array(__u8, saddr_v6, 16)
161 __array(__u8, daddr_v6, 16)
162 __field(__u64, sock_cookie)
165 TP_fast_assign(
166 struct inet_sock *inet = inet_sk(sk);
167 __be32 *p32;
169 __entry->skaddr = sk;
171 __entry->sport = ntohs(inet->inet_sport);
172 __entry->dport = ntohs(inet->inet_dport);
173 __entry->family = sk->sk_family;
175 p32 = (__be32 *) __entry->saddr;
176 *p32 = inet->inet_saddr;
178 p32 = (__be32 *) __entry->daddr;
179 *p32 = inet->inet_daddr;
181 TP_STORE_ADDRS(__entry, inet->inet_saddr, inet->inet_daddr,
182 sk->sk_v6_rcv_saddr, sk->sk_v6_daddr);
184 __entry->sock_cookie = sock_gen_cookie(sk);
187 TP_printk("family=%s sport=%hu dport=%hu saddr=%pI4 daddr=%pI4 saddrv6=%pI6c daddrv6=%pI6c sock_cookie=%llx",
188 show_family_name(__entry->family),
189 __entry->sport, __entry->dport,
190 __entry->saddr, __entry->daddr,
191 __entry->saddr_v6, __entry->daddr_v6,
192 __entry->sock_cookie)
195 DEFINE_EVENT(tcp_event_sk, tcp_receive_reset,
197 TP_PROTO(struct sock *sk),
199 TP_ARGS(sk)
202 DEFINE_EVENT(tcp_event_sk, tcp_destroy_sock,
204 TP_PROTO(struct sock *sk),
206 TP_ARGS(sk)
209 DEFINE_EVENT(tcp_event_sk, tcp_rcv_space_adjust,
211 TP_PROTO(struct sock *sk),
213 TP_ARGS(sk)
216 TRACE_EVENT(tcp_retransmit_synack,
218 TP_PROTO(const struct sock *sk, const struct request_sock *req),
220 TP_ARGS(sk, req),
222 TP_STRUCT__entry(
223 __field(const void *, skaddr)
224 __field(const void *, req)
225 __field(__u16, sport)
226 __field(__u16, dport)
227 __field(__u16, family)
228 __array(__u8, saddr, 4)
229 __array(__u8, daddr, 4)
230 __array(__u8, saddr_v6, 16)
231 __array(__u8, daddr_v6, 16)
234 TP_fast_assign(
235 struct inet_request_sock *ireq = inet_rsk(req);
236 __be32 *p32;
238 __entry->skaddr = sk;
239 __entry->req = req;
241 __entry->sport = ireq->ir_num;
242 __entry->dport = ntohs(ireq->ir_rmt_port);
243 __entry->family = sk->sk_family;
245 p32 = (__be32 *) __entry->saddr;
246 *p32 = ireq->ir_loc_addr;
248 p32 = (__be32 *) __entry->daddr;
249 *p32 = ireq->ir_rmt_addr;
251 TP_STORE_ADDRS(__entry, ireq->ir_loc_addr, ireq->ir_rmt_addr,
252 ireq->ir_v6_loc_addr, ireq->ir_v6_rmt_addr);
255 TP_printk("family=%s sport=%hu dport=%hu saddr=%pI4 daddr=%pI4 saddrv6=%pI6c daddrv6=%pI6c",
256 show_family_name(__entry->family),
257 __entry->sport, __entry->dport,
258 __entry->saddr, __entry->daddr,
259 __entry->saddr_v6, __entry->daddr_v6)
262 #include <trace/events/net_probe_common.h>
264 TRACE_EVENT(tcp_probe,
266 TP_PROTO(struct sock *sk, struct sk_buff *skb),
268 TP_ARGS(sk, skb),
270 TP_STRUCT__entry(
271 /* sockaddr_in6 is always bigger than sockaddr_in */
272 __array(__u8, saddr, sizeof(struct sockaddr_in6))
273 __array(__u8, daddr, sizeof(struct sockaddr_in6))
274 __field(__u16, sport)
275 __field(__u16, dport)
276 __field(__u16, family)
277 __field(__u32, mark)
278 __field(__u16, data_len)
279 __field(__u32, snd_nxt)
280 __field(__u32, snd_una)
281 __field(__u32, snd_cwnd)
282 __field(__u32, ssthresh)
283 __field(__u32, snd_wnd)
284 __field(__u32, srtt)
285 __field(__u32, rcv_wnd)
286 __field(__u64, sock_cookie)
287 __field(const void *, skbaddr)
288 __field(const void *, skaddr)
291 TP_fast_assign(
292 const struct tcphdr *th = (const struct tcphdr *)skb->data;
293 const struct inet_sock *inet = inet_sk(sk);
294 const struct tcp_sock *tp = tcp_sk(sk);
296 memset(__entry->saddr, 0, sizeof(struct sockaddr_in6));
297 memset(__entry->daddr, 0, sizeof(struct sockaddr_in6));
299 TP_STORE_ADDR_PORTS(__entry, inet, sk);
301 /* For filtering use */
302 __entry->sport = ntohs(inet->inet_sport);
303 __entry->dport = ntohs(inet->inet_dport);
304 __entry->mark = skb->mark;
305 __entry->family = sk->sk_family;
307 __entry->data_len = skb->len - __tcp_hdrlen(th);
308 __entry->snd_nxt = tp->snd_nxt;
309 __entry->snd_una = tp->snd_una;
310 __entry->snd_cwnd = tcp_snd_cwnd(tp);
311 __entry->snd_wnd = tp->snd_wnd;
312 __entry->rcv_wnd = tp->rcv_wnd;
313 __entry->ssthresh = tcp_current_ssthresh(sk);
314 __entry->srtt = tp->srtt_us >> 3;
315 __entry->sock_cookie = sock_gen_cookie(sk);
317 __entry->skbaddr = skb;
318 __entry->skaddr = sk;
321 TP_printk("family=%s src=%pISpc dest=%pISpc mark=%#x data_len=%d snd_nxt=%#x snd_una=%#x snd_cwnd=%u ssthresh=%u snd_wnd=%u srtt=%u rcv_wnd=%u sock_cookie=%llx skbaddr=%p skaddr=%p",
322 show_family_name(__entry->family),
323 __entry->saddr, __entry->daddr, __entry->mark,
324 __entry->data_len, __entry->snd_nxt, __entry->snd_una,
325 __entry->snd_cwnd, __entry->ssthresh, __entry->snd_wnd,
326 __entry->srtt, __entry->rcv_wnd, __entry->sock_cookie,
327 __entry->skbaddr, __entry->skaddr)
331 * tcp event with only skb
333 DECLARE_EVENT_CLASS(tcp_event_skb,
335 TP_PROTO(const struct sk_buff *skb),
337 TP_ARGS(skb),
339 TP_STRUCT__entry(
340 __field(const void *, skbaddr)
341 __array(__u8, saddr, sizeof(struct sockaddr_in6))
342 __array(__u8, daddr, sizeof(struct sockaddr_in6))
345 TP_fast_assign(
346 const struct tcphdr *th = (const struct tcphdr *)skb->data;
347 __entry->skbaddr = skb;
349 memset(__entry->saddr, 0, sizeof(struct sockaddr_in6));
350 memset(__entry->daddr, 0, sizeof(struct sockaddr_in6));
352 TP_STORE_ADDR_PORTS_SKB(skb, th, __entry->saddr, __entry->daddr);
355 TP_printk("skbaddr=%p src=%pISpc dest=%pISpc",
356 __entry->skbaddr, __entry->saddr, __entry->daddr)
359 DEFINE_EVENT(tcp_event_skb, tcp_bad_csum,
361 TP_PROTO(const struct sk_buff *skb),
363 TP_ARGS(skb)
366 TRACE_EVENT(tcp_cong_state_set,
368 TP_PROTO(struct sock *sk, const u8 ca_state),
370 TP_ARGS(sk, ca_state),
372 TP_STRUCT__entry(
373 __field(const void *, skaddr)
374 __field(__u16, sport)
375 __field(__u16, dport)
376 __field(__u16, family)
377 __array(__u8, saddr, 4)
378 __array(__u8, daddr, 4)
379 __array(__u8, saddr_v6, 16)
380 __array(__u8, daddr_v6, 16)
381 __field(__u8, cong_state)
384 TP_fast_assign(
385 struct inet_sock *inet = inet_sk(sk);
386 __be32 *p32;
388 __entry->skaddr = sk;
390 __entry->sport = ntohs(inet->inet_sport);
391 __entry->dport = ntohs(inet->inet_dport);
392 __entry->family = sk->sk_family;
394 p32 = (__be32 *) __entry->saddr;
395 *p32 = inet->inet_saddr;
397 p32 = (__be32 *) __entry->daddr;
398 *p32 = inet->inet_daddr;
400 TP_STORE_ADDRS(__entry, inet->inet_saddr, inet->inet_daddr,
401 sk->sk_v6_rcv_saddr, sk->sk_v6_daddr);
403 __entry->cong_state = ca_state;
406 TP_printk("family=%s sport=%hu dport=%hu saddr=%pI4 daddr=%pI4 saddrv6=%pI6c daddrv6=%pI6c cong_state=%u",
407 show_family_name(__entry->family),
408 __entry->sport, __entry->dport,
409 __entry->saddr, __entry->daddr,
410 __entry->saddr_v6, __entry->daddr_v6,
411 __entry->cong_state)
414 DECLARE_EVENT_CLASS(tcp_hash_event,
416 TP_PROTO(const struct sock *sk, const struct sk_buff *skb),
418 TP_ARGS(sk, skb),
420 TP_STRUCT__entry(
421 __field(__u64, net_cookie)
422 __field(const void *, skbaddr)
423 __field(const void *, skaddr)
424 __field(int, state)
426 /* sockaddr_in6 is always bigger than sockaddr_in */
427 __array(__u8, saddr, sizeof(struct sockaddr_in6))
428 __array(__u8, daddr, sizeof(struct sockaddr_in6))
429 __field(int, l3index)
431 __field(__u16, sport)
432 __field(__u16, dport)
433 __field(__u16, family)
435 __field(bool, fin)
436 __field(bool, syn)
437 __field(bool, rst)
438 __field(bool, psh)
439 __field(bool, ack)
442 TP_fast_assign(
443 const struct tcphdr *th = (const struct tcphdr *)skb->data;
445 __entry->net_cookie = sock_net(sk)->net_cookie;
446 __entry->skbaddr = skb;
447 __entry->skaddr = sk;
448 __entry->state = sk->sk_state;
450 memset(__entry->saddr, 0, sizeof(struct sockaddr_in6));
451 memset(__entry->daddr, 0, sizeof(struct sockaddr_in6));
452 TP_STORE_ADDR_PORTS_SKB(skb, th, __entry->saddr, __entry->daddr);
453 __entry->l3index = inet_sdif(skb) ? inet_iif(skb) : 0;
455 /* For filtering use */
456 __entry->sport = ntohs(th->source);
457 __entry->dport = ntohs(th->dest);
458 __entry->family = sk->sk_family;
460 __entry->fin = th->fin;
461 __entry->syn = th->syn;
462 __entry->rst = th->rst;
463 __entry->psh = th->psh;
464 __entry->ack = th->ack;
467 TP_printk("net=%llu state=%s family=%s src=%pISpc dest=%pISpc L3index=%d [%c%c%c%c%c]",
468 __entry->net_cookie,
469 show_tcp_state_name(__entry->state),
470 show_family_name(__entry->family),
471 __entry->saddr, __entry->daddr,
472 __entry->l3index,
473 __entry->fin ? 'F' : ' ',
474 __entry->syn ? 'S' : ' ',
475 __entry->rst ? 'R' : ' ',
476 __entry->psh ? 'P' : ' ',
477 __entry->ack ? '.' : ' ')
480 DEFINE_EVENT(tcp_hash_event, tcp_hash_bad_header,
482 TP_PROTO(const struct sock *sk, const struct sk_buff *skb),
483 TP_ARGS(sk, skb)
486 DEFINE_EVENT(tcp_hash_event, tcp_hash_md5_required,
488 TP_PROTO(const struct sock *sk, const struct sk_buff *skb),
489 TP_ARGS(sk, skb)
492 DEFINE_EVENT(tcp_hash_event, tcp_hash_md5_unexpected,
494 TP_PROTO(const struct sock *sk, const struct sk_buff *skb),
495 TP_ARGS(sk, skb)
498 DEFINE_EVENT(tcp_hash_event, tcp_hash_md5_mismatch,
500 TP_PROTO(const struct sock *sk, const struct sk_buff *skb),
501 TP_ARGS(sk, skb)
504 DEFINE_EVENT(tcp_hash_event, tcp_hash_ao_required,
506 TP_PROTO(const struct sock *sk, const struct sk_buff *skb),
507 TP_ARGS(sk, skb)
510 DECLARE_EVENT_CLASS(tcp_ao_event,
512 TP_PROTO(const struct sock *sk, const struct sk_buff *skb,
513 const __u8 keyid, const __u8 rnext, const __u8 maclen),
515 TP_ARGS(sk, skb, keyid, rnext, maclen),
517 TP_STRUCT__entry(
518 __field(__u64, net_cookie)
519 __field(const void *, skbaddr)
520 __field(const void *, skaddr)
521 __field(int, state)
523 /* sockaddr_in6 is always bigger than sockaddr_in */
524 __array(__u8, saddr, sizeof(struct sockaddr_in6))
525 __array(__u8, daddr, sizeof(struct sockaddr_in6))
526 __field(int, l3index)
528 __field(__u16, sport)
529 __field(__u16, dport)
530 __field(__u16, family)
532 __field(bool, fin)
533 __field(bool, syn)
534 __field(bool, rst)
535 __field(bool, psh)
536 __field(bool, ack)
538 __field(__u8, keyid)
539 __field(__u8, rnext)
540 __field(__u8, maclen)
543 TP_fast_assign(
544 const struct tcphdr *th = (const struct tcphdr *)skb->data;
546 __entry->net_cookie = sock_net(sk)->net_cookie;
547 __entry->skbaddr = skb;
548 __entry->skaddr = sk;
549 __entry->state = sk->sk_state;
551 memset(__entry->saddr, 0, sizeof(struct sockaddr_in6));
552 memset(__entry->daddr, 0, sizeof(struct sockaddr_in6));
553 TP_STORE_ADDR_PORTS_SKB(skb, th, __entry->saddr, __entry->daddr);
554 __entry->l3index = inet_sdif(skb) ? inet_iif(skb) : 0;
556 /* For filtering use */
557 __entry->sport = ntohs(th->source);
558 __entry->dport = ntohs(th->dest);
559 __entry->family = sk->sk_family;
561 __entry->fin = th->fin;
562 __entry->syn = th->syn;
563 __entry->rst = th->rst;
564 __entry->psh = th->psh;
565 __entry->ack = th->ack;
567 __entry->keyid = keyid;
568 __entry->rnext = rnext;
569 __entry->maclen = maclen;
572 TP_printk("net=%llu state=%s family=%s src=%pISpc dest=%pISpc L3index=%d [%c%c%c%c%c] keyid=%u rnext=%u maclen=%u",
573 __entry->net_cookie,
574 show_tcp_state_name(__entry->state),
575 show_family_name(__entry->family),
576 __entry->saddr, __entry->daddr,
577 __entry->l3index,
578 __entry->fin ? 'F' : ' ',
579 __entry->syn ? 'S' : ' ',
580 __entry->rst ? 'R' : ' ',
581 __entry->psh ? 'P' : ' ',
582 __entry->ack ? '.' : ' ',
583 __entry->keyid, __entry->rnext, __entry->maclen)
586 DEFINE_EVENT(tcp_ao_event, tcp_ao_handshake_failure,
587 TP_PROTO(const struct sock *sk, const struct sk_buff *skb,
588 const __u8 keyid, const __u8 rnext, const __u8 maclen),
589 TP_ARGS(sk, skb, keyid, rnext, maclen)
592 DEFINE_EVENT(tcp_ao_event, tcp_ao_wrong_maclen,
593 TP_PROTO(const struct sock *sk, const struct sk_buff *skb,
594 const __u8 keyid, const __u8 rnext, const __u8 maclen),
595 TP_ARGS(sk, skb, keyid, rnext, maclen)
598 DEFINE_EVENT(tcp_ao_event, tcp_ao_mismatch,
599 TP_PROTO(const struct sock *sk, const struct sk_buff *skb,
600 const __u8 keyid, const __u8 rnext, const __u8 maclen),
601 TP_ARGS(sk, skb, keyid, rnext, maclen)
604 DEFINE_EVENT(tcp_ao_event, tcp_ao_key_not_found,
605 TP_PROTO(const struct sock *sk, const struct sk_buff *skb,
606 const __u8 keyid, const __u8 rnext, const __u8 maclen),
607 TP_ARGS(sk, skb, keyid, rnext, maclen)
610 DEFINE_EVENT(tcp_ao_event, tcp_ao_rnext_request,
611 TP_PROTO(const struct sock *sk, const struct sk_buff *skb,
612 const __u8 keyid, const __u8 rnext, const __u8 maclen),
613 TP_ARGS(sk, skb, keyid, rnext, maclen)
616 DECLARE_EVENT_CLASS(tcp_ao_event_sk,
618 TP_PROTO(const struct sock *sk, const __u8 keyid, const __u8 rnext),
620 TP_ARGS(sk, keyid, rnext),
622 TP_STRUCT__entry(
623 __field(__u64, net_cookie)
624 __field(const void *, skaddr)
625 __field(int, state)
627 /* sockaddr_in6 is always bigger than sockaddr_in */
628 __array(__u8, saddr, sizeof(struct sockaddr_in6))
629 __array(__u8, daddr, sizeof(struct sockaddr_in6))
631 __field(__u16, sport)
632 __field(__u16, dport)
633 __field(__u16, family)
635 __field(__u8, keyid)
636 __field(__u8, rnext)
639 TP_fast_assign(
640 const struct inet_sock *inet = inet_sk(sk);
642 __entry->net_cookie = sock_net(sk)->net_cookie;
643 __entry->skaddr = sk;
644 __entry->state = sk->sk_state;
646 memset(__entry->saddr, 0, sizeof(struct sockaddr_in6));
647 memset(__entry->daddr, 0, sizeof(struct sockaddr_in6));
648 TP_STORE_ADDR_PORTS(__entry, inet, sk);
650 /* For filtering use */
651 __entry->sport = ntohs(inet->inet_sport);
652 __entry->dport = ntohs(inet->inet_dport);
653 __entry->family = sk->sk_family;
655 __entry->keyid = keyid;
656 __entry->rnext = rnext;
659 TP_printk("net=%llu state=%s family=%s src=%pISpc dest=%pISpc keyid=%u rnext=%u",
660 __entry->net_cookie,
661 show_tcp_state_name(__entry->state),
662 show_family_name(__entry->family),
663 __entry->saddr, __entry->daddr,
664 __entry->keyid, __entry->rnext)
667 DEFINE_EVENT(tcp_ao_event_sk, tcp_ao_synack_no_key,
668 TP_PROTO(const struct sock *sk, const __u8 keyid, const __u8 rnext),
669 TP_ARGS(sk, keyid, rnext)
672 DECLARE_EVENT_CLASS(tcp_ao_event_sne,
674 TP_PROTO(const struct sock *sk, __u32 new_sne),
676 TP_ARGS(sk, new_sne),
678 TP_STRUCT__entry(
679 __field(__u64, net_cookie)
680 __field(const void *, skaddr)
681 __field(int, state)
683 /* sockaddr_in6 is always bigger than sockaddr_in */
684 __array(__u8, saddr, sizeof(struct sockaddr_in6))
685 __array(__u8, daddr, sizeof(struct sockaddr_in6))
687 __field(__u16, sport)
688 __field(__u16, dport)
689 __field(__u16, family)
691 __field(__u32, new_sne)
694 TP_fast_assign(
695 const struct inet_sock *inet = inet_sk(sk);
697 __entry->net_cookie = sock_net(sk)->net_cookie;
698 __entry->skaddr = sk;
699 __entry->state = sk->sk_state;
701 memset(__entry->saddr, 0, sizeof(struct sockaddr_in6));
702 memset(__entry->daddr, 0, sizeof(struct sockaddr_in6));
703 TP_STORE_ADDR_PORTS(__entry, inet, sk);
705 /* For filtering use */
706 __entry->sport = ntohs(inet->inet_sport);
707 __entry->dport = ntohs(inet->inet_dport);
708 __entry->family = sk->sk_family;
710 __entry->new_sne = new_sne;
713 TP_printk("net=%llu state=%s family=%s src=%pISpc dest=%pISpc sne=%u",
714 __entry->net_cookie,
715 show_tcp_state_name(__entry->state),
716 show_family_name(__entry->family),
717 __entry->saddr, __entry->daddr,
718 __entry->new_sne)
721 DEFINE_EVENT(tcp_ao_event_sne, tcp_ao_snd_sne_update,
722 TP_PROTO(const struct sock *sk, __u32 new_sne),
723 TP_ARGS(sk, new_sne)
726 DEFINE_EVENT(tcp_ao_event_sne, tcp_ao_rcv_sne_update,
727 TP_PROTO(const struct sock *sk, __u32 new_sne),
728 TP_ARGS(sk, new_sne)
731 #endif /* _TRACE_TCP_H */
733 /* This part must be outside protection */
734 #include <trace/define_trace.h>