netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] sunrpc: allow dprintk() to go to the trace buffer instead of console
@ 2025-08-21 17:16 Jeff Layton
  2025-08-21 17:16 ` [PATCH 1/2] sunrpc: remove dfprintk_cont() and dfprintk_rcu_cont() Jeff Layton
  2025-08-21 17:16 ` [PATCH 2/2] sunrpc: add a Kconfig option to redirect dfprintk() output to trace buffer Jeff Layton
  0 siblings, 2 replies; 7+ messages in thread
From: Jeff Layton @ 2025-08-21 17:16 UTC (permalink / raw)
  To: Trond Myklebust, Anna Schumaker, Chuck Lever, NeilBrown,
	Olga Kornievskaia, Dai Ngo, Tom Talpey, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman
  Cc: linux-nfs, linux-kernel, netdev, Jeff Layton

While we have added a lot of static tracepoints in the last few years,
we still have a load of dprintks in place at all levels of the
NFS/NLM/RPC stack. At the same time, they're pretty useless under any
significant load.

This adds a new Kconfig switch to allow those to go to the trace buffer
instead. In addition to being more efficient, that allows us to enable
static tracepoints alongside dprintk() and get a unified log.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
Jeff Layton (2):
      sunrpc: remove dfprintk_cont() and dfprintk_rcu_cont()
      sunrpc: add a Kconfig option to redirect dfprintk() output to trace buffer

 fs/nfs/write.c               |  6 +++---
 include/linux/sunrpc/debug.h | 30 ++++++++----------------------
 net/sunrpc/Kconfig           | 14 ++++++++++++++
 3 files changed, 25 insertions(+), 25 deletions(-)
---
base-commit: 80a1bea0cd81de70c56b37a8292c23d57419776f
change-id: 20250821-nfs-testing-2b21070952d4

Best regards,
-- 
Jeff Layton <jlayton@kernel.org>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/2] sunrpc: remove dfprintk_cont() and dfprintk_rcu_cont()
  2025-08-21 17:16 [PATCH 0/2] sunrpc: allow dprintk() to go to the trace buffer instead of console Jeff Layton
@ 2025-08-21 17:16 ` Jeff Layton
  2025-08-21 17:16 ` [PATCH 2/2] sunrpc: add a Kconfig option to redirect dfprintk() output to trace buffer Jeff Layton
  1 sibling, 0 replies; 7+ messages in thread
From: Jeff Layton @ 2025-08-21 17:16 UTC (permalink / raw)
  To: Trond Myklebust, Anna Schumaker, Chuck Lever, NeilBrown,
	Olga Kornievskaia, Dai Ngo, Tom Talpey, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman
  Cc: linux-nfs, linux-kernel, netdev, Jeff Layton

KERN_CONT hails from a simpler time, which SMP wasn't the norm. These
days, it doesn't quite work right since another printk() can always race
in between the first one and the one being "continued".

Nothing calls dprintk_rcu_cont(). The only caller of dprintk_cont() is
in nfs_commit_release_pages(). Just use a normal dprintk() there
instead, since this is not SMP-safe anyway. With that, we can also drop
KERN_DEFAULT from the format since it's implied.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/nfs/write.c               |  6 +++---
 include/linux/sunrpc/debug.h | 24 ++----------------------
 2 files changed, 5 insertions(+), 25 deletions(-)

diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index d881486d235ba042feedd2dd59d6a60b366b9600..4d5699b4a1fabff39e67998af40561620b532db6 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -1862,7 +1862,7 @@ static void nfs_commit_release_pages(struct nfs_commit_data *data)
 				nfs_mapping_set_error(folio, status);
 				nfs_inode_remove_request(req);
 			}
-			dprintk_cont(", error = %d\n", status);
+			dprintk(", error = %d\n", status);
 			goto next;
 		}
 
@@ -1872,11 +1872,11 @@ static void nfs_commit_release_pages(struct nfs_commit_data *data)
 			/* We have a match */
 			if (folio)
 				nfs_inode_remove_request(req);
-			dprintk_cont(" OK\n");
+			dprintk(" OK\n");
 			goto next;
 		}
 		/* We have a mismatch. Write the page again */
-		dprintk_cont(" mismatch\n");
+		dprintk(" mismatch\n");
 		nfs_mark_request_dirty(req);
 		atomic_long_inc(&NFS_I(data->inode)->redirtied_pages);
 	next:
