4bde039584046b85e1f09b9c325c5412f6c40832
[lttng-modules.git] / instrumentation / events / lttng-module / sock.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #undef TRACE_SYSTEM
3 #define TRACE_SYSTEM sock
4
5 #if !defined(LTTNG_TRACE_SOCK_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define LTTNG_TRACE_SOCK_H
7
8 #include <probes/lttng-tracepoint-event.h>
9 #include <linux/version.h>
10 #include <net/sock.h>
11
12 LTTNG_TRACEPOINT_EVENT(sock_rcvqueue_full,
13
14 TP_PROTO(struct sock *sk, struct sk_buff *skb),
15
16 TP_ARGS(sk, skb),
17
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 )
23 )
24
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
44 LTTNG_TRACEPOINT_EVENT(sock_exceed_buf_limit,
45
46 TP_PROTO(struct sock *sk, struct proto *prot, long allocated),
47
48 TP_ARGS(sk, prot, allocated),
49
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 )
57 )
58
59 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)) */
60
61 #endif /* LTTNG_TRACE_SOCK_H */
62
63 /* This part must be outside protection */
64 #include <probes/define_trace.h>
This page took 0.029368 seconds and 3 git commands to generate.