Commit | Line | Data |
---|---|---|
9f36eaed | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
b283666f PW |
2 | #undef TRACE_SYSTEM |
3 | #define TRACE_SYSTEM sock | |
4 | ||
3bc29f0a MD |
5 | #if !defined(LTTNG_TRACE_SOCK_H) || defined(TRACE_HEADER_MULTI_READ) |
6 | #define LTTNG_TRACE_SOCK_H | |
b283666f | 7 | |
6ec43db8 | 8 | #include <probes/lttng-tracepoint-event.h> |
f279893a | 9 | #include <linux/version.h> |
b283666f | 10 | #include <net/sock.h> |
b283666f | 11 | |
3bc29f0a | 12 | LTTNG_TRACEPOINT_EVENT(sock_rcvqueue_full, |
b283666f PW |
13 | |
14 | TP_PROTO(struct sock *sk, struct sk_buff *skb), | |
15 | ||
16 | TP_ARGS(sk, skb), | |
17 | ||
f127e61e MD |
18 | TP_FIELDS( |
19 | ctf_integer(int, rmem_alloc, atomic_read(&sk->sk_rmem_alloc)) | |
20 | ctf_integer(unsigned int, truesize, skb->truesize) | |
21 | ctf_integer(int, sk_rcvbuf, sk->sk_rcvbuf) | |
22 | ) | |
b283666f PW |
23 | ) |
24 | ||
f279893a MD |
25 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)) |
26 | ||
27 | LTTNG_TRACEPOINT_EVENT(sock_exceed_buf_limit, | |
28 | ||
29 | TP_PROTO(struct sock *sk, struct proto *prot, long allocated), | |
30 | ||
31 | TP_ARGS(sk, prot, allocated), | |
32 | ||
33 | TP_FIELDS( | |
34 | ctf_string(name, prot->name) | |
35 | ctf_array(long, sysctl_mem, prot->sysctl_mem, 3) | |
36 | ctf_integer(long, allocated, allocated) | |
37 | ctf_integer(int, sysctl_rmem, sk_get_rmem0(sk, prot)) | |
38 | ctf_integer(int, rmem_alloc, atomic_read(&sk->sk_rmem_alloc)) | |
39 | ) | |
40 | ) | |
41 | ||
42 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)) */ | |
43 | ||
3bc29f0a | 44 | LTTNG_TRACEPOINT_EVENT(sock_exceed_buf_limit, |
b283666f PW |
45 | |
46 | TP_PROTO(struct sock *sk, struct proto *prot, long allocated), | |
47 | ||
48 | TP_ARGS(sk, prot, allocated), | |
49 | ||
f127e61e MD |
50 | TP_FIELDS( |
51 | ctf_string(name, prot->name) | |
52 | ctf_array(long, sysctl_mem, prot->sysctl_mem, 3) | |
53 | ctf_integer(long, allocated, allocated) | |
54 | ctf_integer(int, sysctl_rmem, prot->sysctl_rmem[0]) | |
55 | ctf_integer(int, rmem_alloc, atomic_read(&sk->sk_rmem_alloc)) | |
56 | ) | |
b283666f PW |
57 | ) |
58 | ||
f279893a MD |
59 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)) */ |
60 | ||
3bc29f0a | 61 | #endif /* LTTNG_TRACE_SOCK_H */ |
b283666f PW |
62 | |
63 | /* This part must be outside protection */ | |
6ec43db8 | 64 | #include <probes/define_trace.h> |