* [PATCH 00/14] xfs: Remove unused trace events
@ 2025-06-12 21:24 Steven Rostedt
2025-06-12 21:24 ` [PATCH 01/14] xfs: tracing; Remove unused event xfs_reflink_cow_found Steven Rostedt
` (15 more replies)
0 siblings, 16 replies; 28+ messages in thread
From: Steven Rostedt @ 2025-06-12 21:24 UTC (permalink / raw)
To: linux-kernel, linux-trace-kernel, linux-xfs
Cc: Masami Hiramatsu, Mathieu Desnoyers, Andrew Morton,
Carlos Maiolino, Christoph Hellwig, Darrick J. Wong
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. 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.
A couple are only called in #if 0 code (left as a reminder to fix it), so
those events are wrapped by a #if 0 as well (with a comment).
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.
Each patch is a stand alone patch. If you ack them, I can take them in my
tree, or if you want, you can take them. I may be adding the warning code to
linux-next near the end of the cycle, so it would be good to have this cleaned
up before hand. As this is removing dead code, it may be even OK to send them
to Linus as a fix.
Steven Rostedt (14):
xfs: tracing; Remove unused event xfs_reflink_cow_found
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: ifdef out 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 | 72 ++++++----------------------------------------------
2 files changed, 9 insertions(+), 65 deletions(-)
^ permalink raw reply [flat|nested] 28+ messages in thread
* [PATCH 01/14] xfs: tracing; Remove unused event xfs_reflink_cow_found
2025-06-12 21:24 [PATCH 00/14] xfs: Remove unused trace events Steven Rostedt
@ 2025-06-12 21:24 ` Steven Rostedt
2025-06-13 15:38 ` Steven Rostedt
2025-06-13 23:52 ` kernel test robot
2025-06-12 21:24 ` [PATCH 02/14] xfs: Remove unused trace event xfs_attr_remove_iter_return Steven Rostedt
` (14 subsequent siblings)
15 siblings, 2 replies; 28+ messages in thread
From: Steven Rostedt @ 2025-06-12 21:24 UTC (permalink / raw)
To: linux-kernel, linux-trace-kernel, linux-xfs
Cc: Masami Hiramatsu, Mathieu Desnoyers, Andrew Morton,
Carlos Maiolino, Christoph Hellwig, Darrick J. Wong
From: Steven Rostedt <rostedt@goodmis.org>
Each trace event can take up to around 5K of text and meta data regardless
if they are used or not. With the restructuring of the XFS COW handling,
the tracepoint trace_xfs_reflink_cow_found() was removed but the trace
event was still being created. Remove the creation of that trace event.
Fixes: db46e604adf8 ("xfs: merge COW handling into xfs_file_iomap_begin_delay")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
fs/xfs/xfs_trace.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h
index 01d284a1c759..ae0ed0dd0a01 100644
--- a/fs/xfs/xfs_trace.h
+++ b/fs/xfs/xfs_trace.h
@@ -4242,7 +4242,6 @@ DEFINE_INODE_ERROR_EVENT(xfs_reflink_unshare_error);
/* copy on write */
DEFINE_INODE_IREC_EVENT(xfs_reflink_trim_around_shared);
-DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_found);
DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_enospc);
DEFINE_INODE_IREC_EVENT(xfs_reflink_convert_cow);
--
2.47.2
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 02/14] xfs: Remove unused trace event xfs_attr_remove_iter_return
2025-06-12 21:24 [PATCH 00/14] xfs: Remove unused trace events Steven Rostedt
2025-06-12 21:24 ` [PATCH 01/14] xfs: tracing; Remove unused event xfs_reflink_cow_found Steven Rostedt
@ 2025-06-12 21:24 ` Steven Rostedt
2025-06-16 5:26 ` Christoph Hellwig
2025-06-12 21:24 ` [PATCH 03/14] xfs: Remove unused event xlog_iclog_want_sync Steven Rostedt
` (13 subsequent siblings)
15 siblings, 1 reply; 28+ messages in thread
From: Steven Rostedt @ 2025-06-12 21:24 UTC (permalink / raw)
To: linux-kernel, linux-trace-kernel, linux-xfs
Cc: Masami Hiramatsu, Mathieu Desnoyers, Andrew Morton,
Carlos Maiolino, Christoph Hellwig, Darrick J. Wong
From: Steven Rostedt <rostedt@goodmis.org>
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")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
fs/xfs/xfs_trace.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h
index ae0ed0dd0a01..67bdcab9ff47 100644
--- a/fs/xfs/xfs_trace.h
+++ b/fs/xfs/xfs_trace.h
@@ -5076,7 +5076,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);
--
2.47.2
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 03/14] xfs: Remove unused event xlog_iclog_want_sync
2025-06-12 21:24 [PATCH 00/14] xfs: Remove unused trace events Steven Rostedt
2025-06-12 21:24 ` [PATCH 01/14] xfs: tracing; Remove unused event xfs_reflink_cow_found Steven Rostedt
2025-06-12 21:24 ` [PATCH 02/14] xfs: Remove unused trace event xfs_attr_remove_iter_return Steven Rostedt
@ 2025-06-12 21:24 ` Steven Rostedt
2025-06-12 21:24 ` [PATCH 04/14] xfs: Remove unused event xfs_ioctl_clone Steven Rostedt
` (12 subsequent siblings)
15 siblings, 0 replies; 28+ messages in thread
From: Steven Rostedt @ 2025-06-12 21:24 UTC (permalink / raw)
To: linux-kernel, linux-trace-kernel, linux-xfs
Cc: Masami Hiramatsu, Mathieu Desnoyers, Andrew Morton,
Carlos Maiolino, Christoph Hellwig, Darrick J. Wong
From: Steven Rostedt <rostedt@goodmis.org>
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")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
fs/xfs/xfs_trace.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h
index 67bdcab9ff47..049bf9e34063 100644
--- a/fs/xfs/xfs_trace.h
+++ b/fs/xfs/xfs_trace.h
@@ -5027,7 +5027,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);
--
2.47.2
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 04/14] xfs: Remove unused event xfs_ioctl_clone
2025-06-12 21:24 [PATCH 00/14] xfs: Remove unused trace events Steven Rostedt
` (2 preceding siblings ...)
2025-06-12 21:24 ` [PATCH 03/14] xfs: Remove unused event xlog_iclog_want_sync Steven Rostedt
@ 2025-06-12 21:24 ` Steven Rostedt
2025-06-12 21:24 ` [PATCH 05/14] xfs: Remove unused xfs_reflink_compare_extents events Steven Rostedt
` (11 subsequent siblings)
15 siblings, 0 replies; 28+ messages in thread
From: Steven Rostedt @ 2025-06-12 21:24 UTC (permalink / raw)
To: linux-kernel, linux-trace-kernel, linux-xfs
Cc: Masami Hiramatsu, Mathieu Desnoyers, Andrew Morton,
Carlos Maiolino, Christoph Hellwig, Darrick J. Wong
From: Steven Rostedt <rostedt@goodmis.org>
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")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
fs/xfs/xfs_trace.h | 26 --------------------------
1 file changed, 26 deletions(-)
diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h
index 049bf9e34063..ad686fe0a577 100644
--- a/fs/xfs/xfs_trace.h
+++ b/fs/xfs/xfs_trace.h
@@ -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);
--
2.47.2
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 05/14] xfs: Remove unused xfs_reflink_compare_extents events
2025-06-12 21:24 [PATCH 00/14] xfs: Remove unused trace events Steven Rostedt
` (3 preceding siblings ...)
2025-06-12 21:24 ` [PATCH 04/14] xfs: Remove unused event xfs_ioctl_clone Steven Rostedt
@ 2025-06-12 21:24 ` Steven Rostedt
2025-06-12 21:24 ` [PATCH 06/14] xfs: Remove unused trace event xfs_attr_rmtval_set Steven Rostedt
` (10 subsequent siblings)
15 siblings, 0 replies; 28+ messages in thread
From: Steven Rostedt @ 2025-06-12 21:24 UTC (permalink / raw)
To: linux-kernel, linux-trace-kernel, linux-xfs
Cc: Masami Hiramatsu, Mathieu Desnoyers, Andrew Morton,
Carlos Maiolino, Christoph Hellwig, Darrick J. Wong
From: Steven Rostedt <rostedt@goodmis.org>
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")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
fs/xfs/xfs_trace.h | 4 ----
1 file changed, 4 deletions(-)
diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h
index ad686fe0a577..fe22f791de6e 100644
--- a/fs/xfs/xfs_trace.h
+++ b/fs/xfs/xfs_trace.h
@@ -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);
--
2.47.2
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 06/14] xfs: Remove unused trace event xfs_attr_rmtval_set
2025-06-12 21:24 [PATCH 00/14] xfs: Remove unused trace events Steven Rostedt
` (4 preceding siblings ...)
2025-06-12 21:24 ` [PATCH 05/14] xfs: Remove unused xfs_reflink_compare_extents events Steven Rostedt
@ 2025-06-12 21:24 ` Steven Rostedt
2025-06-12 21:24 ` [PATCH 07/14] xfs: ifdef out unused xfs_attr events Steven Rostedt
` (9 subsequent siblings)
15 siblings, 0 replies; 28+ messages in thread
From: Steven Rostedt @ 2025-06-12 21:24 UTC (permalink / raw)
To: linux-kernel, linux-trace-kernel, linux-xfs
Cc: Masami Hiramatsu, Mathieu Desnoyers, Andrew Morton,
Carlos Maiolino, Christoph Hellwig, Darrick J. Wong
From: Steven Rostedt <rostedt@goodmis.org>
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")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
fs/xfs/xfs_trace.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h
index fe22f791de6e..cdc639198bb9 100644
--- a/fs/xfs/xfs_trace.h
+++ b/fs/xfs/xfs_trace.h
@@ -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, \
--
2.47.2
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 07/14] xfs: ifdef out unused xfs_attr events
2025-06-12 21:24 [PATCH 00/14] xfs: Remove unused trace events Steven Rostedt
` (5 preceding siblings ...)
2025-06-12 21:24 ` [PATCH 06/14] xfs: Remove unused trace event xfs_attr_rmtval_set Steven Rostedt
@ 2025-06-12 21:24 ` Steven Rostedt
2025-06-16 5:28 ` Christoph Hellwig
2025-06-12 21:24 ` [PATCH 08/14] xfs: Remove unused event xfs_attr_node_removename Steven Rostedt
` (8 subsequent siblings)
15 siblings, 1 reply; 28+ messages in thread
From: Steven Rostedt @ 2025-06-12 21:24 UTC (permalink / raw)
To: linux-kernel, linux-trace-kernel, linux-xfs
Cc: Masami Hiramatsu, Mathieu Desnoyers, Andrew Morton,
Carlos Maiolino, Christoph Hellwig, Darrick J. Wong
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
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 08/14] xfs: Remove unused event xfs_attr_node_removename
2025-06-12 21:24 [PATCH 00/14] xfs: Remove unused trace events Steven Rostedt
` (6 preceding siblings ...)
2025-06-12 21:24 ` [PATCH 07/14] xfs: ifdef out unused xfs_attr events Steven Rostedt
@ 2025-06-12 21:24 ` Steven Rostedt
2025-06-12 21:24 ` [PATCH 09/14] xfs: Remove unused event xfs_alloc_near_error Steven Rostedt
` (7 subsequent siblings)
15 siblings, 0 replies; 28+ messages in thread
From: Steven Rostedt @ 2025-06-12 21:24 UTC (permalink / raw)
To: linux-kernel, linux-trace-kernel, linux-xfs
Cc: Masami Hiramatsu, Mathieu Desnoyers, Andrew Morton,
Carlos Maiolino, Christoph Hellwig, Darrick J. Wong
From: Steven Rostedt <rostedt@goodmis.org>
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")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
fs/xfs/xfs_trace.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h
index bd4e5a727b73..3c15282b2a8a 100644
--- a/fs/xfs/xfs_trace.h
+++ b/fs/xfs/xfs_trace.h
@@ -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);
/*
* When the corresponding code in xfs_attr.c is re-enabled
--
2.47.2
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 09/14] xfs: Remove unused event xfs_alloc_near_error
2025-06-12 21:24 [PATCH 00/14] xfs: Remove unused trace events Steven Rostedt
` (7 preceding siblings ...)
2025-06-12 21:24 ` [PATCH 08/14] xfs: Remove unused event xfs_attr_node_removename Steven Rostedt
@ 2025-06-12 21:24 ` Steven Rostedt
2025-06-12 21:24 ` [PATCH 10/14] xfs: Remove unused event xfs_alloc_near_nominleft Steven Rostedt
` (6 subsequent siblings)
15 siblings, 0 replies; 28+ messages in thread
From: Steven Rostedt @ 2025-06-12 21:24 UTC (permalink / raw)
To: linux-kernel, linux-trace-kernel, linux-xfs
Cc: Masami Hiramatsu, Mathieu Desnoyers, Andrew Morton,
Carlos Maiolino, Christoph Hellwig, Darrick J. Wong
From: Steven Rostedt <rostedt@goodmis.org>
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")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
fs/xfs/xfs_trace.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h
index 3c15282b2a8a..6ec483341bc4 100644
--- a/fs/xfs/xfs_trace.h
+++ b/fs/xfs/xfs_trace.h
@@ -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);
--
2.47.2
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 10/14] xfs: Remove unused event xfs_alloc_near_nominleft
2025-06-12 21:24 [PATCH 00/14] xfs: Remove unused trace events Steven Rostedt
` (8 preceding siblings ...)
2025-06-12 21:24 ` [PATCH 09/14] xfs: Remove unused event xfs_alloc_near_error Steven Rostedt
@ 2025-06-12 21:24 ` Steven Rostedt
2025-06-12 21:24 ` [PATCH 11/14] xfs: Remove unused event xfs_pagecache_inval Steven Rostedt
` (5 subsequent siblings)
15 siblings, 0 replies; 28+ messages in thread
From: Steven Rostedt @ 2025-06-12 21:24 UTC (permalink / raw)
To: linux-kernel, linux-trace-kernel, linux-xfs
Cc: Masami Hiramatsu, Mathieu Desnoyers, Andrew Morton,
Carlos Maiolino, Christoph Hellwig, Darrick J. Wong
From: Steven Rostedt <rostedt@goodmis.org>
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")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
fs/xfs/xfs_trace.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h
index 6ec483341bc4..277402801394 100644
--- a/fs/xfs/xfs_trace.h
+++ b/fs/xfs/xfs_trace.h
@@ -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);
--
2.47.2
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 11/14] xfs: Remove unused event xfs_pagecache_inval
2025-06-12 21:24 [PATCH 00/14] xfs: Remove unused trace events Steven Rostedt
` (9 preceding siblings ...)
2025-06-12 21:24 ` [PATCH 10/14] xfs: Remove unused event xfs_alloc_near_nominleft Steven Rostedt
@ 2025-06-12 21:24 ` Steven Rostedt
2025-06-12 21:24 ` [PATCH 12/14] xfs: Remove usused xfs_end_io_direct events Steven Rostedt
` (4 subsequent siblings)
15 siblings, 0 replies; 28+ messages in thread
From: Steven Rostedt @ 2025-06-12 21:24 UTC (permalink / raw)
To: linux-kernel, linux-trace-kernel, linux-xfs
Cc: Masami Hiramatsu, Mathieu Desnoyers, Andrew Morton,
Carlos Maiolino, Christoph Hellwig, Darrick J. Wong
From: Steven Rostedt <rostedt@goodmis.org>
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")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
fs/xfs/xfs_trace.h | 25 -------------------------
1 file changed, 25 deletions(-)
diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h
index 277402801394..ee21ce3651a5 100644
--- a/fs/xfs/xfs_trace.h
+++ b/fs/xfs/xfs_trace.h
@@ -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),
--
2.47.2
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 12/14] xfs: Remove usused xfs_end_io_direct events
2025-06-12 21:24 [PATCH 00/14] xfs: Remove unused trace events Steven Rostedt
` (10 preceding siblings ...)
2025-06-12 21:24 ` [PATCH 11/14] xfs: Remove unused event xfs_pagecache_inval Steven Rostedt
@ 2025-06-12 21:24 ` Steven Rostedt
2025-06-12 21:24 ` [PATCH 13/14] xfs: Only create event xfs_file_compat_ioctl when CONFIG_COMPAT is configure Steven Rostedt
` (3 subsequent siblings)
15 siblings, 0 replies; 28+ messages in thread
From: Steven Rostedt @ 2025-06-12 21:24 UTC (permalink / raw)
To: linux-kernel, linux-trace-kernel, linux-xfs
Cc: Masami Hiramatsu, Mathieu Desnoyers, Andrew Morton,
Carlos Maiolino, Christoph Hellwig, Darrick J. Wong
From: Steven Rostedt <rostedt@goodmis.org>
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")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
fs/xfs/xfs_trace.h | 2 --
1 file changed, 2 deletions(-)
diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h
index ee21ce3651a5..83d4ef8386a1 100644
--- a/fs/xfs/xfs_trace.h
+++ b/fs/xfs/xfs_trace.h
@@ -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);
--
2.47.2
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 13/14] xfs: Only create event xfs_file_compat_ioctl when CONFIG_COMPAT is configure
2025-06-12 21:24 [PATCH 00/14] xfs: Remove unused trace events Steven Rostedt
` (11 preceding siblings ...)
2025-06-12 21:24 ` [PATCH 12/14] xfs: Remove usused xfs_end_io_direct events Steven Rostedt
@ 2025-06-12 21:24 ` Steven Rostedt
2025-06-12 21:24 ` [PATCH 14/14] xfs: Change xfs_xattr_class from a TRACE_EVENT() to DECLARE_EVENT_CLASS() Steven Rostedt
` (2 subsequent siblings)
15 siblings, 0 replies; 28+ messages in thread
From: Steven Rostedt @ 2025-06-12 21:24 UTC (permalink / raw)
To: linux-kernel, linux-trace-kernel, linux-xfs
Cc: Masami Hiramatsu, Mathieu Desnoyers, Andrew Morton,
Carlos Maiolino, Christoph Hellwig, Darrick J. Wong
From: Steven Rostedt <rostedt@goodmis.org>
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")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
fs/xfs/xfs_trace.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h
index 83d4ef8386a1..76928583549a 100644
--- a/fs/xfs/xfs_trace.h
+++ b/fs/xfs/xfs_trace.h
@@ -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);
--
2.47.2
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 14/14] xfs: Change xfs_xattr_class from a TRACE_EVENT() to DECLARE_EVENT_CLASS()
2025-06-12 21:24 [PATCH 00/14] xfs: Remove unused trace events Steven Rostedt
` (12 preceding siblings ...)
2025-06-12 21:24 ` [PATCH 13/14] xfs: Only create event xfs_file_compat_ioctl when CONFIG_COMPAT is configure Steven Rostedt
@ 2025-06-12 21:24 ` Steven Rostedt
2025-06-13 15:08 ` [PATCH 00/14] xfs: Remove unused trace events Darrick J. Wong
2025-06-16 5:30 ` Christoph Hellwig
15 siblings, 0 replies; 28+ messages in thread
From: Steven Rostedt @ 2025-06-12 21:24 UTC (permalink / raw)
To: linux-kernel, linux-trace-kernel, linux-xfs
Cc: Masami Hiramatsu, Mathieu Desnoyers, Andrew Morton,
Carlos Maiolino, Christoph Hellwig, Darrick J. Wong
From: Steven Rostedt <rostedt@goodmis.org>
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")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
fs/xfs/scrub/trace.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/xfs/scrub/trace.h b/fs/xfs/scrub/trace.h
index d7c4ced47c15..1e6e9c10cea2 100644
--- a/fs/xfs/scrub/trace.h
+++ b/fs/xfs/scrub/trace.h
@@ -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(
--
2.47.2
^ permalink raw reply related [flat|nested] 28+ messages in thread
* Re: [PATCH 00/14] xfs: Remove unused trace events
2025-06-12 21:24 [PATCH 00/14] xfs: Remove unused trace events Steven Rostedt
` (13 preceding siblings ...)
2025-06-12 21:24 ` [PATCH 14/14] xfs: Change xfs_xattr_class from a TRACE_EVENT() to DECLARE_EVENT_CLASS() Steven Rostedt
@ 2025-06-13 15:08 ` Darrick J. Wong
2025-06-13 15:31 ` Steven Rostedt
2025-07-23 22:35 ` Steven Rostedt
2025-06-16 5:30 ` Christoph Hellwig
15 siblings, 2 replies; 28+ messages in thread
From: Darrick J. Wong @ 2025-06-13 15:08 UTC (permalink / raw)
To: Steven Rostedt
Cc: linux-kernel, linux-trace-kernel, linux-xfs, Masami Hiramatsu,
Mathieu Desnoyers, Andrew Morton, Carlos Maiolino,
Christoph Hellwig
On Thu, Jun 12, 2025 at 05:24:05PM -0400, Steven Rostedt wrote:
>
> Trace events take up to 5K in memory for text and meta data. I have code that
Under what circumstances do they eat up that much memory? And is that
per-class? Or per-tracepoint?
> will trigger a warning when it detects unused tracepoints. 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.
TBH it'd be really nice if there was /something/ in the build path that
would complain about disused tracepoints. I often put in tracepoints
while developing a feature, then the code gets massively rewritten
during review, and none of us remember to rip out the orphaned traces...
> One is called only when CONFIG_COMPACT is defined, so an #ifdef was placed
> around it.
>
> A couple are only called in #if 0 code (left as a reminder to fix it), so
> those events are wrapped by a #if 0 as well (with a comment).
>
> 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.
>
> Each patch is a stand alone patch. If you ack them, I can take them in my
> tree, or if you want, you can take them. I may be adding the warning code to
> linux-next near the end of the cycle, so it would be good to have this cleaned
> up before hand. As this is removing dead code, it may be even OK to send them
> to Linus as a fix.
...oh, you /do/ have a program and it's coming down the pipeline.
Excellent <tents fingers>. :)
--D
>
> Steven Rostedt (14):
> xfs: tracing; Remove unused event xfs_reflink_cow_found
> 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: ifdef out 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 | 72 ++++++----------------------------------------------
> 2 files changed, 9 insertions(+), 65 deletions(-)
>
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH 00/14] xfs: Remove unused trace events
2025-06-13 15:08 ` [PATCH 00/14] xfs: Remove unused trace events Darrick J. Wong
@ 2025-06-13 15:31 ` Steven Rostedt
2025-06-16 5:31 ` Christoph Hellwig
2025-07-23 22:35 ` Steven Rostedt
1 sibling, 1 reply; 28+ messages in thread
From: Steven Rostedt @ 2025-06-13 15:31 UTC (permalink / raw)
To: Darrick J. Wong
Cc: linux-kernel, linux-trace-kernel, linux-xfs, Masami Hiramatsu,
Mathieu Desnoyers, Andrew Morton, Carlos Maiolino,
Christoph Hellwig
On Fri, 13 Jun 2025 08:08:55 -0700
"Darrick J. Wong" <djwong@kernel.org> wrote:
> On Thu, Jun 12, 2025 at 05:24:05PM -0400, Steven Rostedt wrote:
> >
> > Trace events take up to 5K in memory for text and meta data. I have code that
>
> Under what circumstances do they eat up that much memory? And is that
> per-class? Or per-tracepoint?
I just did an analysis of this:
https://lore.kernel.org/lkml/20250613104240.509ff13c@batman.local.home/T/#md81abade0df19ba9062fd51ced4458161f885ac3
A TRACE_EVENT() is about 5K, and each DEFINE_EVENT() is about 1K.
>
> > will trigger a warning when it detects unused tracepoints. 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.
>
> TBH it'd be really nice if there was /something/ in the build path that
> would complain about disused tracepoints. I often put in tracepoints
> while developing a feature, then the code gets massively rewritten
> during review, and none of us remember to rip out the orphaned traces...
>
That's exactly what I'm doing. In the thread I did the analysis, it has
code that triggers a warning for unused events. I'm currently cleaning
them up (and asking others to do it too), so that I can add that code
without triggering all the current unused tracepoints.
Feel free to take those patches and it will warn at build time. Note,
it currently only works for built in code, so you have to build your
module as a built in and not a module.
> > One is called only when CONFIG_COMPACT is defined, so an #ifdef was placed
> > around it.
> >
> > A couple are only called in #if 0 code (left as a reminder to fix it), so
> > those events are wrapped by a #if 0 as well (with a comment).
> >
> > 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.
> >
> > Each patch is a stand alone patch. If you ack them, I can take them in my
> > tree, or if you want, you can take them. I may be adding the warning code to
> > linux-next near the end of the cycle, so it would be good to have this cleaned
> > up before hand. As this is removing dead code, it may be even OK to send them
> > to Linus as a fix.
>
> ...oh, you /do/ have a program and it's coming down the pipeline.
> Excellent <tents fingers>. :)
Ah you did notice ;-)
-- Steve
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH 01/14] xfs: tracing; Remove unused event xfs_reflink_cow_found
2025-06-12 21:24 ` [PATCH 01/14] xfs: tracing; Remove unused event xfs_reflink_cow_found Steven Rostedt
@ 2025-06-13 15:38 ` Steven Rostedt
2025-06-13 23:52 ` kernel test robot
1 sibling, 0 replies; 28+ messages in thread
From: Steven Rostedt @ 2025-06-13 15:38 UTC (permalink / raw)
To: linux-kernel, linux-trace-kernel, linux-xfs
Cc: Masami Hiramatsu, Mathieu Desnoyers, Andrew Morton,
Carlos Maiolino, Christoph Hellwig, Darrick J. Wong
On Thu, 12 Jun 2025 17:24:06 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:
> From: Steven Rostedt <rostedt@goodmis.org>
>
> Each trace event can take up to around 5K of text and meta data regardless
> if they are used or not. With the restructuring of the XFS COW handling,
> the tracepoint trace_xfs_reflink_cow_found() was removed but the trace
> event was still being created. Remove the creation of that trace event.
>
> Fixes: db46e604adf8 ("xfs: merge COW handling into xfs_file_iomap_begin_delay")
> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
> ---
> fs/xfs/xfs_trace.h | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h
> index 01d284a1c759..ae0ed0dd0a01 100644
> --- a/fs/xfs/xfs_trace.h
> +++ b/fs/xfs/xfs_trace.h
> @@ -4242,7 +4242,6 @@ DEFINE_INODE_ERROR_EVENT(xfs_reflink_unshare_error);
>
> /* copy on write */
> DEFINE_INODE_IREC_EVENT(xfs_reflink_trim_around_shared);
> -DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_found);
> DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_enospc);
> DEFINE_INODE_IREC_EVENT(xfs_reflink_convert_cow);
>
Hmm, it looks like this one is still used. I'll drop this patch.
-- Steve
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH 01/14] xfs: tracing; Remove unused event xfs_reflink_cow_found
2025-06-12 21:24 ` [PATCH 01/14] xfs: tracing; Remove unused event xfs_reflink_cow_found Steven Rostedt
2025-06-13 15:38 ` Steven Rostedt
@ 2025-06-13 23:52 ` kernel test robot
1 sibling, 0 replies; 28+ messages in thread
From: kernel test robot @ 2025-06-13 23:52 UTC (permalink / raw)
To: Steven Rostedt, linux-kernel, linux-trace-kernel, linux-xfs
Cc: oe-kbuild-all, Masami Hiramatsu, Mathieu Desnoyers, Andrew Morton,
Linux Memory Management List, Carlos Maiolino, Christoph Hellwig,
Darrick J. Wong
Hi Steven,
kernel test robot noticed the following build errors:
[auto build test ERROR on xfs-linux/for-next]
[also build test ERROR on linus/master v6.16-rc1 next-20250613]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Steven-Rostedt/xfs-tracing-Remove-unused-event-xfs_reflink_cow_found/20250613-052758
base: https://git.kernel.org/pub/scm/fs/xfs/xfs-linux.git for-next
patch link: https://lore.kernel.org/r/20250612212634.746367055%40goodmis.org
patch subject: [PATCH 01/14] xfs: tracing; Remove unused event xfs_reflink_cow_found
config: s390-randconfig-r073-20250614 (https://download.01.org/0day-ci/archive/20250614/202506140710.bDy6wh4J-lkp@intel.com/config)
compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project f819f46284f2a79790038e1f6649172789734ae8)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250614/202506140710.bDy6wh4J-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202506140710.bDy6wh4J-lkp@intel.com/
All errors (new ones prefixed by >>):
>> fs/xfs/xfs_iomap.c:1614:3: error: call to undeclared function 'trace_xfs_reflink_cow_found'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
1614 | trace_xfs_reflink_cow_found(ip, &got);
| ^
fs/xfs/xfs_iomap.c:1614:3: note: did you mean 'trace_xfs_reflink_cow_enospc'?
fs/xfs/xfs_trace.h:4245:1: note: 'trace_xfs_reflink_cow_enospc' declared here
4245 | DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_enospc);
| ^
fs/xfs/xfs_trace.h:4073:39: note: expanded from macro 'DEFINE_INODE_IREC_EVENT'
4073 | #define DEFINE_INODE_IREC_EVENT(name) \
| ^
include/linux/tracepoint.h:594:2: note: expanded from macro '\
DEFINE_EVENT'
594 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
| ^
include/linux/tracepoint.h:467:2: note: expanded from macro 'DECLARE_TRACE'
467 | __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args), \
| ^
include/linux/tracepoint.h:409:2: note: expanded from macro '__DECLARE_TRACE'
409 | __DECLARE_TRACE_COMMON(name, PARAMS(proto), PARAMS(args), PARAMS(data_proto))
| ^
include/linux/tracepoint.h:385:21: note: expanded from macro '__DECLARE_TRACE_COMMON'
385 | static inline void trace_##name(proto) \
| ^
<scratch space>:36:1: note: expanded from here
36 | trace_xfs_reflink_cow_enospc
| ^
fs/xfs/xfs_iomap.c:1792:4: error: call to undeclared function 'trace_xfs_reflink_cow_found'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
1792 | trace_xfs_reflink_cow_found(ip, &cmap);
| ^
2 errors generated.
vim +/trace_xfs_reflink_cow_found +1614 fs/xfs/xfs_iomap.c
7c879c8275c0505 Christoph Hellwig 2024-11-17 1514
058dd70c65ab736 Christoph Hellwig 2025-02-13 1515 static int
058dd70c65ab736 Christoph Hellwig 2025-02-13 1516 xfs_zoned_buffered_write_iomap_begin(
058dd70c65ab736 Christoph Hellwig 2025-02-13 1517 struct inode *inode,
058dd70c65ab736 Christoph Hellwig 2025-02-13 1518 loff_t offset,
058dd70c65ab736 Christoph Hellwig 2025-02-13 1519 loff_t count,
058dd70c65ab736 Christoph Hellwig 2025-02-13 1520 unsigned flags,
058dd70c65ab736 Christoph Hellwig 2025-02-13 1521 struct iomap *iomap,
058dd70c65ab736 Christoph Hellwig 2025-02-13 1522 struct iomap *srcmap)
058dd70c65ab736 Christoph Hellwig 2025-02-13 1523 {
058dd70c65ab736 Christoph Hellwig 2025-02-13 1524 struct iomap_iter *iter =
058dd70c65ab736 Christoph Hellwig 2025-02-13 1525 container_of(iomap, struct iomap_iter, iomap);
058dd70c65ab736 Christoph Hellwig 2025-02-13 1526 struct xfs_zone_alloc_ctx *ac = iter->private;
058dd70c65ab736 Christoph Hellwig 2025-02-13 1527 struct xfs_inode *ip = XFS_I(inode);
058dd70c65ab736 Christoph Hellwig 2025-02-13 1528 struct xfs_mount *mp = ip->i_mount;
058dd70c65ab736 Christoph Hellwig 2025-02-13 1529 xfs_fileoff_t offset_fsb = XFS_B_TO_FSBT(mp, offset);
058dd70c65ab736 Christoph Hellwig 2025-02-13 1530 xfs_fileoff_t end_fsb = xfs_iomap_end_fsb(mp, offset, count);
058dd70c65ab736 Christoph Hellwig 2025-02-13 1531 u16 iomap_flags = IOMAP_F_SHARED;
058dd70c65ab736 Christoph Hellwig 2025-02-13 1532 unsigned int lockmode = XFS_ILOCK_EXCL;
058dd70c65ab736 Christoph Hellwig 2025-02-13 1533 xfs_filblks_t count_fsb;
058dd70c65ab736 Christoph Hellwig 2025-02-13 1534 xfs_extlen_t indlen;
058dd70c65ab736 Christoph Hellwig 2025-02-13 1535 struct xfs_bmbt_irec got;
058dd70c65ab736 Christoph Hellwig 2025-02-13 1536 struct xfs_iext_cursor icur;
058dd70c65ab736 Christoph Hellwig 2025-02-13 1537 int error = 0;
058dd70c65ab736 Christoph Hellwig 2025-02-13 1538
058dd70c65ab736 Christoph Hellwig 2025-02-13 1539 ASSERT(!xfs_get_extsz_hint(ip));
058dd70c65ab736 Christoph Hellwig 2025-02-13 1540 ASSERT(!(flags & IOMAP_UNSHARE));
058dd70c65ab736 Christoph Hellwig 2025-02-13 1541 ASSERT(ac);
058dd70c65ab736 Christoph Hellwig 2025-02-13 1542
058dd70c65ab736 Christoph Hellwig 2025-02-13 1543 if (xfs_is_shutdown(mp))
058dd70c65ab736 Christoph Hellwig 2025-02-13 1544 return -EIO;
058dd70c65ab736 Christoph Hellwig 2025-02-13 1545
058dd70c65ab736 Christoph Hellwig 2025-02-13 1546 error = xfs_qm_dqattach(ip);
058dd70c65ab736 Christoph Hellwig 2025-02-13 1547 if (error)
058dd70c65ab736 Christoph Hellwig 2025-02-13 1548 return error;
058dd70c65ab736 Christoph Hellwig 2025-02-13 1549
058dd70c65ab736 Christoph Hellwig 2025-02-13 1550 error = xfs_ilock_for_iomap(ip, flags, &lockmode);
058dd70c65ab736 Christoph Hellwig 2025-02-13 1551 if (error)
058dd70c65ab736 Christoph Hellwig 2025-02-13 1552 return error;
058dd70c65ab736 Christoph Hellwig 2025-02-13 1553
058dd70c65ab736 Christoph Hellwig 2025-02-13 1554 if (XFS_IS_CORRUPT(mp, !xfs_ifork_has_extents(&ip->i_df)) ||
058dd70c65ab736 Christoph Hellwig 2025-02-13 1555 XFS_TEST_ERROR(false, mp, XFS_ERRTAG_BMAPIFORMAT)) {
058dd70c65ab736 Christoph Hellwig 2025-02-13 1556 xfs_bmap_mark_sick(ip, XFS_DATA_FORK);
058dd70c65ab736 Christoph Hellwig 2025-02-13 1557 error = -EFSCORRUPTED;
058dd70c65ab736 Christoph Hellwig 2025-02-13 1558 goto out_unlock;
058dd70c65ab736 Christoph Hellwig 2025-02-13 1559 }
058dd70c65ab736 Christoph Hellwig 2025-02-13 1560
058dd70c65ab736 Christoph Hellwig 2025-02-13 1561 XFS_STATS_INC(mp, xs_blk_mapw);
058dd70c65ab736 Christoph Hellwig 2025-02-13 1562
058dd70c65ab736 Christoph Hellwig 2025-02-13 1563 error = xfs_iread_extents(NULL, ip, XFS_DATA_FORK);
058dd70c65ab736 Christoph Hellwig 2025-02-13 1564 if (error)
058dd70c65ab736 Christoph Hellwig 2025-02-13 1565 goto out_unlock;
058dd70c65ab736 Christoph Hellwig 2025-02-13 1566
058dd70c65ab736 Christoph Hellwig 2025-02-13 1567 /*
058dd70c65ab736 Christoph Hellwig 2025-02-13 1568 * For zeroing operations check if there is any data to zero first.
058dd70c65ab736 Christoph Hellwig 2025-02-13 1569 *
058dd70c65ab736 Christoph Hellwig 2025-02-13 1570 * For regular writes we always need to allocate new blocks, but need to
058dd70c65ab736 Christoph Hellwig 2025-02-13 1571 * provide the source mapping when the range is unaligned to support
058dd70c65ab736 Christoph Hellwig 2025-02-13 1572 * read-modify-write of the whole block in the page cache.
058dd70c65ab736 Christoph Hellwig 2025-02-13 1573 *
058dd70c65ab736 Christoph Hellwig 2025-02-13 1574 * In either case we need to limit the reported range to the boundaries
058dd70c65ab736 Christoph Hellwig 2025-02-13 1575 * of the source map in the data fork.
058dd70c65ab736 Christoph Hellwig 2025-02-13 1576 */
058dd70c65ab736 Christoph Hellwig 2025-02-13 1577 if (!IS_ALIGNED(offset, mp->m_sb.sb_blocksize) ||
058dd70c65ab736 Christoph Hellwig 2025-02-13 1578 !IS_ALIGNED(offset + count, mp->m_sb.sb_blocksize) ||
058dd70c65ab736 Christoph Hellwig 2025-02-13 1579 (flags & IOMAP_ZERO)) {
058dd70c65ab736 Christoph Hellwig 2025-02-13 1580 struct xfs_bmbt_irec smap;
058dd70c65ab736 Christoph Hellwig 2025-02-13 1581 struct xfs_iext_cursor scur;
058dd70c65ab736 Christoph Hellwig 2025-02-13 1582
058dd70c65ab736 Christoph Hellwig 2025-02-13 1583 if (!xfs_iext_lookup_extent(ip, &ip->i_df, offset_fsb, &scur,
058dd70c65ab736 Christoph Hellwig 2025-02-13 1584 &smap))
058dd70c65ab736 Christoph Hellwig 2025-02-13 1585 smap.br_startoff = end_fsb; /* fake hole until EOF */
058dd70c65ab736 Christoph Hellwig 2025-02-13 1586 if (smap.br_startoff > offset_fsb) {
058dd70c65ab736 Christoph Hellwig 2025-02-13 1587 /*
058dd70c65ab736 Christoph Hellwig 2025-02-13 1588 * We never need to allocate blocks for zeroing a hole.
058dd70c65ab736 Christoph Hellwig 2025-02-13 1589 */
058dd70c65ab736 Christoph Hellwig 2025-02-13 1590 if (flags & IOMAP_ZERO) {
058dd70c65ab736 Christoph Hellwig 2025-02-13 1591 xfs_hole_to_iomap(ip, iomap, offset_fsb,
058dd70c65ab736 Christoph Hellwig 2025-02-13 1592 smap.br_startoff);
058dd70c65ab736 Christoph Hellwig 2025-02-13 1593 goto out_unlock;
058dd70c65ab736 Christoph Hellwig 2025-02-13 1594 }
058dd70c65ab736 Christoph Hellwig 2025-02-13 1595 end_fsb = min(end_fsb, smap.br_startoff);
058dd70c65ab736 Christoph Hellwig 2025-02-13 1596 } else {
058dd70c65ab736 Christoph Hellwig 2025-02-13 1597 end_fsb = min(end_fsb,
058dd70c65ab736 Christoph Hellwig 2025-02-13 1598 smap.br_startoff + smap.br_blockcount);
058dd70c65ab736 Christoph Hellwig 2025-02-13 1599 xfs_trim_extent(&smap, offset_fsb,
058dd70c65ab736 Christoph Hellwig 2025-02-13 1600 end_fsb - offset_fsb);
058dd70c65ab736 Christoph Hellwig 2025-02-13 1601 error = xfs_bmbt_to_iomap(ip, srcmap, &smap, flags, 0,
058dd70c65ab736 Christoph Hellwig 2025-02-13 1602 xfs_iomap_inode_sequence(ip, 0));
058dd70c65ab736 Christoph Hellwig 2025-02-13 1603 if (error)
058dd70c65ab736 Christoph Hellwig 2025-02-13 1604 goto out_unlock;
058dd70c65ab736 Christoph Hellwig 2025-02-13 1605 }
058dd70c65ab736 Christoph Hellwig 2025-02-13 1606 }
058dd70c65ab736 Christoph Hellwig 2025-02-13 1607
058dd70c65ab736 Christoph Hellwig 2025-02-13 1608 if (!ip->i_cowfp)
058dd70c65ab736 Christoph Hellwig 2025-02-13 1609 xfs_ifork_init_cow(ip);
058dd70c65ab736 Christoph Hellwig 2025-02-13 1610
058dd70c65ab736 Christoph Hellwig 2025-02-13 1611 if (!xfs_iext_lookup_extent(ip, ip->i_cowfp, offset_fsb, &icur, &got))
058dd70c65ab736 Christoph Hellwig 2025-02-13 1612 got.br_startoff = end_fsb;
058dd70c65ab736 Christoph Hellwig 2025-02-13 1613 if (got.br_startoff <= offset_fsb) {
058dd70c65ab736 Christoph Hellwig 2025-02-13 @1614 trace_xfs_reflink_cow_found(ip, &got);
058dd70c65ab736 Christoph Hellwig 2025-02-13 1615 goto done;
058dd70c65ab736 Christoph Hellwig 2025-02-13 1616 }
058dd70c65ab736 Christoph Hellwig 2025-02-13 1617
058dd70c65ab736 Christoph Hellwig 2025-02-13 1618 /*
058dd70c65ab736 Christoph Hellwig 2025-02-13 1619 * Cap the maximum length to keep the chunks of work done here somewhat
058dd70c65ab736 Christoph Hellwig 2025-02-13 1620 * symmetric with the work writeback does.
058dd70c65ab736 Christoph Hellwig 2025-02-13 1621 */
058dd70c65ab736 Christoph Hellwig 2025-02-13 1622 end_fsb = min(end_fsb, got.br_startoff);
058dd70c65ab736 Christoph Hellwig 2025-02-13 1623 count_fsb = min3(end_fsb - offset_fsb, XFS_MAX_BMBT_EXTLEN,
058dd70c65ab736 Christoph Hellwig 2025-02-13 1624 XFS_B_TO_FSB(mp, 1024 * PAGE_SIZE));
058dd70c65ab736 Christoph Hellwig 2025-02-13 1625
058dd70c65ab736 Christoph Hellwig 2025-02-13 1626 /*
058dd70c65ab736 Christoph Hellwig 2025-02-13 1627 * The block reservation is supposed to cover all blocks that the
058dd70c65ab736 Christoph Hellwig 2025-02-13 1628 * operation could possible write, but there is a nasty corner case
058dd70c65ab736 Christoph Hellwig 2025-02-13 1629 * where blocks could be stolen from underneath us:
058dd70c65ab736 Christoph Hellwig 2025-02-13 1630 *
058dd70c65ab736 Christoph Hellwig 2025-02-13 1631 * 1) while this thread iterates over a larger buffered write,
058dd70c65ab736 Christoph Hellwig 2025-02-13 1632 * 2) another thread is causing a write fault that calls into
058dd70c65ab736 Christoph Hellwig 2025-02-13 1633 * ->page_mkwrite in range this thread writes to, using up the
058dd70c65ab736 Christoph Hellwig 2025-02-13 1634 * delalloc reservation created by a previous call to this function.
058dd70c65ab736 Christoph Hellwig 2025-02-13 1635 * 3) another thread does direct I/O on the range that the write fault
058dd70c65ab736 Christoph Hellwig 2025-02-13 1636 * happened on, which causes writeback of the dirty data.
058dd70c65ab736 Christoph Hellwig 2025-02-13 1637 * 4) this then set the stale flag, which cuts the current iomap
058dd70c65ab736 Christoph Hellwig 2025-02-13 1638 * iteration short, causing the new call to ->iomap_begin that gets
058dd70c65ab736 Christoph Hellwig 2025-02-13 1639 * us here again, but now without a sufficient reservation.
058dd70c65ab736 Christoph Hellwig 2025-02-13 1640 *
058dd70c65ab736 Christoph Hellwig 2025-02-13 1641 * This is a very unusual I/O pattern, and nothing but generic/095 is
058dd70c65ab736 Christoph Hellwig 2025-02-13 1642 * known to hit it. There's not really much we can do here, so turn this
058dd70c65ab736 Christoph Hellwig 2025-02-13 1643 * into a short write.
058dd70c65ab736 Christoph Hellwig 2025-02-13 1644 */
058dd70c65ab736 Christoph Hellwig 2025-02-13 1645 if (count_fsb > ac->reserved_blocks) {
058dd70c65ab736 Christoph Hellwig 2025-02-13 1646 xfs_warn_ratelimited(mp,
058dd70c65ab736 Christoph Hellwig 2025-02-13 1647 "Short write on ino 0x%llx comm %.20s due to three-way race with write fault and direct I/O",
058dd70c65ab736 Christoph Hellwig 2025-02-13 1648 ip->i_ino, current->comm);
058dd70c65ab736 Christoph Hellwig 2025-02-13 1649 count_fsb = ac->reserved_blocks;
058dd70c65ab736 Christoph Hellwig 2025-02-13 1650 if (!count_fsb) {
058dd70c65ab736 Christoph Hellwig 2025-02-13 1651 error = -EIO;
058dd70c65ab736 Christoph Hellwig 2025-02-13 1652 goto out_unlock;
058dd70c65ab736 Christoph Hellwig 2025-02-13 1653 }
058dd70c65ab736 Christoph Hellwig 2025-02-13 1654 }
058dd70c65ab736 Christoph Hellwig 2025-02-13 1655
058dd70c65ab736 Christoph Hellwig 2025-02-13 1656 error = xfs_quota_reserve_blkres(ip, count_fsb);
058dd70c65ab736 Christoph Hellwig 2025-02-13 1657 if (error)
058dd70c65ab736 Christoph Hellwig 2025-02-13 1658 goto out_unlock;
058dd70c65ab736 Christoph Hellwig 2025-02-13 1659
058dd70c65ab736 Christoph Hellwig 2025-02-13 1660 indlen = xfs_bmap_worst_indlen(ip, count_fsb);
058dd70c65ab736 Christoph Hellwig 2025-02-13 1661 error = xfs_dec_fdblocks(mp, indlen, false);
058dd70c65ab736 Christoph Hellwig 2025-02-13 1662 if (error)
058dd70c65ab736 Christoph Hellwig 2025-02-13 1663 goto out_unlock;
058dd70c65ab736 Christoph Hellwig 2025-02-13 1664 ip->i_delayed_blks += count_fsb;
058dd70c65ab736 Christoph Hellwig 2025-02-13 1665 xfs_mod_delalloc(ip, count_fsb, indlen);
058dd70c65ab736 Christoph Hellwig 2025-02-13 1666
058dd70c65ab736 Christoph Hellwig 2025-02-13 1667 got.br_startoff = offset_fsb;
058dd70c65ab736 Christoph Hellwig 2025-02-13 1668 got.br_startblock = nullstartblock(indlen);
058dd70c65ab736 Christoph Hellwig 2025-02-13 1669 got.br_blockcount = count_fsb;
058dd70c65ab736 Christoph Hellwig 2025-02-13 1670 got.br_state = XFS_EXT_NORM;
058dd70c65ab736 Christoph Hellwig 2025-02-13 1671 xfs_bmap_add_extent_hole_delay(ip, XFS_COW_FORK, &icur, &got);
058dd70c65ab736 Christoph Hellwig 2025-02-13 1672 ac->reserved_blocks -= count_fsb;
058dd70c65ab736 Christoph Hellwig 2025-02-13 1673 iomap_flags |= IOMAP_F_NEW;
058dd70c65ab736 Christoph Hellwig 2025-02-13 1674
058dd70c65ab736 Christoph Hellwig 2025-02-13 1675 trace_xfs_iomap_alloc(ip, offset, XFS_FSB_TO_B(mp, count_fsb),
058dd70c65ab736 Christoph Hellwig 2025-02-13 1676 XFS_COW_FORK, &got);
058dd70c65ab736 Christoph Hellwig 2025-02-13 1677 done:
058dd70c65ab736 Christoph Hellwig 2025-02-13 1678 error = xfs_bmbt_to_iomap(ip, iomap, &got, flags, iomap_flags,
058dd70c65ab736 Christoph Hellwig 2025-02-13 1679 xfs_iomap_inode_sequence(ip, IOMAP_F_SHARED));
058dd70c65ab736 Christoph Hellwig 2025-02-13 1680 out_unlock:
058dd70c65ab736 Christoph Hellwig 2025-02-13 1681 xfs_iunlock(ip, lockmode);
058dd70c65ab736 Christoph Hellwig 2025-02-13 1682 return error;
058dd70c65ab736 Christoph Hellwig 2025-02-13 1683 }
058dd70c65ab736 Christoph Hellwig 2025-02-13 1684
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH 02/14] xfs: Remove unused trace event xfs_attr_remove_iter_return
2025-06-12 21:24 ` [PATCH 02/14] xfs: Remove unused trace event xfs_attr_remove_iter_return Steven Rostedt
@ 2025-06-16 5:26 ` Christoph Hellwig
2025-06-16 14:51 ` Steven Rostedt
0 siblings, 1 reply; 28+ messages in thread
From: Christoph Hellwig @ 2025-06-16 5:26 UTC (permalink / raw)
To: Steven Rostedt
Cc: linux-kernel, linux-trace-kernel, linux-xfs, Masami Hiramatsu,
Mathieu Desnoyers, Andrew Morton, Carlos Maiolino,
Christoph Hellwig, Darrick J. Wong
Please lover case the start of the commit message after the subsystem
prefix like other xfs commits. The Subject line / one line summary
is not a sentence. Same for all the other pathes.
Otherwise looks good:
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH 07/14] xfs: ifdef out unused xfs_attr events
2025-06-12 21:24 ` [PATCH 07/14] xfs: ifdef out unused xfs_attr events Steven Rostedt
@ 2025-06-16 5:28 ` Christoph Hellwig
2025-06-16 14:52 ` Steven Rostedt
0 siblings, 1 reply; 28+ messages in thread
From: Christoph Hellwig @ 2025-06-16 5:28 UTC (permalink / raw)
To: Steven Rostedt
Cc: linux-kernel, linux-trace-kernel, linux-xfs, Masami Hiramatsu,
Mathieu Desnoyers, Andrew Morton, Carlos Maiolino,
Christoph Hellwig, Darrick J. Wong
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.
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH 00/14] xfs: Remove unused trace events
2025-06-12 21:24 [PATCH 00/14] xfs: Remove unused trace events Steven Rostedt
` (14 preceding siblings ...)
2025-06-13 15:08 ` [PATCH 00/14] xfs: Remove unused trace events Darrick J. Wong
@ 2025-06-16 5:30 ` Christoph Hellwig
15 siblings, 0 replies; 28+ messages in thread
From: Christoph Hellwig @ 2025-06-16 5:30 UTC (permalink / raw)
To: Steven Rostedt
Cc: linux-kernel, linux-trace-kernel, linux-xfs, Masami Hiramatsu,
Mathieu Desnoyers, Andrew Morton, Carlos Maiolino,
Christoph Hellwig, Darrick J. Wong
I just went over them, and modulo the nitpicks this looks fine.
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH 00/14] xfs: Remove unused trace events
2025-06-13 15:31 ` Steven Rostedt
@ 2025-06-16 5:31 ` Christoph Hellwig
2025-06-16 14:58 ` Steven Rostedt
0 siblings, 1 reply; 28+ messages in thread
From: Christoph Hellwig @ 2025-06-16 5:31 UTC (permalink / raw)
To: Steven Rostedt
Cc: Darrick J. Wong, linux-kernel, linux-trace-kernel, linux-xfs,
Masami Hiramatsu, Mathieu Desnoyers, Andrew Morton,
Carlos Maiolino, Christoph Hellwig
On Fri, Jun 13, 2025 at 11:31:19AM -0400, Steven Rostedt wrote:
> On Fri, 13 Jun 2025 08:08:55 -0700
> "Darrick J. Wong" <djwong@kernel.org> wrote:
>
> > On Thu, Jun 12, 2025 at 05:24:05PM -0400, Steven Rostedt wrote:
> > >
> > > Trace events take up to 5K in memory for text and meta data. I have code that
> >
> > Under what circumstances do they eat up that much memory? And is that
> > per-class? Or per-tracepoint?
>
> I just did an analysis of this:
>
> https://lore.kernel.org/lkml/20250613104240.509ff13c@batman.local.home/T/#md81abade0df19ba9062fd51ced4458161f885ac3
>
> A TRACE_EVENT() is about 5K, and each DEFINE_EVENT() is about 1K.
That's really quite expensive. And you only measured the tezt/data/bss
overhead and not even the dynamic memory overhead, which is probably
a lot more.
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH 02/14] xfs: Remove unused trace event xfs_attr_remove_iter_return
2025-06-16 5:26 ` Christoph Hellwig
@ 2025-06-16 14:51 ` Steven Rostedt
0 siblings, 0 replies; 28+ messages in thread
From: Steven Rostedt @ 2025-06-16 14:51 UTC (permalink / raw)
To: Christoph Hellwig
Cc: linux-kernel, linux-trace-kernel, linux-xfs, Masami Hiramatsu,
Mathieu Desnoyers, Andrew Morton, Carlos Maiolino,
Darrick J. Wong
On Mon, 16 Jun 2025 07:26:45 +0200
Christoph Hellwig <hch@lst.de> wrote:
> Please lover case the start of the commit message after the subsystem
OK.
> prefix like other xfs commits. The Subject line / one line summary
> is not a sentence. Same for all the other pathes.
>
> Otherwise looks good:
>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
Thanks,
-- Steve
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH 07/14] xfs: ifdef out unused xfs_attr events
2025-06-16 5:28 ` Christoph Hellwig
@ 2025-06-16 14:52 ` Steven Rostedt
2025-06-17 4:46 ` Christoph Hellwig
0 siblings, 1 reply; 28+ messages in thread
From: Steven Rostedt @ 2025-06-16 14:52 UTC (permalink / raw)
To: Christoph Hellwig
Cc: linux-kernel, linux-trace-kernel, linux-xfs, Masami Hiramatsu,
Mathieu Desnoyers, Andrew Morton, Carlos Maiolino,
Darrick J. Wong
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
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH 00/14] xfs: Remove unused trace events
2025-06-16 5:31 ` Christoph Hellwig
@ 2025-06-16 14:58 ` Steven Rostedt
0 siblings, 0 replies; 28+ messages in thread
From: Steven Rostedt @ 2025-06-16 14:58 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Darrick J. Wong, linux-kernel, linux-trace-kernel, linux-xfs,
Masami Hiramatsu, Mathieu Desnoyers, Andrew Morton,
Carlos Maiolino
On Mon, 16 Jun 2025 07:31:19 +0200
Christoph Hellwig <hch@lst.de> wrote:
> > I just did an analysis of this:
> >
> > https://lore.kernel.org/lkml/20250613104240.509ff13c@batman.local.home/T/#md81abade0df19ba9062fd51ced4458161f885ac3
> >
> > A TRACE_EVENT() is about 5K, and each DEFINE_EVENT() is about 1K.
>
> That's really quite expensive. And you only measured the tezt/data/bss
Yes. This is something I've spent a bit of time over the years trying
to address. With moving a bunch of code into trace_event.c with the
added expense that trace events do function calls.
It looks like it's still growing as the last time I checked it was just
under 5K (something around 4800 bytes) and now it's over 5K, and the
tracepoint code grew 4x. I'll start looking into "why" later when I
have more time to deal with this. My time budget for removing unused
events has pretty much dried up.
> overhead and not even the dynamic memory overhead, which is probably
> a lot more.
Yes, and this is another area I look to make better. It was the
motivation for eventfs which saved over 20 megs of memory by having
trace event files dynamically created instead of being permanent.
-- Steve
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH 07/14] xfs: ifdef out unused xfs_attr events
2025-06-16 14:52 ` Steven Rostedt
@ 2025-06-17 4:46 ` Christoph Hellwig
0 siblings, 0 replies; 28+ messages in thread
From: Christoph Hellwig @ 2025-06-17 4:46 UTC (permalink / raw)
To: Steven Rostedt
Cc: Christoph Hellwig, linux-kernel, linux-trace-kernel, linux-xfs,
Masami Hiramatsu, Mathieu Desnoyers, Andrew Morton,
Carlos Maiolino, Darrick J. Wong
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.
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH 00/14] xfs: Remove unused trace events
2025-06-13 15:08 ` [PATCH 00/14] xfs: Remove unused trace events Darrick J. Wong
2025-06-13 15:31 ` Steven Rostedt
@ 2025-07-23 22:35 ` Steven Rostedt
1 sibling, 0 replies; 28+ messages in thread
From: Steven Rostedt @ 2025-07-23 22:35 UTC (permalink / raw)
To: Darrick J. Wong
Cc: linux-kernel, linux-trace-kernel, linux-xfs, Masami Hiramatsu,
Mathieu Desnoyers, Andrew Morton, Carlos Maiolino,
Christoph Hellwig
On Fri, 13 Jun 2025 08:08:55 -0700
"Darrick J. Wong" <djwong@kernel.org> wrote:
> > Each patch is a stand alone patch. If you ack them, I can take them in my
> > tree, or if you want, you can take them. I may be adding the warning code to
> > linux-next near the end of the cycle, so it would be good to have this cleaned
> > up before hand. As this is removing dead code, it may be even OK to send them
> > to Linus as a fix.
>
> ...oh, you /do/ have a program and it's coming down the pipeline.
> Excellent <tents fingers>. :)
Well, Linus didn't like its current implementation, so it may be a release
or two or three before that program gets upstream :-/
-- Steve
^ permalink raw reply [flat|nested] 28+ messages in thread
end of thread, other threads:[~2025-07-23 22:35 UTC | newest]
Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-12 21:24 [PATCH 00/14] xfs: Remove unused trace events Steven Rostedt
2025-06-12 21:24 ` [PATCH 01/14] xfs: tracing; Remove unused event xfs_reflink_cow_found Steven Rostedt
2025-06-13 15:38 ` Steven Rostedt
2025-06-13 23:52 ` kernel test robot
2025-06-12 21:24 ` [PATCH 02/14] xfs: Remove unused trace event xfs_attr_remove_iter_return Steven Rostedt
2025-06-16 5:26 ` Christoph Hellwig
2025-06-16 14:51 ` Steven Rostedt
2025-06-12 21:24 ` [PATCH 03/14] xfs: Remove unused event xlog_iclog_want_sync Steven Rostedt
2025-06-12 21:24 ` [PATCH 04/14] xfs: Remove unused event xfs_ioctl_clone Steven Rostedt
2025-06-12 21:24 ` [PATCH 05/14] xfs: Remove unused xfs_reflink_compare_extents events Steven Rostedt
2025-06-12 21:24 ` [PATCH 06/14] xfs: Remove unused trace event xfs_attr_rmtval_set Steven Rostedt
2025-06-12 21:24 ` [PATCH 07/14] xfs: ifdef out unused xfs_attr events Steven Rostedt
2025-06-16 5:28 ` Christoph Hellwig
2025-06-16 14:52 ` Steven Rostedt
2025-06-17 4:46 ` Christoph Hellwig
2025-06-12 21:24 ` [PATCH 08/14] xfs: Remove unused event xfs_attr_node_removename Steven Rostedt
2025-06-12 21:24 ` [PATCH 09/14] xfs: Remove unused event xfs_alloc_near_error Steven Rostedt
2025-06-12 21:24 ` [PATCH 10/14] xfs: Remove unused event xfs_alloc_near_nominleft Steven Rostedt
2025-06-12 21:24 ` [PATCH 11/14] xfs: Remove unused event xfs_pagecache_inval Steven Rostedt
2025-06-12 21:24 ` [PATCH 12/14] xfs: Remove usused xfs_end_io_direct events Steven Rostedt
2025-06-12 21:24 ` [PATCH 13/14] xfs: Only create event xfs_file_compat_ioctl when CONFIG_COMPAT is configure Steven Rostedt
2025-06-12 21:24 ` [PATCH 14/14] xfs: Change xfs_xattr_class from a TRACE_EVENT() to DECLARE_EVENT_CLASS() Steven Rostedt
2025-06-13 15:08 ` [PATCH 00/14] xfs: Remove unused trace events Darrick J. Wong
2025-06-13 15:31 ` Steven Rostedt
2025-06-16 5:31 ` Christoph Hellwig
2025-06-16 14:58 ` Steven Rostedt
2025-07-23 22:35 ` Steven Rostedt
2025-06-16 5:30 ` Christoph Hellwig
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).