Fix: net: expose sk wmem in sock_exceed_buf_limit tracepoint (4.19)
[lttng-modules.git] / instrumentation / events / lttng-module / sock.h
CommitLineData
b283666f
PW
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM sock
3
3bc29f0a
MD
4#if !defined(LTTNG_TRACE_SOCK_H) || defined(TRACE_HEADER_MULTI_READ)
5#define LTTNG_TRACE_SOCK_H
b283666f 6
6ec43db8 7#include <probes/lttng-tracepoint-event.h>
26e44827 8#include <linux/version.h>
b283666f 9#include <net/sock.h>
b283666f 10
3bc29f0a 11LTTNG_TRACEPOINT_EVENT(sock_rcvqueue_full,
b283666f
PW
12
13 TP_PROTO(struct sock *sk, struct sk_buff *skb),
14
15 TP_ARGS(sk, skb),
16
f127e61e
MD
17 TP_FIELDS(
18 ctf_integer(int, rmem_alloc, atomic_read(&sk->sk_rmem_alloc))
19 ctf_integer(unsigned int, truesize, skb->truesize)
20 ctf_integer(int, sk_rcvbuf, sk->sk_rcvbuf)
21 )
b283666f
PW
22)
23
9e67b4c9
MJ
24#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0))
25
26LTTNG_TRACEPOINT_EVENT(sock_exceed_buf_limit,
27
28 TP_PROTO(struct sock *sk, struct proto *prot, long allocated, int kind),
29
30 TP_ARGS(sk, prot, allocated, kind),
31
32 TP_FIELDS(
33 ctf_string(name, prot->name)
34 ctf_array(long, sysctl_mem, prot->sysctl_mem, 3)
35 ctf_integer(long, allocated, allocated)
36 ctf_integer(int, sysctl_rmem, sk_get_rmem0(sk, prot))
37 ctf_integer(int, rmem_alloc, atomic_read(&sk->sk_rmem_alloc))
38 ctf_integer(int, sysctl_wmem, sk_get_wmem0(sk, prot))
39 ctf_integer(int, wmem_alloc, refcount_read(&sk->sk_wmem_alloc))
40 ctf_integer(int, wmem_queued, sk->sk_wmem_queued)
41 ctf_integer(int, kind, kind)
42 )
43)
44
45#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0))
26e44827
MD
46
47LTTNG_TRACEPOINT_EVENT(sock_exceed_buf_limit,
48
49 TP_PROTO(struct sock *sk, struct proto *prot, long allocated),
50
51 TP_ARGS(sk, prot, allocated),
52
53 TP_FIELDS(
54 ctf_string(name, prot->name)
55 ctf_array(long, sysctl_mem, prot->sysctl_mem, 3)
56 ctf_integer(long, allocated, allocated)
57 ctf_integer(int, sysctl_rmem, sk_get_rmem0(sk, prot))
58 ctf_integer(int, rmem_alloc, atomic_read(&sk->sk_rmem_alloc))
59 )
60)
61
62#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)) */
63
3bc29f0a 64LTTNG_TRACEPOINT_EVENT(sock_exceed_buf_limit,
b283666f
PW
65
66 TP_PROTO(struct sock *sk, struct proto *prot, long allocated),
67
68 TP_ARGS(sk, prot, allocated),
69
f127e61e
MD
70 TP_FIELDS(
71 ctf_string(name, prot->name)
72 ctf_array(long, sysctl_mem, prot->sysctl_mem, 3)
73 ctf_integer(long, allocated, allocated)
74 ctf_integer(int, sysctl_rmem, prot->sysctl_rmem[0])
75 ctf_integer(int, rmem_alloc, atomic_read(&sk->sk_rmem_alloc))
76 )
b283666f
PW
77)
78
26e44827
MD
79#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)) */
80
3bc29f0a 81#endif /* LTTNG_TRACE_SOCK_H */
b283666f
PW
82
83/* This part must be outside protection */
6ec43db8 84#include <probes/define_trace.h>
This page took 0.03383 seconds and 4 git commands to generate.