Skip to contentSkip to conversation

Clarification on NFS Tracepoint Build Warnings

PATCH Yalagada Pavan Kumar 2 participants 2 messages Oct 24 NFS client

lore
Share & tools
lore
#0 lore raw

Hi Julia,

Using the attached configuration [1], i encountered few tracepoint warnings during the kernel build. I focused on these three NFS warnings:

warning: tracepoint 'nfs_local_open_fh' is unused in module fs/nfs/nfs.o
warning: tracepoint 'nfs_atomic_open_exit' is unused in module fs/nfs/nfs.o
warning: tracepoint 'nfs_atomic_open_enter' is unused in module fs/nfs/nfs.o

I started by investigating the first warning 'nfs_local_open_fh'.

First, I searched for the tracepoint definition in fs/nfs/nfstrace.h and it defined using TRACE_EVENT(nfs_local_open_fh, ...).

Then, i searched for where the tracepoint is called and found in fs/nfs/localio.c

	trace_nfs_local_open_fh(fh, mode, status);

next, i checked fs/nfs/Makefile and found:

	nfs-$(CONFIG_NFS_LOCALIO) += localio.o

this localio.o included in NFS module only when CONFIG_NFS_LOCALIO is enabled.

then i also checked .config file and found that CONFIG_NFSD is disabled. Since LOCALIO depends on both NFSD and NFS_FS, LOCALIO is disabled in my current configuration.

so, the tracepoint is defined in nfstrace.h but localio.c is not build because CONFIG_NFS_LOCALIO is disabled.

then i made a change:

fs/nfs/nfstrace.h +2 -0
index b15c1732c869..bbd7735a1f67 100644
@@ -1898,6 +1898,7 @@ TRACE_EVENT(nfs_mount_path,
        TP_printk("path='%s'", __get_str(path))
 );
 
+#ifdef CONFIG_NFS_LOCALIO
 TRACE_EVENT(nfs_local_open_fh,
                TP_PROTO(
                        const struct nfs_fh *fh,
@@ -1926,6 +1927,7 @@ TRACE_EVENT(nfs_local_open_fh,
                        __entry->error
                )
 );
+#endif /* CONFIG_NFS_LOCALIO */
 
 DECLARE_EVENT_CLASS(nfs_xdr_event,
                TP_PROTO(

After making this change i rebuilt the kernel using:

	make -j$(nproc) UT=1

The full build compiled sucessfully. However, the build stil reported other tracepoint warnings, including nfs_atomic_open_enter and nfs_atomic_open_exit.

The nfs_local_open_fh warning did not appear in the build output.

Could you please let me know whether my understanding is correct and whether guarding the tracepoint definition with CONFIG_NFS_LOCALIO is the apprpriate fix?

I would appreciate your guidance on whether i should perform any additional checks before submitting a patch.

Thank you for your time and guidance.

[1] https://lore.kernel.org/outreachy/[email protected]/T/#u

Best regards,
Pavan

#1 lore raw
Quoted 11 lines · On Sat, 24 Oct 2026 22:23:51 +0530 Yalagada Pavan Kumar…

Hi Julia,

Using the attached configuration [1], i encountered few tracepoint warnings during the kernel build. I focused on these three NFS warnings:

warning: tracepoint 'nfs_local_open_fh' is unused in module fs/nfs/nfs.o
warning: tracepoint 'nfs_atomic_open_exit' is unused in module fs/nfs/nfs.o
warning: tracepoint 'nfs_atomic_open_enter' is unused in module fs/nfs/nfs.o

Quoted 3 lines

Could you please let me know whether my understanding is correct and whether guarding the tracepoint definition with CONFIG_NFS_LOCALIO is the apprpriate fix?

You are correct. Each warning may require a different fix. The nfs_local_open_fh was not used because CONFIG_NFS_LOCALIO was not enabled, and the TRACE_EVENT() macro should be guarded by that as your patch does.

The nfs_atomic_open_exit/exit tracepoints are called in fs/nfs/dir.c and if you see where they are used, there is:

#if IS_ENABLED(CONFIG_NFS_V4)

Around the use cases of the callers of the tracepoint. Your config doesn't have that set, which is why they were not used. The solution for those is to protect the TRACE_EVENT() definitions of those tracepoints with the guard above.

-- Steve