linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] xdp: tracing: Hide some xdp events under CONFIG_BPF_SYSCALL
@ 2025-06-12 22:20 Steven Rostedt
  2025-06-13  2:16 ` Alexei Starovoitov
  2025-06-13  8:47 ` Toke Høiland-Jørgensen
  0 siblings, 2 replies; 6+ messages in thread
From: Steven Rostedt @ 2025-06-12 22:20 UTC (permalink / raw)
  To: LKML, Linux trace kernel, bpf
  Cc: Masami Hiramatsu, Mathieu Desnoyers, Alexei Starovoitov,
	Daniel Borkmann, David S. Miller, Jakub Kicinski,
	Jesper Dangaard Brouer, John Fastabend

From: Steven Rostedt <rostedt@goodmis.org>

The events xdp_cpumap_kthread, xdp_cpumap_enqueue and xdp_devmap_xmit are
only called when CONFIG_BPF_SYSCALL is defined.  As each event can take up
to 5K regardless if they are used or not, it's best not to define them
when they are not used. Add #ifdef around these events when they are not
used.

Acked-by: Jesper Dangaard Brouer <hawk@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
Changes since v1: https://lore.kernel.org/20250612101612.3d4509cc@batman.local.home

- Rebased on top of bpf-next

 include/trace/events/xdp.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/trace/events/xdp.h b/include/trace/events/xdp.h
index d3ef86c97ae3..746a9e95a52a 100644
--- a/include/trace/events/xdp.h
+++ b/include/trace/events/xdp.h
@@ -187,6 +187,7 @@ DEFINE_EVENT(xdp_redirect_template, xdp_redirect_map_err,
 	TP_ARGS(dev, xdp, tgt, err, map_type, map_id, index)
 );
 
+#ifdef CONFIG_BPF_SYSCALL
 TRACE_EVENT(xdp_cpumap_kthread,
 
 	TP_PROTO(int map_id, unsigned int processed,  unsigned int drops,
@@ -300,6 +301,7 @@ TRACE_EVENT(xdp_devmap_xmit,
 		  __entry->sent, __entry->drops,
 		  __entry->err)
 );
+#endif /* CONFIG_BPF_SYSCALL */
 
 /* Expect users already include <net/xdp.h>, but not xdp_priv.h */
 #include <net/xdp_priv.h>
-- 
2.47.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] xdp: tracing: Hide some xdp events under CONFIG_BPF_SYSCALL
  2025-06-12 22:20 [PATCH v2] xdp: tracing: Hide some xdp events under CONFIG_BPF_SYSCALL Steven Rostedt
@ 2025-06-13  2:16 ` Alexei Starovoitov
  2025-06-13  2:26   ` Steven Rostedt
  2025-06-13  8:47 ` Toke Høiland-Jørgensen
  1 sibling, 1 reply; 6+ messages in thread
From: Alexei Starovoitov @ 2025-06-13  2:16 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: LKML, Linux trace kernel, bpf, Masami Hiramatsu,
	Mathieu Desnoyers, Alexei Starovoitov, Daniel Borkmann,
	David S. Miller, Jakub Kicinski, Jesper Dangaard Brouer,
	John Fastabend

On Thu, Jun 12, 2025 at 3:20 PM Steven Rostedt <rostedt@goodmis.org> wrote:
>
> From: Steven Rostedt <rostedt@goodmis.org>
>
> The events xdp_cpumap_kthread, xdp_cpumap_enqueue and xdp_devmap_xmit are
> only called when CONFIG_BPF_SYSCALL is defined.  As each event can take up
> to 5K regardless if they are used or not, it's best not to define them
> when they are not used. Add #ifdef around these events when they are not
> used.
>
> Acked-by: Jesper Dangaard Brouer <hawk@kernel.org>
> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
> ---
> Changes since v1: https://lore.kernel.org/20250612101612.3d4509cc@batman.local.home
>
> - Rebased on top of bpf-next

We can certainly take it, but you mentioned you're working
on some patches that will warn when tracepoint is not used.
So do you need this to land sooner than the next merge window ?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] xdp: tracing: Hide some xdp events under CONFIG_BPF_SYSCALL
  2025-06-13  2:16 ` Alexei Starovoitov
