[for-next,06/13] NFSD: Fix nfsd_clid_class use of __string_len() macro

Message ID 20240223141902.394601874@goodmis.org
State New
Headers
Series tracing: Updates for 6.9 |

Commit Message

Steven Rostedt Feb. 23, 2024, 2:18 p.m. UTC
  From: "Steven Rostedt (Google)" <rostedt@goodmis.org>

I'm working on restructuring the __string* macros so that it doesn't need
to recalculate the string twice. That is, it will save it off when
processing __string() and the __assign_str() will not need to do the work
again as it currently does.

Currently __string_len(item, src, len) doesn't actually use "src", but my
changes will require src to be correct as that is where the __assign_str()
will get its value from.

The event class nfsd_clid_class has:

  __string_len(name, name, clp->cl_name.len)

But the second "name" does not exist and causes my changes to fail to
build. That second parameter should be: clp->cl_name.data.

Link: https://lore.kernel.org/linux-trace-kernel/20240222122828.3d8d213c@gandalf.local.home

Cc: Jeff Layton <jlayton@kernel.org>
Cc: Neil Brown <neilb@suse.de>
Cc: Olga Kornievskaia <kolga@netapp.com>
Cc: Dai Ngo <Dai.Ngo@oracle.com>
Cc: Tom Talpey <tom@talpey.com>
Fixes: d27b74a8675ca ("NFSD: Use new __string_len C macros for nfsd_clid_class")
Acked-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
 fs/nfsd/trace.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Jeff Layton Feb. 23, 2024, 2:36 p.m. UTC | #1
On Fri, 2024-02-23 at 09:18 -0500, Steven Rostedt wrote:
> From: "Steven Rostedt (Google)" <rostedt@goodmis.org>
> 
> I'm working on restructuring the __string* macros so that it doesn't need
> to recalculate the string twice. That is, it will save it off when
> processing __string() and the __assign_str() will not need to do the work
> again as it currently does.
> 
> Currently __string_len(item, src, len) doesn't actually use "src", but my
> changes will require src to be correct as that is where the __assign_str()
> will get its value from.
> 
> The event class nfsd_clid_class has:
> 
>   __string_len(name, name, clp->cl_name.len)
> 
> But the second "name" does not exist and causes my changes to fail to
> build. That second parameter should be: clp->cl_name.data.
> 
> Link: https://lore.kernel.org/linux-trace-kernel/20240222122828.3d8d213c@gandalf.local.home
> 
> Cc: Jeff Layton <jlayton@kernel.org>
> Cc: Neil Brown <neilb@suse.de>
> Cc: Olga Kornievskaia <kolga@netapp.com>
> Cc: Dai Ngo <Dai.Ngo@oracle.com>
> Cc: Tom Talpey <tom@talpey.com>
> Fixes: d27b74a8675ca ("NFSD: Use new __string_len C macros for nfsd_clid_class")
> Acked-by: Chuck Lever <chuck.lever@oracle.com>
> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
> ---
>  fs/nfsd/trace.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/nfsd/trace.h b/fs/nfsd/trace.h
> index d1e8cf079b0f..2cd57033791f 100644
> --- a/fs/nfsd/trace.h
> +++ b/fs/nfsd/trace.h
> @@ -843,7 +843,7 @@ DECLARE_EVENT_CLASS(nfsd_clid_class,
>  		__array(unsigned char, addr, sizeof(struct sockaddr_in6))
>  		__field(unsigned long, flavor)
>  		__array(unsigned char, verifier, NFS4_VERIFIER_SIZE)
> -		__string_len(name, name, clp->cl_name.len)
> +		__string_len(name, clp->cl_name.data, clp->cl_name.len)
>  	),
>  	TP_fast_assign(
>  		__entry->cl_boot = clp->cl_clientid.cl_boot;

Acked-by: Jeff Layton <jlayton@kernel.org>
  
Steven Rostedt Feb. 23, 2024, 3:14 p.m. UTC | #2
On Fri, 23 Feb 2024 09:36:14 -0500
Jeff Layton <jlayton@kernel.org> wrote:

> On Fri, 2024-02-23 at 09:18 -0500, Steven Rostedt wrote:
> > From: "Steven Rostedt (Google)" <rostedt@goodmis.org>
> > 
> > I'm working on restructuring the __string* macros so that it doesn't need
> > to recalculate the string twice. That is, it will save it off when
> > processing __string() and the __assign_str() will not need to do the work
> > again as it currently does.
> > 
> > Currently __string_len(item, src, len) doesn't actually use "src", but my
> > changes will require src to be correct as that is where the __assign_str()
> > will get its value from.
> > 
> > The event class nfsd_clid_class has:
> > 
> >   __string_len(name, name, clp->cl_name.len)
> > 
> > But the second "name" does not exist and causes my changes to fail to
> > build. That second parameter should be: clp->cl_name.data.
> > 
> > Link: https://lore.kernel.org/linux-trace-kernel/20240222122828.3d8d213c@gandalf.local.home
> > 

> 
> Acked-by: Jeff Layton <jlayton@kernel.org>

Thanks!

-- Steve
  

Patch

diff --git a/fs/nfsd/trace.h b/fs/nfsd/trace.h
index d1e8cf079b0f..2cd57033791f 100644
--- a/fs/nfsd/trace.h
+++ b/fs/nfsd/trace.h
@@ -843,7 +843,7 @@  DECLARE_EVENT_CLASS(nfsd_clid_class,
 		__array(unsigned char, addr, sizeof(struct sockaddr_in6))
 		__field(unsigned long, flavor)
 		__array(unsigned char, verifier, NFS4_VERIFIER_SIZE)
-		__string_len(name, name, clp->cl_name.len)
+		__string_len(name, clp->cl_name.data, clp->cl_name.len)
 	),
 	TP_fast_assign(
 		__entry->cl_boot = clp->cl_clientid.cl_boot;