Skip to contentSkip to conversation

xfs: tracing: remove unused event xfs_reflink_cow_found

PATCH In review Steven Rostedt 2 participants 19 messages Jun 16, 2025 – Jul 9, 2025

Subsystems (2)
lore
Share & tools
lore

Steven Rostedt

author maintainer
#0 lore raw

v2 cover xfs: tracing: remove unused event xfs_reflink_cow_found

Trace events take up to 5K in memory for text and meta data. I have code that will trigger a warning when it detects unused tracepoints[1]. The XFS file system contains many events that are not called. Most of them used to be called but due to code refactoring the calls were removed but the trace events stayed behind.

Some events were added but never used. If they were recent, I just reported them, but if they were older, this series simply removes them.

One is called only when CONFIG_COMPACT is defined, so an #ifdef was placed around it.

Finally, one event is supposed to be a trace event class, but was created with the TRACE_EVENT() macro and not the DECLARE_EVENT_CLASS() macro. This works because a TRACE_EVENT() is simply a DECLARE_EVENT_CLASS() and DEFINE_EVENT() where the class and event have the same name. But as this was a mistake, the event created should not exist.

[1] https://patchwork.kernel.org/project/linux-trace-kernel/cover/[email protected]/

Changes since v1: https://lore.kernel.org/linux-trace-kernel/[email protected]/

- Removed the first patch that mistakenly removed xfs_reflink_cow_found

- Change subjects to start with lowercase

- Removed xfs_attr events that are used in an #if 0 section instead of adding #if 0 around them

- I added: Reviewed-by: Christoph Hellwig <[email protected]> to all patches but the one with the modified #if 0 as Christoph said he looked at them all.

Steven Rostedt (13):
xfs: remove unused trace event xfs_attr_remove_iter_return
xfs: remove unused event xlog_iclog_want_sync
xfs: remove unused event xfs_ioctl_clone
xfs: remove unused xfs_reflink_compare_extents events
xfs: remove unused trace event xfs_attr_rmtval_set
xfs: remove unused xfs_attr events
xfs: remove unused event xfs_attr_node_removename
xfs: remove unused event xfs_alloc_near_error
xfs: remove unused event xfs_alloc_near_nominleft
xfs: remove unused event xfs_pagecache_inval
xfs: remove usused xfs_end_io_direct events
xfs: only create event xfs_file_compat_ioctl when CONFIG_COMPAT is configure
xfs: change xfs_xattr_class from a TRACE_EVENT() to DECLARE_EVENT_CLASS()

----

 fs/xfs/scrub/trace.h |  2 +-
 fs/xfs/xfs_trace.h   | 68 ++--------------------------------------------------
 2 files changed, 3 insertions(+), 67 deletions(-)
author maintainer
#1 lore raw

PATCH v2 1/13 xfs: remove unused trace event xfs_attr_remove_iter_return

From: Steven Rostedt <[email protected]>

When the function xfs_attri_remove_iter was removed, it did not remove the trace event that it called. As a trace event can take up to 5K of memory for text and meta data regardless of if it is used or not, remove this unused trace event.

Fixes 59782a236b62 ("xfs: remove xfs_attri_remove_iter")
---
 fs/xfs/xfs_trace.h | 1 -
 1 file changed, 1 deletion(-)
fs/xfs/xfs_trace.h +0 -1
index 01d284a1c759..a8867f62ba18 100644
@@ -5077,7 +5077,6 @@ DEFINE_DAS_STATE_EVENT(xfs_attr_sf_addname_return);
 DEFINE_DAS_STATE_EVENT(xfs_attr_set_iter_return);
 DEFINE_DAS_STATE_EVENT(xfs_attr_leaf_addname_return);
 DEFINE_DAS_STATE_EVENT(xfs_attr_node_addname_return);
-DEFINE_DAS_STATE_EVENT(xfs_attr_remove_iter_return);
 DEFINE_DAS_STATE_EVENT(xfs_attr_rmtval_alloc);
 DEFINE_DAS_STATE_EVENT(xfs_attr_rmtval_remove_return);
 DEFINE_DAS_STATE_EVENT(xfs_attr_defer_add);
