i2c: mxs: use MXS_DMA_CTRL_WAIT4END instead of DMA_CTRL_ACK
[linux/fpc-iii.git] / include / trace / events / tcp.h
blobcf97f6339acba4c560974da219020668361530e4
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>
15 #define TP_STORE_V4MAPPED(__entry, saddr, daddr) \
16 do { \
17 struct in6_addr *pin6; \
19 pin6 = (struct in6_addr *)__entry->saddr_v6; \
20 ipv6_addr_set_v4mapped(saddr, pin6); \
21 pin6 = (struct in6_addr *)__entry->daddr_v6; \
22 ipv6_addr_set_v4mapped(daddr, pin6); \
23 } while (0)
25 #if IS_ENABLED(CONFIG_IPV6)
26 #define TP_STORE_ADDRS(__entry, saddr, daddr, saddr6, daddr6) \
27 do { \
28 if (sk->sk_family == AF_INET6) { \
29 struct in6_addr *pin6; \
31 pin6 = (struct in6_addr *)__entry->saddr_v6; \
32 *pin6 = saddr6; \
33 pin6 = (struct in6_addr *)__entry->daddr_v6; \
34 *pin6 = daddr6; \
35 } else { \
36 TP_STORE_V4MAPPED(__entry, saddr, daddr); \
37 } \
38 } while (0)
39 #else
40 #define TP_STORE_ADDRS(__entry, saddr, daddr, saddr6, daddr6) \
41 TP_STORE_V4MAPPED(__entry, saddr, daddr)
42 #endif
45 * tcp event with arguments sk and skb
47 * Note: this class requires a valid sk pointer; while skb pointer could
48 * be NULL.
50 DECLARE_EVENT_CLASS(tcp_event_sk_skb,
52 TP_PROTO(const struct sock *sk, const struct sk_buff *skb),
54 TP_ARGS(sk, skb),
56 TP_STRUCT__entry(
57 __field(const void *, skbaddr)
58 __field(const void *, skaddr)
59 __field(int, state)
60 __field(__u16, sport)
61 __field(__u16, dport)
62 __array(__u8, saddr, 4)
63 __array(__u8, daddr, 4)
64 __array(__u8, saddr_v6, 16)
65 __array(__u8, daddr_v6, 16)
68 TP_fast_assign(
69 struct inet_sock *inet = inet_sk(sk);
70 __be32 *p32;
72 __entry->skbaddr = skb;
73 __entry->skaddr = sk;
74 __entry->state = sk->sk_state;
76 __entry->sport = ntohs(inet->inet_sport);
77 __entry->dport = ntohs(inet->inet_dport);
79 p32 = (__be32 *) __entry->saddr;
80 *p32 = inet->inet_saddr;
82 p32 = (__be32 *) __entry->daddr;
83 *p32 = inet->inet_daddr;
85 TP_STORE_ADDRS(__entry, inet->inet_saddr, inet->inet_daddr,
86 sk->sk_v6_rcv_saddr, sk->sk_v6_daddr);
89 TP_printk("sport=%hu dport=%hu saddr=%pI4 daddr=%pI4 saddrv6=%pI6c daddrv6=%pI6c state=%s",
90 __entry->sport, __entry->dport, __entry->saddr, __entry->daddr,
91 __entry->saddr_v6, __entry->daddr_v6,
92 show_tcp_state_name(__entry->state))
95 DEFINE_EVENT(tcp_event_sk_skb, tcp_retransmit_skb,
97 TP_PROTO(const struct sock *sk, const struct sk_buff *skb),
99 TP_ARGS(sk, skb)
103 * skb of trace_tcp_send_reset is the skb that caused RST. In case of
104 * active reset, skb should be NULL
106 DEFINE_EVENT(tcp_event_sk_skb, tcp_send_reset,
108 TP_PROTO(const struct sock *sk, const struct sk_buff *skb),
110 TP_ARGS(sk, skb)
114 * tcp event with arguments sk
116 * Note: this class requires a valid sk pointer.
118 DECLARE_EVENT_CLASS(tcp_event_sk,
120 TP_PROTO(struct sock *sk),
122 TP_ARGS(sk),
124 TP_STRUCT__entry(
125 __field(const void *, skaddr)
126 __field(__u16, sport)
127 __field(__u16, dport)
128 __array(__u8, saddr, 4)
129 __array(__u8, daddr, 4)
130 __array(__u8, saddr_v6, 16)
131 __array(__u8, daddr_v6, 16)
132 __field(__u64, sock_cookie)
135 TP_fast_assign(
136 struct inet_sock *inet = inet_sk(sk);
137 __be32 *p32;
139 __entry->skaddr = sk;
141 __entry->sport = ntohs(inet->inet_sport);
142 __entry->dport = ntohs(inet->inet_dport);
144 p32 = (__be32 *) __entry->saddr;
145 *p32 = inet->inet_saddr;
147 p32 = (__be32 *) __entry->daddr;
148 *p32 = inet->inet_daddr;
150 TP_STORE_ADDRS(__entry, inet->inet_saddr, inet->inet_daddr,
151 sk->sk_v6_rcv_saddr, sk->sk_v6_daddr);
153 __entry->sock_cookie = sock_gen_cookie(sk);
156 TP_printk("sport=%hu dport=%hu saddr=%pI4 daddr=%pI4 saddrv6=%pI6c daddrv6=%pI6c sock_cookie=%llx",
157 __entry->sport, __entry->dport,
158 __entry->saddr, __entry->daddr,
159 __entry->saddr_v6, __entry->daddr_v6,
160 __entry->sock_cookie)
163 DEFINE_EVENT(tcp_event_sk, tcp_receive_reset,
165 TP_PROTO(struct sock *sk),
167 TP_ARGS(sk)
170 DEFINE_EVENT(tcp_event_sk, tcp_destroy_sock,
172 TP_PROTO(struct sock *sk),
174 TP_ARGS(sk)
177 DEFINE_EVENT(tcp_event_sk, tcp_rcv_space_adjust,
179 TP_PROTO(struct sock *sk),
181 TP_ARGS(sk)
184 TRACE_EVENT(tcp_retransmit_synack,
186 TP_PROTO(const struct sock *sk, const struct request_sock *req),
188 TP_ARGS(sk, req),
190 TP_STRUCT__entry(
191 __field(const void *, skaddr)
192 __field(const void *, req)
193 __field(__u16, sport)
194 __field(__u16, dport)
195 __array(__u8, saddr, 4)
196 __array(__u8, daddr, 4)
197 __array(__u8, saddr_v6, 16)
198 __array(__u8, daddr_v6, 16)
201 TP_fast_assign(
202 struct inet_request_sock *ireq = inet_rsk(req);
203 __be32 *p32;
205 __entry->skaddr = sk;
206 __entry->req = req;
208 __entry->sport = ireq->ir_num;
209 __entry->dport = ntohs(ireq->ir_rmt_port);
211 p32 = (__be32 *) __entry->saddr;
212 *p32 = ireq->ir_loc_addr;
214 p32 = (__be32 *) __entry->daddr;
215 *p32 = ireq->ir_rmt_addr;
217 TP_STORE_ADDRS(__entry, ireq->ir_loc_addr, ireq->ir_rmt_addr,
218 ireq->ir_v6_loc_addr, ireq->ir_v6_rmt_addr);
221 TP_printk("sport=%hu dport=%hu saddr=%pI4 daddr=%pI4 saddrv6=%pI6c daddrv6=%pI6c",
222 __entry->sport, __entry->dport,
223 __entry->saddr, __entry->daddr,
224 __entry->saddr_v6, __entry->daddr_v6)
227 #include <trace/events/net_probe_common.h>
229 TRACE_EVENT(tcp_probe,
231 TP_PROTO(struct sock *sk, struct sk_buff *skb),
233 TP_ARGS(sk, skb),
235 TP_STRUCT__entry(
236 /* sockaddr_in6 is always bigger than sockaddr_in */
237 __array(__u8, saddr, sizeof(struct sockaddr_in6))
238 __array(__u8, daddr, sizeof(struct sockaddr_in6))
239 __field(__u16, sport)
240 __field(__u16, dport)
241 __field(__u32, mark)
242 __field(__u16, data_len)
243 __field(__u32, snd_nxt)
244 __field(__u32, snd_una)
245 __field(__u32, snd_cwnd)
246 __field(__u32, ssthresh)
247 __field(__u32, snd_wnd)
248 __field(__u32, srtt)
249 __field(__u32, rcv_wnd)
250 __field(__u64, sock_cookie)
253 TP_fast_assign(
254 const struct tcphdr *th = (const struct tcphdr *)skb->data;
255 const struct inet_sock *inet = inet_sk(sk);
256 const struct tcp_sock *tp = tcp_sk(sk);
258 memset(__entry->saddr, 0, sizeof(struct sockaddr_in6));
259 memset(__entry->daddr, 0, sizeof(struct sockaddr_in6));
261 TP_STORE_ADDR_PORTS(__entry, inet, sk);
263 /* For filtering use */
264 __entry->sport = ntohs(inet->inet_sport);
265 __entry->dport = ntohs(inet->inet_dport);
266 __entry->mark = skb->mark;
268 __entry->data_len = skb->len - __tcp_hdrlen(th);
269 __entry->snd_nxt = tp->snd_nxt;
270 __entry->snd_una = tp->snd_una;
271 __entry->snd_cwnd = tp->snd_cwnd;
272 __entry->snd_wnd = tp->snd_wnd;
273 __entry->rcv_wnd = tp->rcv_wnd;
274 __entry->ssthresh = tcp_current_ssthresh(sk);
275 __entry->srtt = tp->srtt_us >> 3;
276 __entry->sock_cookie = sock_gen_cookie(sk);
279 TP_printk("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",
280 __entry->saddr, __entry->daddr, __entry->mark,
281 __entry->data_len, __entry->snd_nxt, __entry->snd_una,
282 __entry->snd_cwnd, __entry->ssthresh, __entry->snd_wnd,
283 __entry->srtt, __entry->rcv_wnd, __entry->sock_cookie)
286 #endif /* _TRACE_TCP_H */
288 /* This part must be outside protection */
289 #include <trace/define_trace.h>