[PATCH] net/tcp_ao: tracing: Hide tcp_ao events under CONFIG_TCP_AO

Steven Rostedt posted 1 patch 4 months ago
include/trace/events/tcp.h | 2 ++
1 file changed, 2 insertions(+)
[PATCH] net/tcp_ao: tracing: Hide tcp_ao events under CONFIG_TCP_AO
Posted by Steven Rostedt 4 months ago
From: Steven Rostedt <rostedt@goodmis.org>

Several of the tcp_ao events are only called when CONFIG_TCP_AO 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.

Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
Note, I will be adding code soon that will make unused event cause a warning.

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

diff --git a/include/trace/events/tcp.h b/include/trace/events/tcp.h
index 95f59c1a6f57..54e60c6009e3 100644
--- a/include/trace/events/tcp.h
+++ b/include/trace/events/tcp.h
@@ -692,6 +692,7 @@ DEFINE_EVENT(tcp_ao_event, tcp_ao_handshake_failure,
 	TP_ARGS(sk, skb, keyid, rnext, maclen)
 );
 
+#ifdef CONFIG_TCP_AO
 DEFINE_EVENT(tcp_ao_event, tcp_ao_wrong_maclen,
 	TP_PROTO(const struct sock *sk, const struct sk_buff *skb,
 		 const __u8 keyid, const __u8 rnext, const __u8 maclen),
@@ -830,6 +831,7 @@ DEFINE_EVENT(tcp_ao_event_sne, tcp_ao_rcv_sne_update,
 	TP_PROTO(const struct sock *sk, __u32 new_sne),
 	TP_ARGS(sk, new_sne)
 );
+#endif /* CONFIG_TCP_AO */
 
 #endif /* _TRACE_TCP_H */
 
-- 
2.47.2
Re: [PATCH] net/tcp_ao: tracing: Hide tcp_ao events under CONFIG_TCP_AO
Posted by Simon Horman 3 months, 4 weeks ago
On Thu, Jun 12, 2025 at 09:46:16AM -0400, Steven Rostedt wrote:
> From: Steven Rostedt <rostedt@goodmis.org>
> 
> Several of the tcp_ao events are only called when CONFIG_TCP_AO 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.
> 
> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>

Thanks Steven,

I agree that the events and classes covered by this #define
are not used unless CONFIG_TCP_AO is set. And that the small
number of TCP_AO related events that are left outside
the define are used even when CONFIG_TCP_AO is not set.

Reviewed-by: Simon Horman <horms@kernel.org>
Re: [PATCH] net/tcp_ao: tracing: Hide tcp_ao events under CONFIG_TCP_AO
Posted by Steven Rostedt 3 months, 3 weeks ago
On Sat, 14 Jun 2025 16:30:03 +0100
Simon Horman <horms@kernel.org> wrote:

> I agree that the events and classes covered by this #define
> are not used unless CONFIG_TCP_AO is set. And that the small
> number of TCP_AO related events that are left outside
> the define are used even when CONFIG_TCP_AO is not set.
> 
> Reviewed-by: Simon Horman <horms@kernel.org>

Thanks,

Should I take this or should this go through the networking tree?

-- Steve
Re: [PATCH] net/tcp_ao: tracing: Hide tcp_ao events under CONFIG_TCP_AO
Posted by Jakub Kicinski 3 months, 3 weeks ago
On Mon, 16 Jun 2025 14:47:18 -0400 Steven Rostedt wrote:
> On Sat, 14 Jun 2025 16:30:03 +0100
> Simon Horman <horms@kernel.org> wrote:
> 
> > I agree that the events and classes covered by this #define
> > are not used unless CONFIG_TCP_AO is set. And that the small
> > number of TCP_AO related events that are left outside
> > the define are used even when CONFIG_TCP_AO is not set.
> > 
> > Reviewed-by: Simon Horman <horms@kernel.org>  
> 
> Should I take this or should this go through the networking tree?

Weak preference towards networking tree. We'll apply by the end of 
the day.
Re: [PATCH] net/tcp_ao: tracing: Hide tcp_ao events under CONFIG_TCP_AO
Posted by Steven Rostedt 3 months, 3 weeks ago
On Mon, 16 Jun 2025 13:18:25 -0700
Jakub Kicinski <kuba@kernel.org> wrote:

> On Mon, 16 Jun 2025 14:47:18 -0400 Steven Rostedt wrote:
> > On Sat, 14 Jun 2025 16:30:03 +0100
> > Simon Horman <horms@kernel.org> wrote:
> >   
> > > I agree that the events and classes covered by this #define
> > > are not used unless CONFIG_TCP_AO is set. And that the small
> > > number of TCP_AO related events that are left outside
> > > the define are used even when CONFIG_TCP_AO is not set.
> > > 
> > > Reviewed-by: Simon Horman <horms@kernel.org>    
> > 
> > Should I take this or should this go through the networking tree?  
> 
> Weak preference towards networking tree. We'll apply by the end of 
> the day.

Thanks, much appreciated.

-- Steve