Signature · 1 line
2.47.2
author maintainer
#2 lore raw

PATCH v2 2/13 xfs: remove unused event xlog_iclog_want_sync

In reply to Steven Rostedt

From: Steven Rostedt <[email protected]>

The trace event xlog_iclog_want_sync was added but never used. As trace events can take up around 5K of memory in text and meta data regardless if they are used or not, remove this unused event.

Fixes 956f6daa84bf ("xfs: add iclog state trace events")
---
 fs/xfs/xfs_trace.h | 1 -
 1 file changed, 1 deletion(-)
fs/xfs/xfs_trace.h +0 -1
index a8867f62ba18..b78676f44750 100644
@@ -5028,7 +5028,6 @@ DEFINE_ICLOG_EVENT(xlog_iclog_switch);
 DEFINE_ICLOG_EVENT(xlog_iclog_sync);
 DEFINE_ICLOG_EVENT(xlog_iclog_syncing);
 DEFINE_ICLOG_EVENT(xlog_iclog_sync_done);
-DEFINE_ICLOG_EVENT(xlog_iclog_want_sync);
 DEFINE_ICLOG_EVENT(xlog_iclog_wait_on);
 DEFINE_ICLOG_EVENT(xlog_iclog_write);
 
Signature · 1 line
2.47.2
author maintainer
#3 lore raw

PATCH v2 3/13 xfs: remove unused event xfs_ioctl_clone

In reply to Steven Rostedt

From: Steven Rostedt <[email protected]>

The trace event xfs_ioctl_clone was added but never used. As trace events can take up to 5K of memory in text and meta data regardless if they are used or not, remove the unused trace event.

Fixes 53aa1c34f4eb ("xfs: define tracepoints for reflink activities")
---
 fs/xfs/xfs_trace.h | 26 --------------------------
 1 file changed, 26 deletions(-)
fs/xfs/xfs_trace.h +0 -26
index b78676f44750..993397f4767c 100644
@@ -4210,32 +4210,6 @@ DEFINE_INODE_IREC_EVENT(xfs_reflink_remap_extent_dest);
 DEFINE_DOUBLE_IO_EVENT(xfs_reflink_compare_extents);
 DEFINE_INODE_ERROR_EVENT(xfs_reflink_compare_extents_error);
 
-/* ioctl tracepoints */
-TRACE_EVENT(xfs_ioctl_clone,
-	TP_PROTO(struct inode *src, struct inode *dest),
-	TP_ARGS(src, dest),
-	TP_STRUCT__entry(
-		__field(dev_t, dev)
-		__field(unsigned long, src_ino)
-		__field(loff_t, src_isize)
-		__field(unsigned long, dest_ino)
-		__field(loff_t, dest_isize)
-	),
-	TP_fast_assign(
-		__entry->dev = src->i_sb->s_dev;
-		__entry->src_ino = src->i_ino;
-		__entry->src_isize = i_size_read(src);
-		__entry->dest_ino = dest->i_ino;
-		__entry->dest_isize = i_size_read(dest);
-	),
-	TP_printk("dev %d:%d ino 0x%lx isize 0x%llx -> ino 0x%lx isize 0x%llx",
-		  MAJOR(__entry->dev), MINOR(__entry->dev),
-		  __entry->src_ino,
-		  __entry->src_isize,
-		  __entry->dest_ino,
-		  __entry->dest_isize)
-);
-
 /* unshare tracepoints */
 DEFINE_SIMPLE_IO_EVENT(xfs_reflink_unshare);
 DEFINE_INODE_ERROR_EVENT(xfs_reflink_unshare_error);
Signature · 1 line
2.47.2
author maintainer
#4 lore raw

PATCH v2 4/13 xfs: remove unused xfs_reflink_compare_extents events

In reply to Steven Rostedt

From: Steven Rostedt <[email protected]>

When the clone/dedupe_file_rang common functions were refactored, it removed the calls to the xfs_reflink_compare_extents and xfs_reflink_compare_extents_error events. As each event can take up to 5K in memory for text and meta data regardless if they are used or not, they should not be created if they are not used. Remove these unused events.