@ 2025-06-13  2:26   ` Steven Rostedt
  2025-06-13  2:28     ` Steven Rostedt
  2025-06-13 18:52     ` Alexei Starovoitov
  0 siblings, 2 replies; 6+ messages in thread
From: Steven Rostedt @ 2025-06-13  2:26 UTC (permalink / raw)
  To: Alexei Starovoitov
  Cc: LKML, Linux trace kernel, bpf, Masami Hiramatsu,
	Mathieu Desnoyers, Alexei Starovoitov, Daniel Borkmann,
	David S. Miller, Jakub Kicinski, Jesper Dangaard Brouer,
	John Fastabend

On Thu, 12 Jun 2025 19:16:33 -0700
Alexei Starovoitov <alexei.starovoitov@gmail.com> wrote:

> On Thu, Jun 12, 2025 at 3:20 PM Steven Rostedt <rostedt@goodmis.org> wrote:
> >
> > From: Steven Rostedt <rostedt@goodmis.org>
> >
> > The events xdp_cpumap_kthread, xdp_cpumap_enqueue and xdp_devmap_xmit are
> > only called when CONFIG_BPF_SYSCALL is defined.  As each event can take up
> > to 5K regardless if they are used or not, it's best not to define them
> > when they are not used. Add #ifdef around these events when they are not
> > used.
> >
> > Acked-by: Jesper Dangaard Brouer <hawk@kernel.org>
> > Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
> > ---
> > Changes since v1: https://lore.kernel.org/20250612101612.3d4509cc@batman.local.home
> >
> > - Rebased on top of bpf-next  
> 
> We can certainly take it, but you mentioned you're working
> on some patches that will warn when tracepoint is not used.
> So do you need this to land sooner than the next merge window ?

No. I plan on sending that code near the end of the next merge window
to let these patches get in before they start to add warnings.

I'm also going to wait till near the end of this cycle before I add
that code to linux-next to keep the warnings happening there too soon.

So, please take it. That way there's less likelihood of another
conflict.

Thanks,

-- Steve

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] xdp: tracing: Hide some xdp events under CONFIG_BPF_SYSCALL
  2025-06-13  2:26   ` Steven Rostedt
@ 2025-06-13  2:28     ` Steven Rostedt
  2025-06-13 18:52     ` Alexei Starovoitov
  1 sibling, 0 replies; 6+ messages in thread
From: Steven Rostedt @ 2025-06-13  2:28 UTC (permalink / raw)
  To: Alexei Starovoitov
  Cc: LKML, Linux trace kernel, bpf, Masami Hiramatsu,
	Mathieu Desnoyers, Alexei Starovoitov, Daniel Borkmann,
	David S. Miller, Jakub Kicinski, Jesper Dangaard Brouer,
	John Fastabend

On Thu, 12 Jun 2025 22:26:52 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:
> 
> > We can certainly take it, but you mentioned you're working
> > on some patches that will warn when tracepoint is not used.
> > So do you need this to land sooner than the next merge window ?  
> 

BTW, if you are curious about those patches, I just posted them:

https://lore.kernel.org/linux-trace-kernel/20250612235827.011358765@goodmis.org/

-- Steve

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] xdp: tracing: Hide some xdp events under CONFIG_BPF_SYSCALL
  2025-06-12 22:20 [PATCH v2] xdp: tracing: Hide some xdp events under CONFIG_BPF_SYSCALL Steven Rostedt
  2025-06-13  2:16 ` Alexei Starovoitov
@ 2025-06-13  8:47 ` Toke Høiland-Jørgensen
  1 sibling, 0 replies; 6+ messages in thread
