mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: Song Liu <songliubraving@meta.com>,
	 Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Cc: Song Liu <songliubraving@meta.com>,
	 Paolo Abeni <pabeni@redhat.com>,
	 Breno Leitao <leitao@debian.org>,
	 Steven Rostedt <rostedt@goodmis.org>,
	 Masami Hiramatsu <mhiramat@kernel.org>,
	 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	 "David S. Miller" <davem@davemloft.net>,
	 David Ahern <dsahern@kernel.org>,
	 Eric Dumazet <edumazet@google.com>,
	 "kuba@kernel.org" <kuba@kernel.org>,
	 Simon Horman <horms@kernel.org>,
	 "kuniyu@amazon.com" <kuniyu@amazon.com>,
	 "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	 "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	 "linux-trace-kernel@vger.kernel.org"
	<linux-trace-kernel@vger.kernel.org>,
	 "yonghong.song@linux.dev" <yonghong.song@linux.dev>,
	 "song@kernel.org" <song@kernel.org>,
	 Kernel Team <kernel-team@meta.com>
Subject: Re: [PATCH net-next] udp: Add tracepoint for udp_sendmsg()
Date: Fri, 18 Apr 2025 10:49:22 -0400	[thread overview]
Message-ID: <68026672df030_1d380329421@willemb.c.googlers.com.notmuch> (raw)
In-Reply-To: <B5B46BE2-C4D8-4AB8-BEBC-E0887C9B175D@fb.com>

Song Liu wrote:
> 
> 
> > On Apr 17, 2025, at 8:48 AM, Willem de Bruijn <willemdebruijn.kernel@gmail.com> wrote:
> > 
> > Song Liu wrote:
> >> Hi Paolo, 
> >> 
> >>> On Apr 17, 2025, at 6:17 AM, Paolo Abeni <pabeni@redhat.com> wrote:
> >>> 
> >>> On 4/17/25 1:34 PM, Breno Leitao wrote:
> >>>> On Thu, Apr 17, 2025 at 08:57:24AM +0200, Paolo Abeni wrote:
> >>>>> On 4/16/25 9:23 PM, Breno Leitao wrote:
> >>>>>> Add a lightweight tracepoint to monitor UDP send message operations,
> >>>>>> similar to the recently introduced tcp_sendmsg_locked() trace event in
> >>>>>> commit 0f08335ade712 ("trace: tcp: Add tracepoint for
> >>>>>> tcp_sendmsg_locked()")
> >>>>> 
> >>>>> Why is it needed? what would add on top of a plain perf probe, which
> >>>>> will be always available for such function with such argument, as the
> >>>>> function can't be inlined?
> >>>> 
> >>>> Why this function can't be inlined?
> >>> 
> >>> Because the kernel need to be able find a pointer to it:
> >>> 
> >>> .sendmsg = udp_sendmsg,
> >>> 
> >>> I'll be really curious to learn how the compiler could inline that.
> >> 
> >> It is true that functions that are only used via function pointers
> >> will not be inlined by compilers (at least for those we have tested).
> >> For this reason, we do not worry about functions in various
> >> tcp_congestion_ops. However, udp_sendmsg is also called directly
> >> by udpv6_sendmsg, so it can still get inlined by LTO. 
> >> 
> >> Thanks,
> >> Song
> >> 
> > 
> > I would think that hitting this tracepoint for ipv6_addr_v4mapped
> > addresses is unintentional and surprising, as those would already
> > hit udpv6_sendmsg.
> 
> It is up to the user to decide how these tracepoints should be 
> used. For example, the user may only be interested in 
> udpv6_sendmsg => udp_sendmsg case. Without a tracepoint, the user
> has to understand whether the compiler inlined this function. 
> 
> > 
> > On which note, any IPv4 change to UDP needs an equivalent IPv6 one.
> 
> Do you mean we need to also add tracepoints for udpv6_sendmsg?

If there is consensus that a tracepoint at this point is valuable,
then it should be supported equally for IPv4 and IPv6.

That holds true for all such hooks. No IPv4 only.

  reply	other threads:[~2025-04-18 14:49 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-16 19:23 Breno Leitao
2025-04-16 19:34 ` Willem de Bruijn
2025-04-17 11:31   ` Breno Leitao
2025-04-17 13:38     ` Willem de Bruijn
2025-04-16 23:16 ` David Ahern
2025-04-17 11:42   ` Breno Leitao
2025-04-17 15:55     ` David Ahern
2025-04-17 16:00       ` Breno Leitao
2025-04-18  4:57         ` David Ahern
2025-04-18 12:33           ` Steven Rostedt
2025-04-18 14:47             ` Steven Rostedt
2025-04-17  6:57 ` Paolo Abeni
2025-04-17 11:34   ` Breno Leitao
2025-04-17 13:17     ` Paolo Abeni
2025-04-17 15:37       ` Song Liu
2025-04-17 15:48         ` Willem de Bruijn
2025-04-17 20:00           ` Song Liu
2025-04-18 14:49             ` Willem de Bruijn [this message]
2025-05-27 13:45               ` Breno Leitao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=68026672df030_1d380329421@willemb.c.googlers.com.notmuch \
    --to=willemdebruijn.kernel@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kernel-team@meta.com \
    --cc=kuba@kernel.org \
    --cc=kuniyu@amazon.com \
    --cc=leitao@debian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=song@kernel.org \
    --cc=songliubraving@meta.com \
    --cc=yonghong.song@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®