Fixes 876bec6f9bbf ("vfs: refactor clone/dedupe_file_range common functions")
---
 fs/xfs/xfs_trace.h | 4 ----
 1 file changed, 4 deletions(-)
fs/xfs/xfs_trace.h +0 -4
index 993397f4767c..6ba8cf1a52c5 100644
@@ -4206,10 +4206,6 @@ DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_extent_error);
 DEFINE_INODE_IREC_EVENT(xfs_reflink_remap_extent_src);
 DEFINE_INODE_IREC_EVENT(xfs_reflink_remap_extent_dest);
 
-/* dedupe tracepoints */
-DEFINE_DOUBLE_IO_EVENT(xfs_reflink_compare_extents);
-DEFINE_INODE_ERROR_EVENT(xfs_reflink_compare_extents_error);
-
 /* unshare tracepoints */
 DEFINE_SIMPLE_IO_EVENT(xfs_reflink_unshare);
 DEFINE_INODE_ERROR_EVENT(xfs_reflink_unshare_error);
Signature · 1 line
2.47.2
author maintainer
#5 lore raw

PATCH v2 5/13 xfs: remove unused trace event xfs_attr_rmtval_set

In reply to Steven Rostedt

From: Steven Rostedt <[email protected]>

When the function xfs_attr_rmtval_set() was removed, the call to the corresponding trace event was also removed but the trace event itself was not. As trace events can take up to 5K of memory in text and meta data regardless if they are used or not they should not be created when not used. Remove the unused trace event.

Fixes 0e6acf29db6f ("xfs: Remove xfs_attr_rmtval_set")
---
 fs/xfs/xfs_trace.h | 1 -
 1 file changed, 1 deletion(-)
fs/xfs/xfs_trace.h +0 -1
index 6ba8cf1a52c5..f62afb388189 100644
@@ -2471,7 +2471,6 @@ DEFINE_ATTR_EVENT(xfs_attr_fillstate);
 DEFINE_ATTR_EVENT(xfs_attr_refillstate);
 
 DEFINE_ATTR_EVENT(xfs_attr_rmtval_get);
