[PATCH 07/14] xfs: ifdef out unused xfs_attr events

Steven Rostedt posted 14 patches 3 months, 4 weeks ago
[PATCH 07/14] xfs: ifdef out unused xfs_attr events
Posted by Steven Rostedt 3 months, 4 weeks ago
From: Steven Rostedt <rostedt@goodmis.org>

Trace events can take up to 5K in memory for text and meta data per event
regardless if they are used or not, so they should not be defined when not
used. The events xfs_attr_fillstate and xfs_attr_refillstate are only
called in code that is #ifdef out and exists only for future reference.

Ifdef out the events that go with that code and add a comment mentioning
the other code.

Fixes: 59782a236b622 ("xfs: remove xfs_attri_remove_iter")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
 fs/xfs/xfs_trace.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h
index cdc639198bb9..bd4e5a727b73 100644
--- a/fs/xfs/xfs_trace.h
+++ b/fs/xfs/xfs_trace.h
@@ -2467,8 +2467,14 @@ DEFINE_ATTR_EVENT(xfs_attr_node_get);
 DEFINE_ATTR_EVENT(xfs_attr_node_replace);
 DEFINE_ATTR_EVENT(xfs_attr_node_removename);
 
+/*
+ * When the corresponding code in xfs_attr.c is re-enabled
+ * then so can these trace events.
+ */
+#if 0
 DEFINE_ATTR_EVENT(xfs_attr_fillstate);
 DEFINE_ATTR_EVENT(xfs_attr_refillstate);
+#endif
 
 DEFINE_ATTR_EVENT(xfs_attr_rmtval_get);
 
-- 
2.47.2
Re: [PATCH 07/14] xfs: ifdef out unused xfs_attr events
Posted by Christoph Hellwig 3 months, 3 weeks ago
On Thu, Jun 12, 2025 at 05:24:12PM -0400, Steven Rostedt wrote:
> From: Steven Rostedt <rostedt@goodmis.org>
> 
> Trace events can take up to 5K in memory for text and meta data per event
> regardless if they are used or not, so they should not be defined when not
> used. The events xfs_attr_fillstate and xfs_attr_refillstate are only
> called in code that is #ifdef out and exists only for future reference.
> 
> Ifdef out the events that go with that code and add a comment mentioning
> the other code.

Just drop them entirely, which is what the code using them should
have done as well.  We can always triviall bring back code from
git history.
Re: [PATCH 07/14] xfs: ifdef out unused xfs_attr events
Posted by Steven Rostedt 3 months, 3 weeks ago
On Mon, 16 Jun 2025 07:28:10 +0200
Christoph Hellwig <hch@lst.de> wrote:

> On Thu, Jun 12, 2025 at 05:24:12PM -0400, Steven Rostedt wrote:
> > From: Steven Rostedt <rostedt@goodmis.org>
> > 
> > Trace events can take up to 5K in memory for text and meta data per event
> > regardless if they are used or not, so they should not be defined when not
> > used. The events xfs_attr_fillstate and xfs_attr_refillstate are only
> > called in code that is #ifdef out and exists only for future reference.
> > 
> > Ifdef out the events that go with that code and add a comment mentioning
> > the other code.  
> 
> Just drop them entirely, which is what the code using them should
> have done as well.  We can always triviall bring back code from
> git history.

OK. But I'll only send a patch to delete the trace events. I'll let
someone else remove the actual code.

-- Steve
Re: [PATCH 07/14] xfs: ifdef out unused xfs_attr events
Posted by Christoph Hellwig 3 months, 3 weeks ago
On Mon, Jun 16, 2025 at 10:52:14AM -0400, Steven Rostedt wrote:
> On Mon, 16 Jun 2025 07:28:10 +0200
> Christoph Hellwig <hch@lst.de> wrote:
> 
> > On Thu, Jun 12, 2025 at 05:24:12PM -0400, Steven Rostedt wrote:
> > > From: Steven Rostedt <rostedt@goodmis.org>
> > > 
> > > Trace events can take up to 5K in memory for text and meta data per event
> > > regardless if they are used or not, so they should not be defined when not
> > > used. The events xfs_attr_fillstate and xfs_attr_refillstate are only
> > > called in code that is #ifdef out and exists only for future reference.
> > > 
> > > Ifdef out the events that go with that code and add a comment mentioning
> > > the other code.  
> > 
> > Just drop them entirely, which is what the code using them should
> > have done as well.  We can always triviall bring back code from
> > git history.
> 
> OK. But I'll only send a patch to delete the trace events. I'll let
> someone else remove the actual code.

Yeah, no need for you to fix up the other code.