diff --git a/include/linux/sunrpc/debug.h b/include/linux/sunrpc/debug.h
index f6aeed07fe04e3d51d7f9d23b10fe86d36241b45..99a6fa4a1d6af0b275546a53957f07c9a509f2ac 100644
--- a/include/linux/sunrpc/debug.h
+++ b/include/linux/sunrpc/debug.h
@@ -23,12 +23,8 @@ extern unsigned int		nlm_debug;
 
 #define dprintk(fmt, ...)						\
 	dfprintk(FACILITY, fmt, ##__VA_ARGS__)
-#define dprintk_cont(fmt, ...)						\
-	dfprintk_cont(FACILITY, fmt, ##__VA_ARGS__)
 #define dprintk_rcu(fmt, ...)						\
 	dfprintk_rcu(FACILITY, fmt, ##__VA_ARGS__)
-#define dprintk_rcu_cont(fmt, ...)					\
-	dfprintk_rcu_cont(FACILITY, fmt, ##__VA_ARGS__)
 
 #undef ifdebug
 #if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
@@ -37,29 +33,14 @@ extern unsigned int		nlm_debug;
 # define dfprintk(fac, fmt, ...)					\
 do {									\
 	ifdebug(fac)							\
-		printk(KERN_DEFAULT fmt, ##__VA_ARGS__);		\
-} while (0)
-
-# define dfprintk_cont(fac, fmt, ...)					\
-do {									\
-	ifdebug(fac)							\
-		printk(KERN_CONT fmt, ##__VA_ARGS__);			\
+		printk(KERN_DEFAULT fmt, ##__VA_ARGS__);				\
 } while (0)
 
 # define dfprintk_rcu(fac, fmt, ...)					\
 do {									\
 	ifdebug(fac) {							\
 		rcu_read_lock();					\
-		printk(KERN_DEFAULT fmt, ##__VA_ARGS__);		\
-		rcu_read_unlock();					\
-	}								\
-} while (0)
-
-# define dfprintk_rcu_cont(fac, fmt, ...)				\
-do {									\
-	ifdebug(fac) {							\
-		rcu_read_lock();					\
-		printk(KERN_CONT fmt, ##__VA_ARGS__);			\
+		printk(KERN_DEFAULT fmt, ##__VA_ARGS__);				\
 		rcu_read_unlock();					\
 	}								\
 } while (0)
@@ -68,7 +49,6 @@ do {									\
 #else
 # define ifdebug(fac)		if (0)
 # define dfprintk(fac, fmt, ...)	do {} while (0)
-# define dfprintk_cont(fac, fmt, ...)	do {} while (0)
 # define dfprintk_rcu(fac, fmt, ...)	do {} while (0)
 # define RPC_IFDEBUG(x)
 #endif

-- 
2.50.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] sunrpc: add a Kconfig option to redirect dfprintk() output to trace buffer
  2025-08-21 17:16 [PATCH 0/2] sunrpc: allow dprintk() to go to the trace buffer instead of console Jeff Layton
  2025-08-21 17:16 ` [PATCH 1/2] sunrpc: remove dfprintk_cont() and dfprintk_rcu_cont() Jeff Layton
@ 2025-08-21 17:16 ` Jeff Layton
  2025-08-21 19:44   ` Anna Schumaker
  2025-08-22  6:22   ` kernel test robot
  1 sibling, 2 replies; 7+ messages in thread
From: Jeff Layton @ 2025-08-21 17:16 UTC (permalink / raw)
  To: Trond Myklebust, Anna Schumaker, Chuck Lever, NeilBrown,
	Olga Kornievskaia, Dai Ngo, Tom Talpey, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman
  Cc: linux-nfs, linux-kernel, netdev, Jeff Layton

We have a lot of old dprintk() call sites that aren't going anywhere
anytime soon. At the same time, turning them up is a serious burden on
the host due to the console locking overhead.

Add a new Kconfig option that redirects dfprintk() output to the trace
buffer. This is more efficient than logging to the console and allows
for proper interleaving of dprintk and static tracepoint events.

Since using trace_printk() causes scary warnings to pop at boot time,
this new option defaults to "n".

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 include/linux/sunrpc/debug.h | 10 ++++++++--
 net/sunrpc/Kconfig           | 14 ++++++++++++++
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/include/linux/sunrpc/debug.h b/include/linux/sunrpc/debug.h
index 99a6fa4a1d6af0b275546a53957f07c9a509f2ac..fd9f79fa534ef001b3ec5e6d7e4b1099843b64a4 100644
--- a/include/linux/sunrpc/debug.h
+++ b/include/linux/sunrpc/debug.h
@@ -30,17 +30,23 @@ extern unsigned int		nlm_debug;
 #if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
 # define ifdebug(fac)		if (unlikely(rpc_debug & RPCDBG_##fac))
 
+# if IS_ENABLED(CONFIG_SUNRPC_DEBUG_TRACE)
+#  define __sunrpc_printk(fmt, ...)	trace_printk(fmt, ##__VA_ARGS__)
+# else
+#  define __sunrpc_printk(fmt, ...)	pr_default(fmt, ##__VA_ARGS__)
+# endif
+
 # define dfprintk(fac, fmt, ...)					\
 do {									\
 	ifdebug(fac)							\
-		printk(KERN_DEFAULT fmt, ##__VA_ARGS__);				\
+		__sunrpc_printk(fmt, ##__VA_ARGS__);			\
 } while (0)
 
 # define dfprintk_rcu(fac, fmt, ...)					\
 do {									\
 	ifdebug(fac) {							\
 		rcu_read_lock();					\
-		printk(KERN_DEFAULT fmt, ##__VA_ARGS__);				\
+		__sunrpc_printk(fmt, ##__VA_ARGS__);			\
 		rcu_read_unlock();					\
 	}								\
 } while (0)
diff --git a/net/sunrpc/Kconfig b/net/sunrpc/Kconfig
index 2d8b67dac7b5b58a8a86c3022dd573746fb22547..a570e7adf270fb8976f751266bbffe39ef696c6a 100644
--- a/net/sunrpc/Kconfig
+++ b/net/sunrpc/Kconfig
@@ -101,6 +101,20 @@ config SUNRPC_DEBUG
 
 	  If unsure, say Y.
 
+config SUNRPC_DEBUG_TRACE
+	bool "RPC: Send dfprintk() output to the trace buffer"
+	depends on SUNRPC_DEBUG && TRACING
+	default n
+	help
+          dprintk() output can be voluminous, which can overwhelm the
+          kernel's logging facility as it must be sent to the console.
+          This option causes dprintk() output to go to the trace buffer
+          instead of the kernel log.
+
+          This will cause warnings about trace_printk() being used to be
+          logged at boot time, so say N unless you are debugging a problem
+          with sunrpc-based clients or services.
+
 config SUNRPC_XPRT_RDMA
 	tristate "RPC-over-RDMA transport"
 	depends on SUNRPC && INFINIBAND && INFINIBAND_ADDR_TRANS

-- 
2.50.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] sunrpc: add a Kconfig option to redirect dfprintk() output to trace buffer
  2025-08-21 17:16 ` [PATCH 2/2] sunrpc: add a Kconfig option to redirect dfprintk() output to trace buffer Jeff Layton
@ 2025-08-21 19:44   ` Anna Schumaker
  2025-08-21 19:51     ` Jeff Layton
  2025-08-22  6:22   ` kernel test robot
  1 sibling, 1 reply; 7+ messages in thread
From: Anna Schumaker @ 2025-08-21 19:44 UTC (permalink / raw)
  To: Jeff Layton, Trond Myklebust, Anna Schumaker, Chuck Lever,
	NeilBrown, Olga Kornievskaia, Dai Ngo, Tom Talpey,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Simon Horman
  Cc: linux-nfs, linux-kernel, netdev

Hi Jeff,

On 8/21/25 1:16 PM, Jeff Layton wrote:
> We have a lot of old dprintk() call sites that aren't going anywhere
> anytime soon. At the same time, turning them up is a serious burden on
> the host due to the console locking overhead.
> 
> Add a new Kconfig option that redirects dfprintk() output to the trace
> buffer. This is more efficient than logging to the console and allows
> for proper interleaving of dprintk and static tracepoint events.
> 
> Since using trace_printk() causes scary warnings to pop at boot time,
> this new option defaults to "n".
> 
> Signed-off-by: Jeff Layton <jlayton@kernel.org>
> ---
>  include/linux/sunrpc/debug.h | 10 ++++++++--
>  net/sunrpc/Kconfig           | 14 ++++++++++++++
>  2 files changed, 22 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/sunrpc/debug.h b/include/linux/sunrpc/debug.h
> index 99a6fa4a1d6af0b275546a53957f07c9a509f2ac..fd9f79fa534ef001b3ec5e6d7e4b1099843b64a4 100644
> --- a/include/linux/sunrpc/debug.h
> +++ b/include/linux/sunrpc/debug.h
> @@ -30,17 +30,23 @@ extern unsigned int		nlm_debug;
>  #if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
>  # define ifdebug(fac)		if (unlikely(rpc_debug & RPCDBG_##fac))
>  
> +# if IS_ENABLED(CONFIG_SUNRPC_DEBUG_TRACE)
> +#  define __sunrpc_printk(fmt, ...)	trace_printk(fmt, ##__VA_ARGS__)
> +# else
> +#  define __sunrpc_printk(fmt, ...)	pr_default(fmt, ##__VA_ARGS__)

This is the only reference I can find to "pr_default()" in my tree, and my compiler isn't
very happy about it. Am I missing a patch somewhere?

Thanks,
Anna

> +# endif
> +
>  # define dfprintk(fac, fmt, ...)					\
>  do {									\
>  	ifdebug(fac)							\
> -		printk(KERN_DEFAULT fmt, ##__VA_ARGS__);				\
> +		__sunrpc_printk(fmt, ##__VA_ARGS__);			\
>  } while (0)
>  
>  # define dfprintk_rcu(fac, fmt, ...)					\
>  do {									\
>  	ifdebug(fac) {							\
>  		rcu_read_lock();					\
> -		printk(KERN_DEFAULT fmt, ##__VA_ARGS__);				\
> +		__sunrpc_printk(fmt, ##__VA_ARGS__);			\
>  		rcu_read_unlock();					\
>  	}								\
>  } while (0)
> diff --git a/net/sunrpc/Kconfig b/net/sunrpc/Kconfig
> index 2d8b67dac7b5b58a8a86c3022dd573746fb22547..a570e7adf270fb8976f751266bbffe39ef696c6a 100644
> --- a/net/sunrpc/Kconfig
> +++ b/net/sunrpc/Kconfig
> @@ -101,6 +101,20 @@ config SUNRPC_DEBUG
>  
>  	  If unsure, say Y.
>  
> +config SUNRPC_DEBUG_TRACE
> +	bool "RPC: Send dfprintk() output to the trace buffer"
> +	depends on SUNRPC_DEBUG && TRACING
> +	default n
> +	help
> +          dprintk() output can be voluminous, which can overwhelm the
> +          kernel's logging facility as it must be sent to the console.
> +          This option causes dprintk() output to go to the trace buffer
> +          instead of the kernel log.
> +
> +          This will cause warnings about trace_printk() being used to be
> +          logged at boot time, so say N unless you are debugging a problem
> +          with sunrpc-based clients or services.
> +
>  config SUNRPC_XPRT_RDMA
>  	tristate "RPC-over-RDMA transport"
>  	depends on SUNRPC && INFINIBAND && INFINIBAND_ADDR_TRANS
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] sunrpc: add a Kconfig option to redirect dfprintk() output to trace buffer
  2025-08-21 19:44   ` Anna Schumaker
@ 2025-08-21 19:51     ` Jeff Layton
  2025-08-21 21:02       ` Anna Schumaker
  0 siblings, 1 reply; 7+ messages in thread
From: Jeff Layton @ 2025-08-21 19:51 UTC (permalink / raw)
  To: Anna Schumaker, Trond Myklebust, Anna Schumaker, Chuck Lever,
	NeilBrown, Olga Kornievskaia, Dai Ngo, Tom Talpey,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Simon Horman
  Cc: linux-nfs, linux-kernel, netdev

On Thu, 2025-08-21 at 15:44 -0400, Anna Schumaker wrote:
> Hi Jeff,
> 
> On 8/21/25 1:16 PM, Jeff Layton wrote:
> > We have a lot of old dprintk() call sites that aren't going anywhere
> > anytime soon. At the same time, turning them up is a serious burden on
> > the host due to the console locking overhead.
> > 
> > Add a new Kconfig option that redirects dfprintk() output to the trace
> > buffer. This is more efficient than logging to the console and allows
> > for proper interleaving of dprintk and static tracepoint events.
> > 
> > Since using trace_printk() causes scary warnings to pop at boot time,
> > this new option defaults to "n".
> > 
> > Signed-off-by: Jeff Layton <jlayton@kernel.org>
> > ---
> >  include/linux/sunrpc/debug.h | 10 ++++++++--
> >  net/sunrpc/Kconfig           | 14 ++++++++++++++
> >  2 files changed, 22 insertions(+), 2 deletions(-)
> > 
> > diff --git a/include/linux/sunrpc/debug.h b/include/linux/sunrpc/debug.h
> > index 99a6fa4a1d6af0b275546a53957f07c9a509f2ac..fd9f79fa534ef001b3ec5e6d7e4b1099843b64a4 100644
> > --- a/include/linux/sunrpc/debug.h
> > +++ b/include/linux/sunrpc/debug.h
> > @@ -30,17 +30,23 @@ extern unsigned int		nlm_debug;
> >  #if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
> >  # define ifdebug(fac)		if (unlikely(rpc_debug & RPCDBG_##fac))
> >  
> > +# if IS_ENABLED(CONFIG_SUNRPC_DEBUG_TRACE)
> > +#  define __sunrpc_printk(fmt, ...)	trace_printk(fmt, ##__VA_ARGS__)
> > +# else
> > +#  define __sunrpc_printk(fmt, ...)	pr_default(fmt, ##__VA_ARGS__)
> 
> This is the only reference I can find to "pr_default()" in my tree, and my compiler isn't
> very happy about it. Am I missing a patch somewhere?
> 
> Thanks,
> Anna
> 

No, my apologies. I had made a change in my test branch and didn't pick
it back into my send branch. That should be:

#  define __sunrpc_printk(fmt, ...)	printk(KERN_DEFAULT fmt, ##__VA_ARGS__)

I can resend if you are amenable to this patch.

> > +# endif
> > +
> >  # define dfprintk(fac, fmt, ...)					\
> >  do {									\
> >  	ifdebug(fac)							\
> > -		printk(KERN_DEFAULT fmt, ##__VA_ARGS__);				\
> > +		__sunrpc_printk(fmt, ##__VA_ARGS__);			\
> >  } while (0)
> >  
> >  # define dfprintk_rcu(fac, fmt, ...)					\
> >  do {									\
> >  	ifdebug(fac) {							\
> >  		rcu_read_lock();					\
> > -		printk(KERN_DEFAULT fmt, ##__VA_ARGS__);				\
> > +		__sunrpc_printk(fmt, ##__VA_ARGS__);			\
> >  		rcu_read_unlock();					\
> >  	}								\
> >  } while (0)
> > diff --git a/net/sunrpc/Kconfig b/net/sunrpc/Kconfig
> > index 2d8b67dac7b5b58a8a86c3022dd573746fb22547..a570e7adf270fb8976f751266bbffe39ef696c6a 100644
> > --- a/net/sunrpc/Kconfig
> > +++ b/net/sunrpc/Kconfig
> > @@ -101,6 +101,20 @@ config SUNRPC_DEBUG
> >  
> >  	  If unsure, say Y.
> >  
> > +config SUNRPC_DEBUG_TRACE
> > +	bool "RPC: Send dfprintk() output to the trace buffer"
> > +	depends on SUNRPC_DEBUG && TRACING
> > +	default n
> > +	help
> > +          dprintk() output can be voluminous, which can overwhelm the
> > +          kernel's logging facility as it must be sent to the console.
> > +          This option causes dprintk() output to go to the trace buffer
> > +          instead of the kernel log.
> > +
> > +          This will cause warnings about trace_printk() being used to be
> > +          logged at boot time, so say N unless you are debugging a problem
> > +          with sunrpc-based clients or services.
> > +
> >  config SUNRPC_XPRT_RDMA
> >  	tristate "RPC-over-RDMA transport"
> >  	depends on SUNRPC && INFINIBAND && INFINIBAND_ADDR_TRANS
> > 

-- 
Jeff Layton <jlayton@kernel.org>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] sunrpc: add a Kconfig option to redirect dfprintk() output to trace buffer
  2025-08-21 19:51     ` Jeff Layton
@ 2025-08-21 21:02       ` Anna Schumaker
  0 siblings, 0 replies; 7+ messages in thread
From: Anna Schumaker @ 2025-08-21 21:02 UTC (permalink / raw)
  To: Jeff Layton, Trond Myklebust, Anna Schumaker, Chuck Lever,
	NeilBrown, Olga Kornievskaia, Dai Ngo, Tom Talpey,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Simon Horman
  Cc: linux-nfs, linux-kernel, netdev



On 8/21/25 3:51 PM, Jeff Layton wrote:
> On Thu, 2025-08-21 at 15:44 -0400, Anna Schumaker wrote:
>> Hi Jeff,
>>
>> On 8/21/25 1:16 PM, Jeff Layton wrote:
>>> We have a lot of old dprintk() call sites that aren't going anywhere
>>> anytime soon. At the same time, turning them up is a serious burden on
>>> the host due to the console locking overhead.
>>>
>>> Add a new Kconfig option that redirects dfprintk() output to the trace
>>> buffer. This is more efficient than logging to the console and allows
>>> for proper interleaving of dprintk and static tracepoint events.
>>>
>>> Since using trace_printk() causes scary warnings to pop at boot time,
>>> this new option defaults to "n".
>>>
>>> Signed-off-by: Jeff Layton <jlayton@kernel.org>
>>> ---
>>>  include/linux/sunrpc/debug.h | 10 ++++++++--
>>>  net/sunrpc/Kconfig           | 14 ++++++++++++++
>>>  2 files changed, 22 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/include/linux/sunrpc/debug.h b/include/linux/sunrpc/debug.h
>>> index 99a6fa4a1d6af0b275546a53957f07c9a509f2ac..fd9f79fa534ef001b3ec5e6d7e4b1099843b64a4 100644
>>> --- a/include/linux/sunrpc/debug.h
>>> +++ b/include/linux/sunrpc/debug.h
>>> @@ -30,17 +30,23 @@ extern unsigned int		nlm_debug;
>>>  #if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
>>>  # define ifdebug(fac)		if (unlikely(rpc_debug & RPCDBG_##fac))
>>>  
>>> +# if IS_ENABLED(CONFIG_SUNRPC_DEBUG_TRACE)
>>> +#  define __sunrpc_printk(fmt, ...)	trace_printk(fmt, ##__VA_ARGS__)
>>> +# else
>>> +#  define __sunrpc_printk(fmt, ...)	pr_default(fmt, ##__VA_ARGS__)
>>
>> This is the only reference I can find to "pr_default()" in my tree, and my compiler isn't
>> very happy about it. Am I missing a patch somewhere?
>>
>> Thanks,
>> Anna
>>
> 
> No, my apologies. I had made a change in my test branch and didn't pick
> it back into my send branch. That should be:
> 
> #  define __sunrpc_printk(fmt, ...)	printk(KERN_DEFAULT fmt, ##__VA_ARGS__)
> 
> I can resend if you are amenable to this patch.

Yes, please do resend!

Thanks,
Anna

> 
>>> +# endif
>>> +
>>>  # define dfprintk(fac, fmt, ...)					\
>>>  do {									\
>>>  	ifdebug(fac)							\
>>> -		printk(KERN_DEFAULT fmt, ##__VA_ARGS__);				\
>>> +		__sunrpc_printk(fmt, ##__VA_ARGS__);			\
>>>  } while (0)
>>>  
>>>  # define dfprintk_rcu(fac, fmt, ...)					\
>>>  do {									\
>>>  	ifdebug(fac) {							\
>>>  		rcu_read_lock();					\
>>> -		printk(KERN_DEFAULT fmt, ##__VA_ARGS__);				\
>>> +		__sunrpc_printk(fmt, ##__VA_ARGS__);			\
>>>  		rcu_read_unlock();					\
>>>  	}								\
>>>  } while (0)
>>> diff --git a/net/sunrpc/Kconfig b/net/sunrpc/Kconfig
>>> index 2d8b67dac7b5b58a8a86c3022dd573746fb22547..a570e7adf270fb8976f751266bbffe39ef696c6a 100644
>>> --- a/net/sunrpc/Kconfig
>>> +++ b/net/sunrpc/Kconfig
>>> @@ -101,6 +101,20 @@ config SUNRPC_DEBUG
>>>  
>>>  	  If unsure, say Y.
>>>  
>>> +config SUNRPC_DEBUG_TRACE
>>> +	bool "RPC: Send dfprintk() output to the trace buffer"
>>> +	depends on SUNRPC_DEBUG && TRACING
>>> +	default n
>>> +	help
>>> +          dprintk() output can be voluminous, which can overwhelm the
>>> +          kernel's logging facility as it must be sent to the console.
>>> +          This option causes dprintk() output to go to the trace buffer
>>> +          instead of the kernel log.
>>> +
>>> +          This will cause warnings about trace_printk() being used to be
>>> +          logged at boot time, so say N unless you are debugging a problem
>>> +          with sunrpc-based clients or services.
>>> +
>>>  config SUNRPC_XPRT_RDMA
>>>  	tristate "RPC-over-RDMA transport"
>>>  	depends on SUNRPC && INFINIBAND && INFINIBAND_ADDR_TRANS
>>>
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] sunrpc: add a Kconfig option to redirect dfprintk() output to trace buffer
  2025-08-21 17:16 ` [PATCH 2/2] sunrpc: add a Kconfig option to redirect dfprintk() output to trace buffer Jeff Layton
  2025-08-21 19:44   ` Anna Schumaker
@ 2025-08-22  6:22   ` kernel test robot
  1 sibling, 0 replies; 7+ messages in thread
From: kernel test robot @ 2025-08-22  6:22 UTC (permalink / raw)
  To: Jeff Layton, Trond Myklebust, Anna Schumaker, Chuck Lever,
	NeilBrown, Olga Kornievskaia, Dai Ngo, Tom Talpey,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Simon Horman
  Cc: oe-kbuild-all, netdev, linux-nfs, linux-kernel, Jeff Layton

Hi Jeff,

kernel test robot noticed the following build errors:

[auto build test ERROR on 80a1bea0cd81de70c56b37a8292c23d57419776f]

url:    https://github.com/intel-lab-lkp/linux/commits/Jeff-Layton/sunrpc-remove-dfprintk_cont-and-dfprintk_rcu_cont/20250822-011902
base:   80a1bea0cd81de70c56b37a8292c23d57419776f
patch link:    https://lore.kernel.org/r/20250821-nfs-testing-v1-2-f06099963eda%40kernel.org
patch subject: [PATCH 2/2] sunrpc: add a Kconfig option to redirect dfprintk() output to trace buffer
config: parisc-randconfig-001-20250822 (https://download.01.org/0day-ci/archive/20250822/202508221433.vcMr9C38-lkp@intel.com/config)
compiler: hppa-linux-gcc (GCC) 9.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250822/202508221433.vcMr9C38-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/202508221433.vcMr9C38-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from include/linux/sunrpc/types.h:16,
                    from include/linux/sunrpc/sched.h:15,
                    from include/linux/sunrpc/clnt.h:20,
                    from fs/nfs/proc.c:39:
   fs/nfs/proc.c: In function 'nfs_proc_get_root':
>> include/linux/sunrpc/debug.h:36:37: error: implicit declaration of function 'pr_default'; did you mean 'pr_devel'? [-Werror=implicit-function-declaration]
      36 | #  define __sunrpc_printk(fmt, ...) pr_default(fmt, ##__VA_ARGS__)
         |                                     ^~~~~~~~~~
   include/linux/sunrpc/debug.h:42:3: note: in expansion of macro '__sunrpc_printk'
      42 |   __sunrpc_printk(fmt, ##__VA_ARGS__);   \
         |   ^~~~~~~~~~~~~~~
   include/linux/sunrpc/debug.h:25:2: note: in expansion of macro 'dfprintk'
      25 |  dfprintk(FACILITY, fmt, ##__VA_ARGS__)
         |  ^~~~~~~~
   fs/nfs/proc.c:66:2: note: in expansion of macro 'dprintk'
      66 |  dprintk("%s: call getattr\n", __func__);
         |  ^~~~~~~
   cc1: some warnings being treated as errors
--
   In file included from include/linux/sunrpc/types.h:16,
                    from include/linux/sunrpc/sched.h:15,
                    from include/linux/sunrpc/clnt.h:20,
                    from fs/nfs/nfs2xdr.c:21:
   fs/nfs/nfs2xdr.c: In function 'decode_nfsdata':
>> include/linux/sunrpc/debug.h:36:37: error: implicit declaration of function 'pr_default'; did you mean 'pr_devel'? [-Werror=implicit-function-declaration]
      36 | #  define __sunrpc_printk(fmt, ...) pr_default(fmt, ##__VA_ARGS__)
         |                                     ^~~~~~~~~~
   include/linux/sunrpc/debug.h:42:3: note: in expansion of macro '__sunrpc_printk'
      42 |   __sunrpc_printk(fmt, ##__VA_ARGS__);   \
         |   ^~~~~~~~~~~~~~~
   include/linux/sunrpc/debug.h:25:2: note: in expansion of macro 'dfprintk'
      25 |  dfprintk(FACILITY, fmt, ##__VA_ARGS__)
         |  ^~~~~~~~
   fs/nfs/nfs2xdr.c:110:2: note: in expansion of macro 'dprintk'
     110 |  dprintk("NFS: server cheating in read result: "
         |  ^~~~~~~
   cc1: some warnings being treated as errors
--
   In file included from include/linux/sunrpc/types.h:16,
                    from include/linux/sunrpc/sched.h:15,
                    from fs/nfs/unlink.c:12:
   fs/nfs/unlink.c: In function 'nfs_sillyrename':
>> include/linux/sunrpc/debug.h:36:37: error: implicit declaration of function 'pr_default'; did you mean 'pr_devel'? [-Werror=implicit-function-declaration]
      36 | #  define __sunrpc_printk(fmt, ...) pr_default(fmt, ##__VA_ARGS__)
         |                                     ^~~~~~~~~~
   include/linux/sunrpc/debug.h:42:3: note: in expansion of macro '__sunrpc_printk'
      42 |   __sunrpc_printk(fmt, ##__VA_ARGS__);   \
         |   ^~~~~~~~~~~~~~~
   fs/nfs/unlink.c:453:2: note: in expansion of macro 'dfprintk'
     453 |  dfprintk(VFS, "NFS: silly-rename(%pd2, ct=%d)\n",
         |  ^~~~~~~~
   cc1: some warnings being treated as errors
--
   In file included from include/linux/nfs_fs.h:30,
                    from fs/nfs/direct.c:52:
   fs/nfs/direct.c: In function 'nfs_file_direct_read':
>> include/linux/sunrpc/debug.h:36:37: error: implicit declaration of function 'pr_default'; did you mean 'pr_devel'? [-Werror=implicit-function-declaration]
      36 | #  define __sunrpc_printk(fmt, ...) pr_default(fmt, ##__VA_ARGS__)
         |                                     ^~~~~~~~~~
   include/linux/sunrpc/debug.h:42:3: note: in expansion of macro '__sunrpc_printk'
      42 |   __sunrpc_printk(fmt, ##__VA_ARGS__);   \
         |   ^~~~~~~~~~~~~~~
   fs/nfs/direct.c:444:2: note: in expansion of macro 'dfprintk'
     444 |  dfprintk(FILE, "NFS: direct read(%pD2, %zd@%Ld)\n",
         |  ^~~~~~~~
   cc1: some warnings being treated as errors
--
   In file included from include/linux/sunrpc/types.h:16,
                    from include/linux/sunrpc/sched.h:15,
                    from include/linux/sunrpc/auth.h:13,
                    from include/linux/nfs.h:12,
                    from fs/nfs/export.c:9:
   fs/nfs/export.c: In function 'nfs_encode_fh':
>> include/linux/sunrpc/debug.h:36:37: error: implicit declaration of function 'pr_default'; did you mean 'pr_devel'? [-Werror=implicit-function-declaration]
      36 | #  define __sunrpc_printk(fmt, ...) pr_default(fmt, ##__VA_ARGS__)
         |                                     ^~~~~~~~~~
   include/linux/sunrpc/debug.h:42:3: note: in expansion of macro '__sunrpc_printk'
      42 |   __sunrpc_printk(fmt, ##__VA_ARGS__);   \
         |   ^~~~~~~~~~~~~~~
   include/linux/sunrpc/debug.h:25:2: note: in expansion of macro 'dfprintk'
      25 |  dfprintk(FACILITY, fmt, ##__VA_ARGS__)
         |  ^~~~~~~~
   fs/nfs/export.c:42:2: note: in expansion of macro 'dprintk'
      42 |  dprintk("%s: max fh len %d inode %p parent %p",
         |  ^~~~~~~
   cc1: some warnings being treated as errors
--
   In file included from include/linux/sunrpc/types.h:16,
                    from include/linux/sunrpc/sched.h:15,
                    from include/linux/sunrpc/clnt.h:20,
                    from fs/nfs/super.c:34:
   fs/nfs/super.c: In function 'nfs_statfs':
>> include/linux/sunrpc/debug.h:36:37: error: implicit declaration of function 'pr_default'; did you mean 'pr_devel'? [-Werror=implicit-function-declaration]
      36 | #  define __sunrpc_printk(fmt, ...) pr_default(fmt, ##__VA_ARGS__)
         |                                     ^~~~~~~~~~
   include/linux/sunrpc/debug.h:42:3: note: in expansion of macro '__sunrpc_printk'
      42 |   __sunrpc_printk(fmt, ##__VA_ARGS__);   \
         |   ^~~~~~~~~~~~~~~
   include/linux/sunrpc/debug.h:25:2: note: in expansion of macro 'dfprintk'
      25 |  dfprintk(FACILITY, fmt, ##__VA_ARGS__)
         |  ^~~~~~~~
   fs/nfs/super.c:310:2: note: in expansion of macro 'dprintk'
     310 |  dprintk("%s: statfs error = %d\n", __func__, -error);
         |  ^~~~~~~
   cc1: some warnings being treated as errors
--
   In file included from include/linux/sunrpc/types.h:16,
                    from include/linux/sunrpc/sched.h:15,
                    from include/linux/sunrpc/clnt.h:20,
                    from fs/nfs/inode.c:27:
   fs/nfs/inode.c: In function 'nfs_ilookup':
>> include/linux/sunrpc/debug.h:36:37: error: implicit declaration of function 'pr_default'; did you mean 'pr_devel'? [-Werror=implicit-function-declaration]
      36 | #  define __sunrpc_printk(fmt, ...) pr_default(fmt, ##__VA_ARGS__)
         |                                     ^~~~~~~~~~
   include/linux/sunrpc/debug.h:42:3: note: in expansion of macro '__sunrpc_printk'
      42 |   __sunrpc_printk(fmt, ##__VA_ARGS__);   \
         |   ^~~~~~~~~~~~~~~
   include/linux/sunrpc/debug.h:25:2: note: in expansion of macro 'dfprintk'
      25 |  dfprintk(FACILITY, fmt, ##__VA_ARGS__)
         |  ^~~~~~~~
   fs/nfs/inode.c:425:2: note: in expansion of macro 'dprintk'
     425 |  dprintk("%s: returning %p\n", __func__, inode);
         |  ^~~~~~~
   cc1: some warnings being treated as errors
--
   In file included from include/linux/sunrpc/types.h:16,
                    from include/linux/sunrpc/sched.h:15,
                    from include/linux/sunrpc/clnt.h:20,
                    from fs/nfs/mount_clnt.c:15:
   fs/nfs/mount_clnt.c: In function 'nfs_mount':
>> include/linux/sunrpc/debug.h:36:37: error: implicit declaration of function 'pr_default'; did you mean 'pr_devel'? [-Werror=implicit-function-declaration]
      36 | #  define __sunrpc_printk(fmt, ...) pr_default(fmt, ##__VA_ARGS__)
         |                                     ^~~~~~~~~~
   include/linux/sunrpc/debug.h:42:3: note: in expansion of macro '__sunrpc_printk'
      42 |   __sunrpc_printk(fmt, ##__VA_ARGS__);   \
         |   ^~~~~~~~~~~~~~~
   include/linux/sunrpc/debug.h:25:2: note: in expansion of macro 'dfprintk'
      25 |  dfprintk(FACILITY, fmt, ##__VA_ARGS__)
         |  ^~~~~~~~
   fs/nfs/mount_clnt.c:168:2: note: in expansion of macro 'dprintk'
     168 |  dprintk("NFS: sending MNT request for %s:%s\n",
         |  ^~~~~~~
   cc1: some warnings being treated as errors
--
   In file included from include/linux/nfs_fs.h:30,
                    from fs/nfs/fs_context.c:18:
   fs/nfs/fs_context.c: In function 'nfs_validate_transport_protocol':
>> include/linux/sunrpc/debug.h:36:37: error: implicit declaration of function 'pr_default'; did you mean 'pr_devel'? [-Werror=implicit-function-declaration]
      36 | #  define __sunrpc_printk(fmt, ...) pr_default(fmt, ##__VA_ARGS__)
         |                                     ^~~~~~~~~~
   include/linux/sunrpc/debug.h:42:3: note: in expansion of macro '__sunrpc_printk'
      42 |   __sunrpc_printk(fmt, ##__VA_ARGS__);   \
         |   ^~~~~~~~~~~~~~~
   include/linux/sunrpc/debug.h:25:2: note: in expansion of macro 'dfprintk'
      25 |  dfprintk(FACILITY, fmt, ##__VA_ARGS__)
         |  ^~~~~~~~
   fs/nfs/internal.h:175:5: note: in expansion of macro 'dprintk'
     175 |  ({ dprintk(fmt "\n", ## __VA_ARGS__);  -EINVAL; }))
         |     ^~~~~~~
   fs/nfs/fs_context.c:388:9: note: in expansion of macro 'nfs_invalf'
     388 |  return nfs_invalf(fc, "NFS: Unsupported transport protocol udp");
         |         ^~~~~~~~~~
   cc1: some warnings being treated as errors
--
   In file included from include/linux/nfs_fs.h:30,
                    from fs/nfs/file.c:26:
   fs/nfs/file.c: In function 'nfs_file_open':
>> include/linux/sunrpc/debug.h:36:37: error: implicit declaration of function 'pr_default'; did you mean 'pr_devel'? [-Werror=implicit-function-declaration]
      36 | #  define __sunrpc_printk(fmt, ...) pr_default(fmt, ##__VA_ARGS__)
         |                                     ^~~~~~~~~~
   include/linux/sunrpc/debug.h:42:3: note: in expansion of macro '__sunrpc_printk'
      42 |   __sunrpc_printk(fmt, ##__VA_ARGS__);   \
         |   ^~~~~~~~~~~~~~~
   include/linux/sunrpc/debug.h:25:2: note: in expansion of macro 'dfprintk'
      25 |  dfprintk(FACILITY, fmt, ##__VA_ARGS__)
         |  ^~~~~~~~
   fs/nfs/file.c:66:2: note: in expansion of macro 'dprintk'
      66 |  dprintk("NFS: open file(%pD2)\n", filp);
         |  ^~~~~~~
   cc1: some warnings being treated as errors
--
   In file included from include/linux/sunrpc/types.h:16,
                    from include/linux/sunrpc/sched.h:15,
                    from include/linux/sunrpc/clnt.h:20,
                    from fs/nfs/write.c:19:
   fs/nfs/write.c: In function 'nfs_update_folio':
>> include/linux/sunrpc/debug.h:36:37: error: implicit declaration of function 'pr_default'; did you mean 'pr_devel'? [-Werror=implicit-function-declaration]
      36 | #  define __sunrpc_printk(fmt, ...) pr_default(fmt, ##__VA_ARGS__)
         |                                     ^~~~~~~~~~
   include/linux/sunrpc/debug.h:42:3: note: in expansion of macro '__sunrpc_printk'
      42 |   __sunrpc_printk(fmt, ##__VA_ARGS__);   \
         |   ^~~~~~~~~~~~~~~
   include/linux/sunrpc/debug.h:25:2: note: in expansion of macro 'dfprintk'
      25 |  dfprintk(FACILITY, fmt, ##__VA_ARGS__)
         |  ^~~~~~~~
   fs/nfs/write.c:1348:2: note: in expansion of macro 'dprintk'
    1348 |  dprintk("NFS:       nfs_update_folio(%pD2 %d@%lld)\n", file, count,
         |  ^~~~~~~
   cc1: some warnings being treated as errors
..


vim +36 include/linux/sunrpc/debug.h

    32	
    33	# if IS_ENABLED(CONFIG_SUNRPC_DEBUG_TRACE)
    34	#  define __sunrpc_printk(fmt, ...)	trace_printk(fmt, ##__VA_ARGS__)
    35	# else
  > 36	#  define __sunrpc_printk(fmt, ...)	pr_default(fmt, ##__VA_ARGS__)
    37	# endif
    38	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-08-22  6:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-21 17:16 [PATCH 0/2] sunrpc: allow dprintk() to go to the trace buffer instead of console Jeff Layton
2025-08-21 17:16 ` [PATCH 1/2] sunrpc: remove dfprintk_cont() and dfprintk_rcu_cont() Jeff Layton
2025-08-21 17:16 ` [PATCH 2/2] sunrpc: add a Kconfig option to redirect dfprintk() output to trace buffer Jeff Layton
2025-08-21 19:44   ` Anna Schumaker
2025-08-21 19:51     ` Jeff Layton
2025-08-21 21:02       ` Anna Schumaker
2025-08-22  6:22   ` kernel test robot

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).