-DEFINE_ATTR_EVENT(xfs_attr_rmtval_set);
 
 #define DEFINE_DA_EVENT(name) \
 DEFINE_EVENT(xfs_da_class, name, \
Signature · 1 line
2.47.2
author maintainer
#6 lore raw

PATCH v2 6/13 xfs: remove unused xfs_attr events

In reply to Steven Rostedt

From: Steven Rostedt <[email protected]>

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.

Remove these unused events. If the code is needed again, then git history can recover what the events were.

Fixes 59782a236b622 ("xfs: remove xfs_attri_remove_iter")

---
Changes since v1: https://lore.kernel.org/[email protected]

- Remove the trace events from the header file instead of #if 0 them out.

 fs/xfs/xfs_trace.h | 3 ---
 1 file changed, 3 deletions(-)
fs/xfs/xfs_trace.h +0 -3
index f62afb388189..d41513c76652 100644
@@ -2467,9 +2467,6 @@ DEFINE_ATTR_EVENT(xfs_attr_node_get);
 DEFINE_ATTR_EVENT(xfs_attr_node_replace);
 DEFINE_ATTR_EVENT(xfs_attr_node_removename);
 
-DEFINE_ATTR_EVENT(xfs_attr_fillstate);
-DEFINE_ATTR_EVENT(xfs_attr_refillstate);
-
 DEFINE_ATTR_EVENT(xfs_attr_rmtval_get);
 
 #define DEFINE_DA_EVENT(name) \
Signature · 1 line
2.47.2
author maintainer
#7 lore raw

PATCH v2 7/13 xfs: remove unused event xfs_attr_node_removename

In reply to Steven Rostedt

From: Steven Rostedt <[email protected]>

When xfs_attri_remove_iter() was removed, so was the call to the trace event xfs_attr_node_removename. As trace events can take up to 5K in memory for text and meta data regardless if they are used or not, they should not be created when unused. Remove the unused event.

Fixes 59782a236b622 ("xfs: remove xfs_attri_remove_iter")
---
 fs/xfs/xfs_trace.h | 1 -
 1 file changed, 1 deletion(-)
fs/xfs/xfs_trace.h +0 -1
index d41513c76652..41a46f7d3fd6 100644
@@ -2465,7 +2465,6 @@ DEFINE_ATTR_EVENT(xfs_attr_leaf_toosmall);
 DEFINE_ATTR_EVENT(xfs_attr_node_addname);
 DEFINE_ATTR_EVENT(xfs_attr_node_get);
 DEFINE_ATTR_EVENT(xfs_attr_node_replace);
-DEFINE_ATTR_EVENT(xfs_attr_node_removename);
 
 DEFINE_ATTR_EVENT(xfs_attr_rmtval_get);
 
Signature · 1 line
2.47.2
author maintainer
#8 lore raw

PATCH v2 8/13 xfs: remove unused event xfs_alloc_near_error

In reply to Steven Rostedt

From: Steven Rostedt <[email protected]>

Trace events take up to 5K of memory in text and meta data regardless if they are used or not. The call to the event xfs_alloc_near_error was removed when the cursor data structure allocation was introduced. Remove it as it is no longer used and is just wasting memory.

Fixes f5e7dbea1e3e ("xfs: introduce allocation cursor data structure")
---
 fs/xfs/xfs_trace.h | 1 -
 1 file changed, 1 deletion(-)
fs/xfs/xfs_trace.h +0 -1
index 41a46f7d3fd6..d4004e21d0c5 100644
@@ -2270,7 +2270,6 @@ DEFINE_ALLOC_EVENT(xfs_alloc_cur_right);
 DEFINE_ALLOC_EVENT(xfs_alloc_cur_left);
 DEFINE_ALLOC_EVENT(xfs_alloc_cur_lookup);
 DEFINE_ALLOC_EVENT(xfs_alloc_cur_lookup_done);
-DEFINE_ALLOC_EVENT(xfs_alloc_near_error);
 DEFINE_ALLOC_EVENT(xfs_alloc_near_noentry);
 DEFINE_ALLOC_EVENT(xfs_alloc_near_busy);
 DEFINE_ALLOC_EVENT(xfs_alloc_size_neither);
Signature · 1 line
2.47.2
author maintainer
#9 lore raw

PATCH v2 9/13 xfs: remove unused event xfs_alloc_near_nominleft

In reply to Steven Rostedt

From: Steven Rostedt <[email protected]>

When the function xfs_alloc_space_available() was restructured, it removed the only calls to the trace event xfs_alloc_near_nominleft. As trace events take up to 5K of memory for text and meta data for each event, they should not be created when not used. Remove this unused event.

Fixes 54fee133ad59 ("xfs: adjust allocation length in xfs_alloc_space_available")
---
 fs/xfs/xfs_trace.h | 1 -
 1 file changed, 1 deletion(-)
fs/xfs/xfs_trace.h +0 -1
index d4004e21d0c5..e629ee44a9a1 100644
@@ -2263,7 +2263,6 @@ DEFINE_EVENT(xfs_alloc_class, name, \
 DEFINE_ALLOC_EVENT(xfs_alloc_exact_done);
 DEFINE_ALLOC_EVENT(xfs_alloc_exact_notfound);
 DEFINE_ALLOC_EVENT(xfs_alloc_exact_error);
-DEFINE_ALLOC_EVENT(xfs_alloc_near_nominleft);
 DEFINE_ALLOC_EVENT(xfs_alloc_near_first);
 DEFINE_ALLOC_EVENT(xfs_alloc_cur);
 DEFINE_ALLOC_EVENT(xfs_alloc_cur_right);
Signature · 1 line
2.47.2
author maintainer
#10 lore raw

PATCH v2 10/13 xfs: remove unused event xfs_pagecache_inval

In reply to Steven Rostedt

From: Steven Rostedt <[email protected]>

When the function xfs_flushinval_pages() was removed, it removed the only caller to the trace event xfs_pagecache_inval. As trace events can take up to 5K of memory in text and meta data each regardless if they are used or not, they should not be created when unused. Remove the unused event.

Fixes fb59581404ab ("xfs: remove xfs_flushinval_pages")
---
 fs/xfs/xfs_trace.h | 25 -------------------------
 1 file changed, 25 deletions(-)
fs/xfs/xfs_trace.h +0 -25
index e629ee44a9a1..098ef23598fe 100644
@@ -1893,31 +1893,6 @@ DEFINE_EVENT(xfs_itrunc_class, name, \
 DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_start);
 DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_end);
 
-TRACE_EVENT(xfs_pagecache_inval,
-	TP_PROTO(struct xfs_inode *ip, xfs_off_t start, xfs_off_t finish),
-	TP_ARGS(ip, start, finish),
-	TP_STRUCT__entry(
-		__field(dev_t, dev)
-		__field(xfs_ino_t, ino)
-		__field(xfs_fsize_t, size)
-		__field(xfs_off_t, start)
-		__field(xfs_off_t, finish)
-	),
-	TP_fast_assign(
-		__entry->dev = VFS_I(ip)->i_sb->s_dev;
-		__entry->ino = ip->i_ino;
-		__entry->size = ip->i_disk_size;
-		__entry->start = start;
-		__entry->finish = finish;
-	),
-	TP_printk("dev %d:%d ino 0x%llx disize 0x%llx start 0x%llx finish 0x%llx",
-		  MAJOR(__entry->dev), MINOR(__entry->dev),
-		  __entry->ino,
-		  __entry->size,
-		  __entry->start,
-		  __entry->finish)
-);
-
 TRACE_EVENT(xfs_bunmap,
 	TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t fileoff, xfs_filblks_t len,
 		 int flags, unsigned long caller_ip),
Signature · 1 line
2.47.2
author maintainer
#11 lore raw

PATCH v2 11/13 xfs: remove usused xfs_end_io_direct events

In reply to Steven Rostedt

From: Steven Rostedt <[email protected]>

When the use of iomap_dio_rw was added, the calls to the trace events xfs_end_io_direct_unwritten and xfs_end_io_direct_append were removed but those trace events were not. As trace events can take up to 5K in memory for text and meta data regardless if they are used or not, they should not be created when not used. Remove the unused events.

Fixes acdda3aae146 ("xfs: use iomap_dio_rw")
---
 fs/xfs/xfs_trace.h | 2 --
 1 file changed, 2 deletions(-)
fs/xfs/xfs_trace.h +0 -2
index 098ef23598fe..7977af7c6873 100644
@@ -1859,8 +1859,6 @@ DEFINE_SIMPLE_IO_EVENT(xfs_unwritten_convert);
 DEFINE_SIMPLE_IO_EVENT(xfs_setfilesize);
 DEFINE_SIMPLE_IO_EVENT(xfs_zero_eof);
 DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write);
-DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_unwritten);
-DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_append);
 DEFINE_SIMPLE_IO_EVENT(xfs_file_splice_read);
 DEFINE_SIMPLE_IO_EVENT(xfs_zoned_map_blocks);
 
Signature · 1 line
2.47.2
author maintainer
#12 lore raw

PATCH v2 12/13 xfs: only create event xfs_file_compat_ioctl when CONFIG_COMPAT is configure

In reply to Steven Rostedt

From: Steven Rostedt <[email protected]>

The trace event xfs_file_compat_ioctl is only used when CONFIG_COMPAT is configured in the build. As trace events can take up to 5K in memory for text and meta data regardless if they are used, they should not be created when unused. Add #ifdef CONFIG_COMPAT around the event so that it is only created when that is configured.

Fixes cca28fb83d9e6 ("xfs: split xfs_itrace_entry")
---
 fs/xfs/xfs_trace.h | 2 ++
 1 file changed, 2 insertions(+)
fs/xfs/xfs_trace.h +2 -0
index 7977af7c6873..448dea97a052 100644
@@ -1083,7 +1083,9 @@ DEFINE_INODE_EVENT(xfs_get_acl);
 #endif
 DEFINE_INODE_EVENT(xfs_vm_bmap);
 DEFINE_INODE_EVENT(xfs_file_ioctl);
+#ifdef CONFIG_COMPAT
 DEFINE_INODE_EVENT(xfs_file_compat_ioctl);
+#endif
 DEFINE_INODE_EVENT(xfs_ioctl_setattr);
 DEFINE_INODE_EVENT(xfs_dir_fsync);
 DEFINE_INODE_EVENT(xfs_file_fsync);
