* Unused event xfs_growfs_check_rtgeom
@ 2025-06-12 17:10 Steven Rostedt
2025-06-12 17:16 ` Steven Rostedt
2025-06-12 17:47 ` Darrick J. Wong
0 siblings, 2 replies; 8+ messages in thread
From: Steven Rostedt @ 2025-06-12 17:10 UTC (permalink / raw)
To: LKML, linux-xfs; +Cc: Carlos Maiolino, Darrick J. Wong, Christoph Hellwig
I have code that will cause a warning if a trace event or tracepoint is
created but not used. Trace events can take up to 5K of memory in text
and meta data per event. There's a lot of events in the XFS file system
that are not used, but one in particular was added by commit
59a57acbce282 ("xfs: check that the rtrmapbt maxlevels doesn't increase
when growing fs"). That event is xfs_growfs_check_rtgeom, but it was
never called.
It looks like it was just an oversight. I'm holding off from deleting
it as it may still be valid but just never been added. It was added
relatively recently.
-- Steve
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Unused event xfs_growfs_check_rtgeom
2025-06-12 17:10 Unused event xfs_growfs_check_rtgeom Steven Rostedt
@ 2025-06-12 17:16 ` Steven Rostedt
2025-06-12 17:47 ` Darrick J. Wong
2025-06-12 17:47 ` Darrick J. Wong
1 sibling, 1 reply; 8+ messages in thread
From: Steven Rostedt @ 2025-06-12 17:16 UTC (permalink / raw)
To: LKML, linux-xfs; +Cc: Carlos Maiolino, Darrick J. Wong, Christoph Hellwig
I also found events: xfs_metadir_link and xfs_metadir_start_link are
defined in fs/xfs/libxfs/xfs_metadir.c in a #ifndef __KERNEL__ section.
Are these events ever used? Why are they called in !__KERNEL__ code?
-- Steve
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Unused event xfs_growfs_check_rtgeom
2025-06-12 17:16 ` Steven Rostedt
@ 2025-06-12 17:47 ` Darrick J. Wong
2025-06-12 18:46 ` Steven Rostedt
0 siblings, 1 reply; 8+ messages in thread
From: Darrick J. Wong @ 2025-06-12 17:47 UTC (permalink / raw)
To: Steven Rostedt; +Cc: LKML, linux-xfs, Carlos Maiolino, Christoph Hellwig
On Thu, Jun 12, 2025 at 01:16:51PM -0400, Steven Rostedt wrote:
> I also found events: xfs_metadir_link and xfs_metadir_start_link are
> defined in fs/xfs/libxfs/xfs_metadir.c in a #ifndef __KERNEL__ section.
>
> Are these events ever used? Why are they called in !__KERNEL__ code?
libxfs is shared with userspace, and xfs_repair uses them to relink old
quota files.
--D
> -- Steve
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Unused event xfs_growfs_check_rtgeom
2025-06-12 17:10 Unused event xfs_growfs_check_rtgeom Steven Rostedt
2025-06-12 17:16 ` Steven Rostedt
@ 2025-06-12 17:47 ` Darrick J. Wong
2025-06-12 20:58 ` Steven Rostedt
1 sibling, 1 reply; 8+ messages in thread
From: Darrick J. Wong @ 2025-06-12 17:47 UTC (permalink / raw)
To: Steven Rostedt; +Cc: LKML, linux-xfs, Carlos Maiolino, Christoph Hellwig
On Thu, Jun 12, 2025 at 01:10:21PM -0400, Steven Rostedt wrote:
> I have code that will cause a warning if a trace event or tracepoint is
> created but not used. Trace events can take up to 5K of memory in text
> and meta data per event. There's a lot of events in the XFS file system
> that are not used, but one in particular was added by commit
> 59a57acbce282 ("xfs: check that the rtrmapbt maxlevels doesn't increase
> when growing fs"). That event is xfs_growfs_check_rtgeom, but it was
> never called.
>
> It looks like it was just an oversight. I'm holding off from deleting
> it as it may still be valid but just never been added. It was added
> relatively recently.
Yes that's a bug. Will send a fix shortly.
--D
> -- Steve
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Unused event xfs_growfs_check_rtgeom
2025-06-12 17:47 ` Darrick J. Wong
@ 2025-06-12 18:46 ` Steven Rostedt
2025-06-13 5:59 ` Christoph Hellwig
0 siblings, 1 reply; 8+ messages in thread
From: Steven Rostedt @ 2025-06-12 18:46 UTC (permalink / raw)
To: Darrick J. Wong; +Cc: LKML, linux-xfs, Carlos Maiolino, Christoph Hellwig
On Thu, 12 Jun 2025 10:47:37 -0700
"Darrick J. Wong" <djwong@kernel.org> wrote:
> On Thu, Jun 12, 2025 at 01:16:51PM -0400, Steven Rostedt wrote:
> > I also found events: xfs_metadir_link and xfs_metadir_start_link are
> > defined in fs/xfs/libxfs/xfs_metadir.c in a #ifndef __KERNEL__ section.
> >
> > Are these events ever used? Why are they called in !__KERNEL__ code?
>
> libxfs is shared with userspace, and xfs_repair uses them to relink old
> quota files.
>
Does this userspace use these trace events? If so, I think the events
need to have an:
#ifndef __KERENL__
around them too.
-- Steve
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Unused event xfs_growfs_check_rtgeom
2025-06-12 17:47 ` Darrick J. Wong
@ 2025-06-12 20:58 ` Steven Rostedt
0 siblings, 0 replies; 8+ messages in thread
From: Steven Rostedt @ 2025-06-12 20:58 UTC (permalink / raw)
To: Darrick J. Wong; +Cc: LKML, linux-xfs, Carlos Maiolino, Christoph Hellwig
On Thu, 12 Jun 2025 10:47:58 -0700
"Darrick J. Wong" <djwong@kernel.org> wrote:
> On Thu, Jun 12, 2025 at 01:10:21PM -0400, Steven Rostedt wrote:
> > I have code that will cause a warning if a trace event or tracepoint is
> > created but not used. Trace events can take up to 5K of memory in text
> > and meta data per event. There's a lot of events in the XFS file system
> > that are not used, but one in particular was added by commit
> > 59a57acbce282 ("xfs: check that the rtrmapbt maxlevels doesn't increase
> > when growing fs"). That event is xfs_growfs_check_rtgeom, but it was
> > never called.
> >
> > It looks like it was just an oversight. I'm holding off from deleting
> > it as it may still be valid but just never been added. It was added
> > relatively recently.
>
> Yes that's a bug. Will send a fix shortly.
>
Hmm, this looks like another event that may have been forgotten to be added:
xfs_discard_rtrelax
It was added by 3ba3ab1f671 ("xfs: enable FITRIM on the realtime
device") but never called.
As well as event xfs_log_cil_return which was added by c1220522ef4
("xfs: grant heads track byte counts, not LSNs")
And in commit defee8dff2b2 ("xfs: online repair of realtime bitmaps for
a realtime group"), the following events were added but not used:
xrep_rtbitmap_load
xrep_rtbitmap_load_word
xrep_rtbitmap_load_words
Commit e6c9e75fbe79 ("xfs: move files to orphanage instead of letting
nlinks drop to zero") Added:
xrep_nlinks_set_record
Commit dbbdbd00863 ("xfs: repair problems in CoW forks") added:
xrep_cow_free_staging
I'll be sending patches that removes or hides other events that are no
longer used.
-- Steve
-- Steve
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Unused event xfs_growfs_check_rtgeom
2025-06-12 18:46 ` Steven Rostedt
@ 2025-06-13 5:59 ` Christoph Hellwig
2025-06-16 14:50 ` Steven Rostedt
0 siblings, 1 reply; 8+ messages in thread
From: Christoph Hellwig @ 2025-06-13 5:59 UTC (permalink / raw)
To: Steven Rostedt
Cc: Darrick J. Wong, LKML, linux-xfs, Carlos Maiolino,
Christoph Hellwig
On Thu, Jun 12, 2025 at 02:46:08PM -0400, Steven Rostedt wrote:
> On Thu, 12 Jun 2025 10:47:37 -0700
> "Darrick J. Wong" <djwong@kernel.org> wrote:
>
> > On Thu, Jun 12, 2025 at 01:16:51PM -0400, Steven Rostedt wrote:
> > > I also found events: xfs_metadir_link and xfs_metadir_start_link are
> > > defined in fs/xfs/libxfs/xfs_metadir.c in a #ifndef __KERNEL__ section.
> > >
> > > Are these events ever used? Why are they called in !__KERNEL__ code?
> >
> > libxfs is shared with userspace, and xfs_repair uses them to relink old
> > quota files.
> >
>
> Does this userspace use these trace events? If so, I think the events
> need to have an:
They have stubs for them.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Unused event xfs_growfs_check_rtgeom
2025-06-13 5:59 ` Christoph Hellwig
@ 2025-06-16 14:50 ` Steven Rostedt
0 siblings, 0 replies; 8+ messages in thread
From: Steven Rostedt @ 2025-06-16 14:50 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Darrick J. Wong, LKML, linux-xfs, Carlos Maiolino,
Christoph Hellwig
On Thu, 12 Jun 2025 22:59:47 -0700
Christoph Hellwig <hch@infradead.org> wrote:
> On Thu, Jun 12, 2025 at 02:46:08PM -0400, Steven Rostedt wrote:
> > On Thu, 12 Jun 2025 10:47:37 -0700
> > "Darrick J. Wong" <djwong@kernel.org> wrote:
> >
> > > On Thu, Jun 12, 2025 at 01:16:51PM -0400, Steven Rostedt wrote:
> > > > I also found events: xfs_metadir_link and xfs_metadir_start_link are
> > > > defined in fs/xfs/libxfs/xfs_metadir.c in a #ifndef __KERNEL__ section.
> > > >
> > > > Are these events ever used? Why are they called in !__KERNEL__ code?
> > >
> > > libxfs is shared with userspace, and xfs_repair uses them to relink old
> > > quota files.
> > >
> >
> > Does this userspace use these trace events? If so, I think the events
> > need to have an:
>
> They have stubs for them.
If user space only has stubs for them, then why do they exist? The call
to this tracepoints are within #ifndef __KERNEL__ so the kernel will
never call them. Or can the user space stubs be replaced by actual content?
Either case, the events in the header file should be hidden from the kernel.
-- Steve
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2025-06-16 14:50 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-12 17:10 Unused event xfs_growfs_check_rtgeom Steven Rostedt
2025-06-12 17:16 ` Steven Rostedt
2025-06-12 17:47 ` Darrick J. Wong
2025-06-12 18:46 ` Steven Rostedt
2025-06-13 5:59 ` Christoph Hellwig
2025-06-16 14:50 ` Steven Rostedt
2025-06-12 17:47 ` Darrick J. Wong
2025-06-12 20:58 ` Steven Rostedt
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).