From: Toke Høiland-Jørgensen @ 2025-06-13  8:47 UTC (permalink / raw)
  To: Steven Rostedt, LKML, Linux trace kernel, bpf
  Cc: Masami Hiramatsu, Mathieu Desnoyers, Alexei Starovoitov,
	Daniel Borkmann, David S. Miller, Jakub Kicinski,
	Jesper Dangaard Brouer, John Fastabend

Steven Rostedt <rostedt@goodmis.org> writes:

> From: Steven Rostedt <rostedt@goodmis.org>
>
> The events xdp_cpumap_kthread, xdp_cpumap_enqueue and xdp_devmap_xmit are
> only called when CONFIG_BPF_SYSCALL is defined.  As each event can take up
> to 5K regardless if they are used or not, it's best not to define them
> when they are not used. Add #ifdef around these events when they are not
> used.
>
> Acked-by: Jesper Dangaard Brouer <hawk@kernel.org>
> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>

Reviewed-by: Toke Høiland-Jørgensen <toke@kernel.org>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] xdp: tracing: Hide some xdp events under CONFIG_BPF_SYSCALL
  2025-06-13  2:26   ` Steven Rostedt
  2025-06-13  2:28     ` Steven Rostedt
@ 2025-06-13 18:52     ` Alexei Starovoitov
  1 sibling, 0 replies; 6+ messages in thread
From: Alexei Starovoitov @ 2025-06-13 18:52 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: LKML, Linux trace kernel, bpf, Masami Hiramatsu,
	Mathieu Desnoyers, Alexei Starovoitov, Daniel Borkmann,
	David S. Miller, Jakub Kicinski, Jesper Dangaard Brouer,
	John Fastabend

On Thu, Jun 12, 2025 at 7:27 PM Steven Rostedt <rostedt@goodmis.org> wrote:
>
> On Thu, 12 Jun 2025 19:16:33 -0700
> Alexei Starovoitov <alexei.starovoitov@gmail.com> wrote:
>
> > On Thu, Jun 12, 2025 at 3:20 PM Steven Rostedt <rostedt@goodmis.org> wrote:
> > >
> > > From: Steven Rostedt <rostedt@goodmis.org>
> > >
> > > The events xdp_cpumap_kthread, xdp_cpumap_enqueue and xdp_devmap_xmit are
> > > only called when CONFIG_BPF_SYSCALL is defined.  As each event can take up
> > > to 5K regardless if they are used or not, it's best not to define them
> > > when they are not used. Add #ifdef around these events when they are not
> > > used.
> > >
> > > Acked-by: Jesper Dangaard Brouer <hawk@kernel.org>
> > > Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
> > > ---
> > > Changes since v1: https://lore.kernel.org/20250612101612.3d4509cc@batman.local.home
> > >
> > > - Rebased on top of bpf-next
> >
> > We can certainly take it, but you mentioned you're working
> > on some patches that will warn when tracepoint is not used.
> > So do you need this to land sooner than the next merge window ?
>
> No. I plan on sending that code near the end of the next merge window
> to let these patches get in before they start to add warnings.
>
> I'm also going to wait till near the end of this cycle before I add
> that code to linux-next to keep the warnings happening there too soon.
>
> So, please take it. That way there's less likelihood of another
> conflict.

It was applied to bpf-next/net yesterday.
pw-bot didn't notice.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-06-13 18:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-12 22:20 [PATCH v2] xdp: tracing: Hide some xdp events under CONFIG_BPF_SYSCALL Steven Rostedt
2025-06-13  2:16 ` Alexei Starovoitov
2025-06-13  2:26   ` Steven Rostedt
2025-06-13  2:28     ` Steven Rostedt
2025-06-13 18:52     ` Alexei Starovoitov
2025-06-13  8:47 ` Toke Høiland-Jørgensen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).