Signature · 1 line
2.47.2
author maintainer
#13 lore raw

PATCH v2 13/13 xfs: change xfs_xattr_class from a TRACE_EVENT() to DECLARE_EVENT_CLASS()

In reply to Steven Rostedt

From: Steven Rostedt <[email protected]>

xfs_xattr_class was accidentally created as a TRACE_EVENT() instead of a class with DECLARE_EVENT_CLASS().

Note, TRACE_EVENT() is just defined as:

 #define TRACE_EVENT(name, proto, args, tstruct, assign, print) \
	DECLARE_EVENT_CLASS(name,			       \
			     PARAMS(proto),		       \
			     PARAMS(args),		       \
			     PARAMS(tstruct),		       \
			     PARAMS(assign),		       \
			     PARAMS(print));		       \
	DEFINE_EVENT(name, name, PARAMS(proto), PARAMS(args));

The difference between TRACE_EVENT() and DECLARE_EVENT_CLASS() is that TRACE_EVENT() also creates an event with the class name.

Switch xfs_xattr_class over to being a class and not an event as it is not called directly, and that event with the class name takes up unnecessary memory.

Fixes e47dcf113ae3 ("xfs: repair extended attributes")
---
 fs/xfs/scrub/trace.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/scrub/trace.h +1 -1
