fix: net: udp: add IP/port data to the tracepoint udp/udp_fail_queue_rcv_skb (v6.10) master
authorMichael Jeanson <mjeanson@efficios.com>
Mon, 27 May 2024 15:11:21 +0000 (11:11 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 28 May 2024 15:51:30 +0000 (11:51 -0400)
See upstream commit:

  commit e9669a00bba79442dd4862c57761333d6a020c24
  Author: Balazs Scheidler <bazsi77@gmail.com>
  Date:   Tue Mar 26 19:05:47 2024 +0100

    net: udp: add IP/port data to the tracepoint udp/udp_fail_queue_rcv_skb

    The udp_fail_queue_rcv_skb() tracepoint lacks any details on the source
    and destination IP/port whereas this information can be critical in case
    of UDP/syslog.

Change-Id: I0c337c5817b0a120298cbf5088d60671d9625b0d
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/instrumentation/events/udp.h

index b63a1bb5dcb3a0f0f4d25415e0a6ccc5f96af50a..0a94b46631292cbd7b3ba91d0a33fa9b0c47e516 100644 (file)
@@ -7,7 +7,36 @@
 
 #include <lttng/tracepoint-event.h>
 #include <linux/udp.h>
+#include <lttng/kernel-version.h>
 
+#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,10,0))
+LTTNG_TRACEPOINT_ENUM(lttng_sk_family,
+       TP_ENUM_VALUES(
+               ctf_enum_value("AF_INET", AF_INET)
+               ctf_enum_value("AF_INET6", AF_INET6)
+       )
+)
+
+LTTNG_TRACEPOINT_EVENT(udp_fail_queue_rcv_skb,
+
+       TP_PROTO(int rc, struct sock *sk, struct sk_buff *skb),
+
+       TP_ARGS(rc, sk, skb),
+
+       TP_FIELDS(
+               ctf_integer(int, rc, rc)
+               ctf_integer(__u16, sport, ntohs(udp_hdr(skb)->source))
+               ctf_integer(__u16, dport, ntohs(udp_hdr(skb)->dest))
+               ctf_enum(lttng_sk_family, __u16, family, sk->sk_family)
+               /*
+                * The 'saddr' and 'daddr' fields from the upstream tracepoint
+                * are currently not extracted. It is recommended to use a
+                * tracepoint from the 'net' probe instead which includes all
+                * fields from the IP header.
+                */
+       )
+)
+#else
 LTTNG_TRACEPOINT_EVENT(udp_fail_queue_rcv_skb,
 
        TP_PROTO(int rc, struct sock *sk),
@@ -19,6 +48,7 @@ LTTNG_TRACEPOINT_EVENT(udp_fail_queue_rcv_skb,
                ctf_integer(__u16, lport, inet_sk(sk)->inet_num)
        )
 )
+#endif
 
 #endif /* LTTNG_TRACE_UDP_H */
 
This page took 0.0263 seconds and 4 git commands to generate.