diff options
Diffstat (limited to 'include/trace/events/tcp.h')
-rw-r--r-- | include/trace/events/tcp.h | 76 |
1 files changed, 60 insertions, 16 deletions
diff --git a/include/trace/events/tcp.h b/include/trace/events/tcp.h index ab34c561f26b..878b2be7ce77 100644 --- a/include/trace/events/tcp.h +++ b/include/trace/events/tcp.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #undef TRACE_SYSTEM | 2 | #undef TRACE_SYSTEM |
2 | #define TRACE_SYSTEM tcp | 3 | #define TRACE_SYSTEM tcp |
3 | 4 | ||
@@ -8,22 +9,7 @@ | |||
8 | #include <linux/tcp.h> | 9 | #include <linux/tcp.h> |
9 | #include <linux/tracepoint.h> | 10 | #include <linux/tracepoint.h> |
10 | #include <net/ipv6.h> | 11 | #include <net/ipv6.h> |
11 | 12 | #include <net/tcp.h> | |
12 | #define tcp_state_name(state) { state, #state } | ||
13 | #define show_tcp_state_name(val) \ | ||
14 | __print_symbolic(val, \ | ||
15 | tcp_state_name(TCP_ESTABLISHED), \ | ||
16 | tcp_state_name(TCP_SYN_SENT), \ | ||
17 | tcp_state_name(TCP_SYN_RECV), \ | ||
18 | tcp_state_name(TCP_FIN_WAIT1), \ | ||
19 | tcp_state_name(TCP_FIN_WAIT2), \ | ||
20 | tcp_state_name(TCP_TIME_WAIT), \ | ||
21 | tcp_state_name(TCP_CLOSE), \ | ||
22 | tcp_state_name(TCP_CLOSE_WAIT), \ | ||
23 | tcp_state_name(TCP_LAST_ACK), \ | ||
24 | tcp_state_name(TCP_LISTEN), \ | ||
25 | tcp_state_name(TCP_CLOSING), \ | ||
26 | tcp_state_name(TCP_NEW_SYN_RECV)) | ||
27 | 13 | ||
28 | #define TP_STORE_V4MAPPED(__entry, saddr, daddr) \ | 14 | #define TP_STORE_V4MAPPED(__entry, saddr, daddr) \ |
29 | do { \ | 15 | do { \ |
@@ -270,6 +256,64 @@ TRACE_EVENT(tcp_retransmit_synack, | |||
270 | __entry->saddr_v6, __entry->daddr_v6) | 256 | __entry->saddr_v6, __entry->daddr_v6) |
271 | ); | 257 | ); |
272 | 258 | ||
259 | #include <trace/events/net_probe_common.h> | ||
260 | |||
261 | TRACE_EVENT(tcp_probe, | ||
262 | |||
263 | TP_PROTO(struct sock *sk, struct sk_buff *skb), | ||
264 | |||
265 | TP_ARGS(sk, skb), | ||
266 | |||
267 | TP_STRUCT__entry( | ||
268 | /* sockaddr_in6 is always bigger than sockaddr_in */ | ||
269 | __array(__u8, saddr, sizeof(struct sockaddr_in6)) | ||
270 | __array(__u8, daddr, sizeof(struct sockaddr_in6)) | ||
271 | __field(__u16, sport) | ||
272 | __field(__u16, dport) | ||
273 | __field(__u32, mark) | ||
274 | __field(__u16, length) | ||
275 | __field(__u32, snd_nxt) | ||
276 | __field(__u32, snd_una) | ||
277 | __field(__u32, snd_cwnd) | ||
278 | __field(__u32, ssthresh) | ||
279 | __field(__u32, snd_wnd) | ||
280 | __field(__u32, srtt) | ||
281 | __field(__u32, rcv_wnd) | ||
282 | ), | ||
283 | |||
284 | TP_fast_assign( | ||
285 | const struct tcp_sock *tp = tcp_sk(sk); | ||
286 | const struct inet_sock *inet = inet_sk(sk); | ||
287 | |||
288 | memset(__entry->saddr, 0, sizeof(struct sockaddr_in6)); | ||
289 | memset(__entry->daddr, 0, sizeof(struct sockaddr_in6)); | ||
290 | |||
291 | TP_STORE_ADDR_PORTS(__entry, inet, sk); | ||
292 | |||
293 | /* For filtering use */ | ||
294 | __entry->sport = ntohs(inet->inet_sport); | ||
295 | __entry->dport = ntohs(inet->inet_dport); | ||
296 | __entry->mark = skb->mark; | ||
297 | |||
298 | __entry->length = skb->len; | ||
299 | __entry->snd_nxt = tp->snd_nxt; | ||
300 | __entry->snd_una = tp->snd_una; | ||
301 | __entry->snd_cwnd = tp->snd_cwnd; | ||
302 | __entry->snd_wnd = tp->snd_wnd; | ||
303 | __entry->rcv_wnd = tp->rcv_wnd; | ||
304 | __entry->ssthresh = tcp_current_ssthresh(sk); | ||
305 | __entry->srtt = tp->srtt_us >> 3; | ||
306 | ), | ||
307 | |||
308 | TP_printk("src=%pISpc dest=%pISpc mark=%#x length=%d snd_nxt=%#x " | ||
309 | "snd_una=%#x snd_cwnd=%u ssthresh=%u snd_wnd=%u srtt=%u " | ||
310 | "rcv_wnd=%u", | ||
311 | __entry->saddr, __entry->daddr, __entry->mark, | ||
312 | __entry->length, __entry->snd_nxt, __entry->snd_una, | ||
313 | __entry->snd_cwnd, __entry->ssthresh, __entry->snd_wnd, | ||
314 | __entry->srtt, __entry->rcv_wnd) | ||
315 | ); | ||
316 | |||
273 | #endif /* _TRACE_TCP_H */ | 317 | #endif /* _TRACE_TCP_H */ |
274 | 318 | ||
275 | /* This part must be outside protection */ | 319 | /* This part must be outside protection */ |