index d7c4ced47c15..1e6e9c10cea2 100644
@@ -2996,7 +2996,7 @@ DEFINE_EVENT(xrep_pptr_salvage_class, name, \
 DEFINE_XREP_PPTR_SALVAGE_EVENT(xrep_xattr_salvage_pptr);
 DEFINE_XREP_PPTR_SALVAGE_EVENT(xrep_xattr_insert_pptr);
 
-TRACE_EVENT(xrep_xattr_class,
+DECLARE_EVENT_CLASS(xrep_xattr_class,
 	TP_PROTO(struct xfs_inode *ip, struct xfs_inode *arg_ip),
 	TP_ARGS(ip, arg_ip),
 	TP_STRUCT__entry(
Signature · 1 line
2.47.2
author maintainer
#14 lore raw
In reply to Steven Rostedt

Bah, I hate the multiple clipboards of the Linux desktop. I had cut and pasted the above subject line in one clipboard and then cut the subject I wanted in another, and unfortunately pasted the former :-p

This is what the subject was supposed to be:

"xfs: remove unused trace events"

Quoted 18 lines · On Mon, 16 Jun 2025 13:51:46 -0400 Steven Rostedt <[email protected]> wrote:

Trace events take up to 5K in memory for text and meta data. I have code that will trigger a warning when it detects unused tracepoints[1]. The XFS file system contains many events that are not called. Most of them used to be called but due to code refactoring the calls were removed but the trace events stayed behind.

Some events were added but never used. If they were recent, I just reported them, but if they were older, this series simply removes them.

One is called only when CONFIG_COMPACT is defined, so an #ifdef was placed around it.

Finally, one event is supposed to be a trace event class, but was created with the TRACE_EVENT() macro and not the DECLARE_EVENT_CLASS() macro. This works because a TRACE_EVENT() is simply a DECLARE_EVENT_CLASS() and DEFINE_EVENT() where the class and event have the same name. But as this was a mistake, the event created should not exist.

Quoted 3 lines

[1] https://patchwork.kernel.org/project/linux-trace-kernel/cover/[email protected]/

Changes since v1: https://lore.kernel.org/linux-trace-kernel/[email protected]/

And this should have been to the lore link and not patchwork:

https://lore.kernel.org/linux-trace-kernel/[email protected]/

-- Steve

author maintainer
#15 lore raw
In reply to Steven Rostedt

Should this go through the XFS tree, or should I take it?

-- Steve

Quoted 52 lines · On Mon, 16 Jun 2025 13:51:46 -0400 Steven Rostedt <[email protected]> wrote:

Trace events take up to 5K in memory for text and meta data. I have code that will trigger a warning when it detects unused tracepoints[1]. The XFS file system contains many events that are not called. Most of them used to be called but due to code refactoring the calls were removed but the trace events stayed behind.

Some events were added but never used. If they were recent, I just reported them, but if they were older, this series simply removes them.

One is called only when CONFIG_COMPACT is defined, so an #ifdef was placed around it.

Finally, one event is supposed to be a trace event class, but was created with the TRACE_EVENT() macro and not the DECLARE_EVENT_CLASS() macro. This works because a TRACE_EVENT() is simply a DECLARE_EVENT_CLASS() and DEFINE_EVENT() where the class and event have the same name. But as this was a mistake, the event created should not exist.

[1] https://patchwork.kernel.org/project/linux-trace-kernel/cover/[email protected]/

Changes since v1: https://lore.kernel.org/linux-trace-kernel/[email protected]/

- Removed the first patch that mistakenly removed xfs_reflink_cow_found

- Change subjects to start with lowercase

- Removed xfs_attr events that are used in an #if 0 section instead of adding #if 0 around them

- I added: Reviewed-by: Christoph Hellwig <[email protected]> to all patches but the one with the modified #if 0 as Christoph said he looked at them all.

Steven Rostedt (13):
xfs: remove unused trace event xfs_attr_remove_iter_return
xfs: remove unused event xlog_iclog_want_sync
xfs: remove unused event xfs_ioctl_clone
xfs: remove unused xfs_reflink_compare_extents events
xfs: remove unused trace event xfs_attr_rmtval_set
xfs: remove unused xfs_attr events
xfs: remove unused event xfs_attr_node_removename
xfs: remove unused event xfs_alloc_near_error
xfs: remove unused event xfs_alloc_near_nominleft
xfs: remove unused event xfs_pagecache_inval
xfs: remove usused xfs_end_io_direct events
xfs: only create event xfs_file_compat_ioctl when CONFIG_COMPAT is configure
xfs: change xfs_xattr_class from a TRACE_EVENT() to DECLARE_EVENT_CLASS()

----

 fs/xfs/scrub/trace.h |  2 +-
 fs/xfs/xfs_trace.h   | 68 ++--------------------------------------------------
 2 files changed, 3 insertions(+), 67 deletions(-)
maintainer
#16 lore raw
Quoted 2 lines · Steven Rostedt

Should this go through the XFS tree, or should I take it?

This is in XFS tree for a while now:

https://web.git.kernel.org/pub/scm/fs/xfs/xfs-linux.git/?h=xfs-6.17-merge

https://lore.kernel.org/linux-xfs/[email protected]/T/#mae0757697a557087c723de553b7ccd2bb7a39c9c

Carlos

Quoted 60 lines

-- Steve

Quoted 52 lines · On Mon, 16 Jun 2025 13:51:46 -0400 Steven Rostedt <[email protected]> wrote:

Trace events take up to 5K in memory for text and meta data. I have code that will trigger a warning when it detects unused tracepoints[1]. The XFS file system contains many events that are not called. Most of them used to be called but due to code refactoring the calls were removed but the trace events stayed behind.

Some events were added but never used. If they were recent, I just reported them, but if they were older, this series simply removes them.

One is called only when CONFIG_COMPACT is defined, so an #ifdef was placed around it.

Finally, one event is supposed to be a trace event class, but was created with the TRACE_EVENT() macro and not the DECLARE_EVENT_CLASS() macro. This works because a TRACE_EVENT() is simply a DECLARE_EVENT_CLASS() and DEFINE_EVENT() where the class and event have the same name. But as this was a mistake, the event created should not exist.

[1] https://patchwork.kernel.org/project/linux-trace-kernel/cover/[email protected]/

Changes since v1: https://lore.kernel.org/linux-trace-kernel/[email protected]/

- Removed the first patch that mistakenly removed xfs_reflink_cow_found

- Change subjects to start with lowercase

- Removed xfs_attr events that are used in an #if 0 section instead of adding #if 0 around them

- I added: Reviewed-by: Christoph Hellwig <[email protected]> to all patches but the one with the modified #if 0 as Christoph said he looked at them all.

Steven Rostedt (13):
xfs: remove unused trace event xfs_attr_remove_iter_return
xfs: remove unused event xlog_iclog_want_sync
xfs: remove unused event xfs_ioctl_clone
xfs: remove unused xfs_reflink_compare_extents events
xfs: remove unused trace event xfs_attr_rmtval_set
xfs: remove unused xfs_attr events
xfs: remove unused event xfs_attr_node_removename
xfs: remove unused event xfs_alloc_near_error
xfs: remove unused event xfs_alloc_near_nominleft
xfs: remove unused event xfs_pagecache_inval
xfs: remove usused xfs_end_io_direct events
xfs: only create event xfs_file_compat_ioctl when CONFIG_COMPAT is configure
xfs: change xfs_xattr_class from a TRACE_EVENT() to DECLARE_EVENT_CLASS()

----

 fs/xfs/scrub/trace.h |  2 +-
 fs/xfs/xfs_trace.h   | 68 ++--------------------------------------------------
 2 files changed, 3 insertions(+), 67 deletions(-)
maintainer
#17 lore raw
In reply to Steven Rostedt
Quoted 2 lines · Steven Rostedt

Should this go through the XFS tree, or should I take it?

FWIW, I just realized that for whatever reason b4 chocked to send a 'Thank You' msg to you when I applied your patches. It sent to every submitter but you. That's why you didn't receive a 'personal' thanks :)

Quoted 60 lines

-- Steve

Quoted 52 lines · On Mon, 16 Jun 2025 13:51:46 -0400 Steven Rostedt <[email protected]> wrote:

Trace events take up to 5K in memory for text and meta data. I have code that will trigger a warning when it detects unused tracepoints[1]. The XFS file system contains many events that are not called. Most of them used to be called but due to code refactoring the calls were removed but the trace events stayed behind.

Some events were added but never used. If they were recent, I just reported them, but if they were older, this series simply removes them.

One is called only when CONFIG_COMPACT is defined, so an #ifdef was placed around it.

Finally, one event is supposed to be a trace event class, but was created with the TRACE_EVENT() macro and not the DECLARE_EVENT_CLASS() macro. This works because a TRACE_EVENT() is simply a DECLARE_EVENT_CLASS() and DEFINE_EVENT() where the class and event have the same name. But as this was a mistake, the event created should not exist.

[1] https://patchwork.kernel.org/project/linux-trace-kernel/cover/[email protected]/

Changes since v1: https://lore.kernel.org/linux-trace-kernel/[email protected]/

- Removed the first patch that mistakenly removed xfs_reflink_cow_found

- Change subjects to start with lowercase

- Removed xfs_attr events that are used in an #if 0 section instead of adding #if 0 around them

- I added: Reviewed-by: Christoph Hellwig <[email protected]> to all patches but the one with the modified #if 0 as Christoph said he looked at them all.

Steven Rostedt (13):
xfs: remove unused trace event xfs_attr_remove_iter_return
xfs: remove unused event xlog_iclog_want_sync
xfs: remove unused event xfs_ioctl_clone
xfs: remove unused xfs_reflink_compare_extents events
xfs: remove unused trace event xfs_attr_rmtval_set
xfs: remove unused xfs_attr events
xfs: remove unused event xfs_attr_node_removename
xfs: remove unused event xfs_alloc_near_error
xfs: remove unused event xfs_alloc_near_nominleft
xfs: remove unused event xfs_pagecache_inval
xfs: remove usused xfs_end_io_direct events
xfs: only create event xfs_file_compat_ioctl when CONFIG_COMPAT is configure
xfs: change xfs_xattr_class from a TRACE_EVENT() to DECLARE_EVENT_CLASS()

----

 fs/xfs/scrub/trace.h |  2 +-
 fs/xfs/xfs_trace.h   | 68 ++--------------------------------------------------
 2 files changed, 3 insertions(+), 67 deletions(-)
author maintainer
#18 lore raw
Quoted 7 lines · On Wed, 9 Jul 2025 09:54:37 +0200 Carlos Maiolino <[email protected]> wrote:
Quoted 2 lines · Steven Rostedt

Should this go through the XFS tree, or should I take it?

FWIW, I just realized that for whatever reason b4 chocked to send a 'Thank You' msg to you when I applied your patches. It sent to every submitter but you. That's why you didn't receive a 'personal' thanks :)

Ah, OK. Well, thanks, I think ;-)

-- Steve