From: Michael Jeanson Date: Mon, 27 May 2024 15:11:21 +0000 (-0400) Subject: fix: net: udp: add IP/port data to the tracepoint udp/udp_fail_queue_rcv_skb (v6.10) X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=8c34b41250497ef69693f3e14045ede4aa076207;p=lttng-modules.git fix: net: udp: add IP/port data to the tracepoint udp/udp_fail_queue_rcv_skb (v6.10) See upstream commit: commit e9669a00bba79442dd4862c57761333d6a020c24 Author: Balazs Scheidler 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 Signed-off-by: Mathieu Desnoyers --- diff --git a/include/instrumentation/events/udp.h b/include/instrumentation/events/udp.h index b63a1bb5..0a94b466 100644 --- a/include/instrumentation/events/udp.h +++ b/include/instrumentation/events/udp.h @@ -7,7 +7,36 @@ #include #include +#include +#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 */