]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
xdp: tracing: Hide some xdp events under CONFIG_BPF_SYSCALL
authorSteven Rostedt <rostedt@goodmis.org>
Thu, 12 Jun 2025 22:20:23 +0000 (18:20 -0400)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 13 Jun 2025 02:36:53 +0000 (19:36 -0700)
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>
Link: https://lore.kernel.org/r/20250612182023.78397b76@batman.local.home
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
include/trace/events/xdp.h

index 0fe0893c2567d2a3e1a51c483345ec53d983c991..18c0ac514fcbd293a1e248c89fb17e54a2d36e15 100644 (file)
@@ -168,6 +168,7 @@ DEFINE_EVENT(xdp_redirect_template, xdp_redirect_err,
 #define _trace_xdp_redirect_map_err(dev, xdp, to, map_type, map_id, index, err) \
         trace_xdp_redirect_err(dev, xdp, to, 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,
@@ -281,6 +282,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>