diff mbox series

[3/7] NFSv4.2 add tracepoint to COPY

Message ID 20211018220314.85115-4-olga.kornievskaia@gmail.com (mailing list archive)
State New, archived
Headers show
Series NFSv4.2 add tracepoints to sparse files and copy | expand

Commit Message

Olga Kornievskaia Oct. 18, 2021, 10:03 p.m. UTC
From: Olga Kornievskaia <kolga@netapp.com>

Add a tracepoint to the COPY operation.

Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
---
 fs/nfs/nfs42proc.c |   1 +
 fs/nfs/nfs4trace.h | 101 +++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 102 insertions(+)

Comments

Chuck Lever Oct. 19, 2021, 3:31 p.m. UTC | #1
> On Oct 18, 2021, at 6:03 PM, Olga Kornievskaia <olga.kornievskaia@gmail.com> wrote:
> 
> From: Olga Kornievskaia <kolga@netapp.com>
> 
> Add a tracepoint to the COPY operation.
> 
> Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
> ---
> fs/nfs/nfs42proc.c |   1 +
> fs/nfs/nfs4trace.h | 101 +++++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 102 insertions(+)
> 
> diff --git a/fs/nfs/nfs42proc.c b/fs/nfs/nfs42proc.c
> index c36824888601..a072cdaf7bdc 100644
> --- a/fs/nfs/nfs42proc.c
> +++ b/fs/nfs/nfs42proc.c
> @@ -367,6 +367,7 @@ static ssize_t _nfs42_proc_copy(struct file *src,
> 
> 	status = nfs4_call_sync(dst_server->client, dst_server, &msg,
> 				&args->seq_args, &res->seq_res, 0);
> +	trace_nfs4_copy(src_inode, dst_inode, args, res, nss, status);

There seems to be a lot of logic in _nfs42_proc_copy() that
happens after this tracepoint. Are you sure this is the
best placement, or do you want to capture failures that
might happen in the subsequent logic?


> 	if (status == -ENOTSUPP)
> 		dst_server->caps &= ~NFS_CAP_COPY;
> 	if (status)
> diff --git a/fs/nfs/nfs4trace.h b/fs/nfs/nfs4trace.h
> index ba338ee4a82b..4beb59d78ff3 100644
> --- a/fs/nfs/nfs4trace.h
> +++ b/fs/nfs/nfs4trace.h
> @@ -2540,6 +2540,107 @@ DECLARE_EVENT_CLASS(nfs4_sparse_event,
> DEFINE_NFS4_SPARSE_EVENT(nfs4_fallocate);
> DEFINE_NFS4_SPARSE_EVENT(nfs4_deallocate);
> 
> +TRACE_EVENT(nfs4_copy,
> +		TP_PROTO(
> +			const struct inode *src_inode,
> +			const struct inode *dst_inode,
> +			const struct nfs42_copy_args *args,
> +			const struct nfs42_copy_res *res,
> +			const struct nl4_server *nss,
> +			int error
> +		),
> +
> +		TP_ARGS(src_inode, dst_inode, args, res, nss, error),
> +
> +		TP_STRUCT__entry(
> +			__field(unsigned long, error)
> +			__field(u32, src_fhandle)
> +			__field(u32, src_fileid)
> +			__field(u32, dst_fhandle)
> +			__field(u32, dst_fileid)
> +			__field(dev_t, src_dev)
> +			__field(dev_t, dst_dev)
> +			__field(int, src_stateid_seq)
> +			__field(u32, src_stateid_hash)
> +			__field(int, dst_stateid_seq)
> +			__field(u32, dst_stateid_hash)
> +			__field(loff_t, src_offset)
> +			__field(loff_t, dst_offset)
> +			__field(bool, sync)
> +			__field(loff_t, len)
> +			__field(int, res_stateid_seq)
> +			__field(u32, res_stateid_hash)
> +			__field(loff_t, res_count)
> +			__field(bool, res_sync)
> +			__field(bool, res_cons)
> +			__field(bool, intra)
> +		),
> +
> +		TP_fast_assign(
> +			const struct nfs_inode *src_nfsi = NFS_I(src_inode);
> +			const struct nfs_inode *dst_nfsi = NFS_I(dst_inode);
> +
> +			__entry->src_fileid = src_nfsi->fileid;
> +			__entry->src_dev = src_inode->i_sb->s_dev;
> +			__entry->src_fhandle = nfs_fhandle_hash(args->src_fh);
> +			__entry->src_offset = args->src_pos;
> +			__entry->dst_fileid = dst_nfsi->fileid;
> +			__entry->dst_dev = dst_inode->i_sb->s_dev;
> +			__entry->dst_fhandle = nfs_fhandle_hash(args->dst_fh);
> +			__entry->dst_offset = args->dst_pos;
> +			__entry->len = args->count;
> +			__entry->sync = args->sync;
> +			__entry->error = error < 0 ? -error : 0;
> +			__entry->src_stateid_seq =
> +				be32_to_cpu(args->src_stateid.seqid);
> +			__entry->src_stateid_hash =
> +				nfs_stateid_hash(&args->src_stateid);
> +			__entry->dst_stateid_seq =
> +				be32_to_cpu(args->dst_stateid.seqid);
> +			__entry->dst_stateid_hash =
> +				nfs_stateid_hash(&args->dst_stateid);
> +			__entry->res_stateid_seq = error < 0 ? 0 :
> +				be32_to_cpu(res->write_res.stateid.seqid);
> +			__entry->res_stateid_hash = error < 0 ? 0 :
> +				nfs_stateid_hash(&res->write_res.stateid);
> +			__entry->res_count = error < 0 ? 0 :
> +				res->write_res.count;
> +			__entry->res_sync = error < 0 ? 0 :
> +				res->synchronous;
> +			__entry->res_cons = error < 0 ? 0 :
> +				res->consecutive;
> +			__entry->intra = nss ? 0 : 1;
> +		),

I have some general comments about the ternaries here
and in some of the other patches.

At the very least you should instead have a single check:

	if (error) {
		/* record all the error values */
	} else {
		/* record zeroes */
	}

Although, I recommend a different approach entirely,
and that is to to have /two/ trace points: one for
the success case and one for the error case. That
way the error case can be enabled persistently, as
appropriate, and the success case can be used for
general debugging, which ought to be rare once the
code is working well and we have good error reporting
in user space.

In some instances (maybe not here in copy), the
success tracepoint is completely unnecessary for
everyday operation and can be omitted.

What's your thought about that?


> +
> +		TP_printk(
> +			"error=%ld (%s) intra=%d src_fileid=%02x:%02x:%llu "
> +			"src_fhandle=0x%08x dst_fileid=%02x:%02x:%llu "
> +			"dst_fhandle=0x%08x src_stateid=%d:0x%08x "
> +			"dst_stateid=%d:0x%08x src_offset=%llu dst_offset=%llu "
> +			"len=%llu sync=%d cb_stateid=%d:0x%08x res_sync=%d "
> +			"res_cons=%d res_count=%llu",
> +			-__entry->error,
> +			show_nfsv4_errors(__entry->error),
> +			__entry->intra,
> +			MAJOR(__entry->src_dev), MINOR(__entry->src_dev),
> +			(unsigned long long)__entry->src_fileid,
> +			__entry->src_fhandle,
> +			MAJOR(__entry->dst_dev), MINOR(__entry->dst_dev),
> +			(unsigned long long)__entry->dst_fileid,
> +			__entry->dst_fhandle,
> +			__entry->src_stateid_seq, __entry->src_stateid_hash,
> +			__entry->dst_stateid_seq, __entry->dst_stateid_hash,
> +			__entry->src_offset,
> +			__entry->dst_offset,
> +			__entry->len,
> +			__entry->sync,
> +			__entry->res_stateid_seq, __entry->res_stateid_hash,
> +			__entry->res_sync,
> +			__entry->res_cons,
> +			__entry->res_count
> +		)
> +);
> +
> #endif /* CONFIG_NFS_V4_1 */
> 
> #endif /* _TRACE_NFS4_H */
> -- 
> 2.27.0
> 

--
Chuck Lever
Olga Kornievskaia Oct. 19, 2021, 3:51 p.m. UTC | #2
On Tue, Oct 19, 2021 at 11:31 AM Chuck Lever III <chuck.lever@oracle.com> wrote:
>
>
>
> > On Oct 18, 2021, at 6:03 PM, Olga Kornievskaia <olga.kornievskaia@gmail.com> wrote:
> >
> > From: Olga Kornievskaia <kolga@netapp.com>
> >
> > Add a tracepoint to the COPY operation.
> >
> > Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
> > ---
> > fs/nfs/nfs42proc.c |   1 +
> > fs/nfs/nfs4trace.h | 101 +++++++++++++++++++++++++++++++++++++++++++++
> > 2 files changed, 102 insertions(+)
> >
> > diff --git a/fs/nfs/nfs42proc.c b/fs/nfs/nfs42proc.c
> > index c36824888601..a072cdaf7bdc 100644
> > --- a/fs/nfs/nfs42proc.c
> > +++ b/fs/nfs/nfs42proc.c
> > @@ -367,6 +367,7 @@ static ssize_t _nfs42_proc_copy(struct file *src,
> >
> >       status = nfs4_call_sync(dst_server->client, dst_server, &msg,
> >                               &args->seq_args, &res->seq_res, 0);
> > +     trace_nfs4_copy(src_inode, dst_inode, args, res, nss, status);
>
> There seems to be a lot of logic in _nfs42_proc_copy() that
> happens after this tracepoint. Are you sure this is the
> best placement, or do you want to capture failures that
> might happen in the subsequent logic?

I do believe this is the right place for the COPY tracepoint. There
are 3 more logical decisions after that. (1) dealing with synchronous
copy with an incorrect verifier -- perhaps that warrants a separate
tracepoints as a generic COPY doesn't capture verifier information at
all, (2) deals with completion of async copy but for that we have a
tracepoint in the callback, and (3) handling commit after copy but
that has a commit tracepoint in the COMMIT operation.

> >       if (status == -ENOTSUPP)
> >               dst_server->caps &= ~NFS_CAP_COPY;
> >       if (status)
> > diff --git a/fs/nfs/nfs4trace.h b/fs/nfs/nfs4trace.h
> > index ba338ee4a82b..4beb59d78ff3 100644
> > --- a/fs/nfs/nfs4trace.h
> > +++ b/fs/nfs/nfs4trace.h
> > @@ -2540,6 +2540,107 @@ DECLARE_EVENT_CLASS(nfs4_sparse_event,
> > DEFINE_NFS4_SPARSE_EVENT(nfs4_fallocate);
> > DEFINE_NFS4_SPARSE_EVENT(nfs4_deallocate);
> >
> > +TRACE_EVENT(nfs4_copy,
> > +             TP_PROTO(
> > +                     const struct inode *src_inode,
> > +                     const struct inode *dst_inode,
> > +                     const struct nfs42_copy_args *args,
> > +                     const struct nfs42_copy_res *res,
> > +                     const struct nl4_server *nss,
> > +                     int error
> > +             ),
> > +
> > +             TP_ARGS(src_inode, dst_inode, args, res, nss, error),
> > +
> > +             TP_STRUCT__entry(
> > +                     __field(unsigned long, error)
> > +                     __field(u32, src_fhandle)
> > +                     __field(u32, src_fileid)
> > +                     __field(u32, dst_fhandle)
> > +                     __field(u32, dst_fileid)
> > +                     __field(dev_t, src_dev)
> > +                     __field(dev_t, dst_dev)
> > +                     __field(int, src_stateid_seq)
> > +                     __field(u32, src_stateid_hash)
> > +                     __field(int, dst_stateid_seq)
> > +                     __field(u32, dst_stateid_hash)
> > +                     __field(loff_t, src_offset)
> > +                     __field(loff_t, dst_offset)
> > +                     __field(bool, sync)
> > +                     __field(loff_t, len)
> > +                     __field(int, res_stateid_seq)
> > +                     __field(u32, res_stateid_hash)
> > +                     __field(loff_t, res_count)
> > +                     __field(bool, res_sync)
> > +                     __field(bool, res_cons)
> > +                     __field(bool, intra)
> > +             ),
> > +
> > +             TP_fast_assign(
> > +                     const struct nfs_inode *src_nfsi = NFS_I(src_inode);
> > +                     const struct nfs_inode *dst_nfsi = NFS_I(dst_inode);
> > +
> > +                     __entry->src_fileid = src_nfsi->fileid;
> > +                     __entry->src_dev = src_inode->i_sb->s_dev;
> > +                     __entry->src_fhandle = nfs_fhandle_hash(args->src_fh);
> > +                     __entry->src_offset = args->src_pos;
> > +                     __entry->dst_fileid = dst_nfsi->fileid;
> > +                     __entry->dst_dev = dst_inode->i_sb->s_dev;
> > +                     __entry->dst_fhandle = nfs_fhandle_hash(args->dst_fh);
> > +                     __entry->dst_offset = args->dst_pos;
> > +                     __entry->len = args->count;
> > +                     __entry->sync = args->sync;
> > +                     __entry->error = error < 0 ? -error : 0;
> > +                     __entry->src_stateid_seq =
> > +                             be32_to_cpu(args->src_stateid.seqid);
> > +                     __entry->src_stateid_hash =
> > +                             nfs_stateid_hash(&args->src_stateid);
> > +                     __entry->dst_stateid_seq =
> > +                             be32_to_cpu(args->dst_stateid.seqid);
> > +                     __entry->dst_stateid_hash =
> > +                             nfs_stateid_hash(&args->dst_stateid);
> > +                     __entry->res_stateid_seq = error < 0 ? 0 :
> > +                             be32_to_cpu(res->write_res.stateid.seqid);
> > +                     __entry->res_stateid_hash = error < 0 ? 0 :
> > +                             nfs_stateid_hash(&res->write_res.stateid);
> > +                     __entry->res_count = error < 0 ? 0 :
> > +                             res->write_res.count;
> > +                     __entry->res_sync = error < 0 ? 0 :
> > +                             res->synchronous;
> > +                     __entry->res_cons = error < 0 ? 0 :
> > +                             res->consecutive;
> > +                     __entry->intra = nss ? 0 : 1;
> > +             ),
>
> I have some general comments about the ternaries here
> and in some of the other patches.
>
> At the very least you should instead have a single check:
>
>         if (error) {
>                 /* record all the error values */
>         } else {
>                 /* record zeroes */
>         }
>
> Although, I recommend a different approach entirely,
> and that is to to have /two/ trace points: one for
> the success case and one for the error case. That
> way the error case can be enabled persistently, as
> appropriate, and the success case can be used for
> general debugging, which ought to be rare once the
> code is working well and we have good error reporting
> in user space.

I think I see what you are saying with having something like (in
nfs42proc.c in copy)
nfs4_call_sync()
if (status)
  trace_nfs4_copy_err()
else
  trace_nfs4_copy()

That would replace my checking for error and setting the field. I can
do that. But I'm not sure how to handle sharing of "call" arguments
that we'd want to display for both the error case tracepoint and
non-error case. If I'm missing an approach on how to can you please
share, or otherwise, in my revision I'd re-write using if (error)
approach and keep just a single tracepoint.

> In some instances (maybe not here in copy), the
> success tracepoint is completely unnecessary for
> everyday operation and can be omitted.
>
> What's your thought about that?
>
>
> > +
> > +             TP_printk(
> > +                     "error=%ld (%s) intra=%d src_fileid=%02x:%02x:%llu "
> > +                     "src_fhandle=0x%08x dst_fileid=%02x:%02x:%llu "
> > +                     "dst_fhandle=0x%08x src_stateid=%d:0x%08x "
> > +                     "dst_stateid=%d:0x%08x src_offset=%llu dst_offset=%llu "
> > +                     "len=%llu sync=%d cb_stateid=%d:0x%08x res_sync=%d "
> > +                     "res_cons=%d res_count=%llu",
> > +                     -__entry->error,
> > +                     show_nfsv4_errors(__entry->error),
> > +                     __entry->intra,
> > +                     MAJOR(__entry->src_dev), MINOR(__entry->src_dev),
> > +                     (unsigned long long)__entry->src_fileid,
> > +                     __entry->src_fhandle,
> > +                     MAJOR(__entry->dst_dev), MINOR(__entry->dst_dev),
> > +                     (unsigned long long)__entry->dst_fileid,
> > +                     __entry->dst_fhandle,
> > +                     __entry->src_stateid_seq, __entry->src_stateid_hash,
> > +                     __entry->dst_stateid_seq, __entry->dst_stateid_hash,
> > +                     __entry->src_offset,
> > +                     __entry->dst_offset,
> > +                     __entry->len,
> > +                     __entry->sync,
> > +                     __entry->res_stateid_seq, __entry->res_stateid_hash,
> > +                     __entry->res_sync,
> > +                     __entry->res_cons,
> > +                     __entry->res_count
> > +             )
> > +);
> > +
> > #endif /* CONFIG_NFS_V4_1 */
> >
> > #endif /* _TRACE_NFS4_H */
> > --
> > 2.27.0
> >
>
> --
> Chuck Lever
>
>
>
Chuck Lever Oct. 19, 2021, 4:01 p.m. UTC | #3
> On Oct 19, 2021, at 11:51 AM, Olga Kornievskaia <olga.kornievskaia@gmail.com> wrote:
> 
> On Tue, Oct 19, 2021 at 11:31 AM Chuck Lever III <chuck.lever@oracle.com> wrote:
>> 
>> 
>> 
>>> On Oct 18, 2021, at 6:03 PM, Olga Kornievskaia <olga.kornievskaia@gmail.com> wrote:
>>> 
>>> From: Olga Kornievskaia <kolga@netapp.com>
>>> 
>>> Add a tracepoint to the COPY operation.
>>> 
>>> Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
>>> ---
>>> fs/nfs/nfs42proc.c |   1 +
>>> fs/nfs/nfs4trace.h | 101 +++++++++++++++++++++++++++++++++++++++++++++
>>> 2 files changed, 102 insertions(+)
>>> 
>>> diff --git a/fs/nfs/nfs42proc.c b/fs/nfs/nfs42proc.c
>>> index c36824888601..a072cdaf7bdc 100644
>>> --- a/fs/nfs/nfs42proc.c
>>> +++ b/fs/nfs/nfs42proc.c
>>> @@ -367,6 +367,7 @@ static ssize_t _nfs42_proc_copy(struct file *src,
>>> 
>>>      status = nfs4_call_sync(dst_server->client, dst_server, &msg,
>>>                              &args->seq_args, &res->seq_res, 0);
>>> +     trace_nfs4_copy(src_inode, dst_inode, args, res, nss, status);
>> 
>> There seems to be a lot of logic in _nfs42_proc_copy() that
>> happens after this tracepoint. Are you sure this is the
>> best placement, or do you want to capture failures that
>> might happen in the subsequent logic?
> 
> I do believe this is the right place for the COPY tracepoint. There
> are 3 more logical decisions after that. (1) dealing with synchronous
> copy with an incorrect verifier -- perhaps that warrants a separate
> tracepoints as a generic COPY doesn't capture verifier information at
> all, (2) deals with completion of async copy but for that we have a
> tracepoint in the callback, and (3) handling commit after copy but
> that has a commit tracepoint in the COMMIT operation.
> 
>>>      if (status == -ENOTSUPP)
>>>              dst_server->caps &= ~NFS_CAP_COPY;
>>>      if (status)
>>> diff --git a/fs/nfs/nfs4trace.h b/fs/nfs/nfs4trace.h
>>> index ba338ee4a82b..4beb59d78ff3 100644
>>> --- a/fs/nfs/nfs4trace.h
>>> +++ b/fs/nfs/nfs4trace.h
>>> @@ -2540,6 +2540,107 @@ DECLARE_EVENT_CLASS(nfs4_sparse_event,
>>> DEFINE_NFS4_SPARSE_EVENT(nfs4_fallocate);
>>> DEFINE_NFS4_SPARSE_EVENT(nfs4_deallocate);
>>> 
>>> +TRACE_EVENT(nfs4_copy,
>>> +             TP_PROTO(
>>> +                     const struct inode *src_inode,
>>> +                     const struct inode *dst_inode,
>>> +                     const struct nfs42_copy_args *args,
>>> +                     const struct nfs42_copy_res *res,
>>> +                     const struct nl4_server *nss,
>>> +                     int error
>>> +             ),
>>> +
>>> +             TP_ARGS(src_inode, dst_inode, args, res, nss, error),
>>> +
>>> +             TP_STRUCT__entry(
>>> +                     __field(unsigned long, error)
>>> +                     __field(u32, src_fhandle)
>>> +                     __field(u32, src_fileid)
>>> +                     __field(u32, dst_fhandle)
>>> +                     __field(u32, dst_fileid)
>>> +                     __field(dev_t, src_dev)
>>> +                     __field(dev_t, dst_dev)
>>> +                     __field(int, src_stateid_seq)
>>> +                     __field(u32, src_stateid_hash)
>>> +                     __field(int, dst_stateid_seq)
>>> +                     __field(u32, dst_stateid_hash)
>>> +                     __field(loff_t, src_offset)
>>> +                     __field(loff_t, dst_offset)
>>> +                     __field(bool, sync)
>>> +                     __field(loff_t, len)
>>> +                     __field(int, res_stateid_seq)
>>> +                     __field(u32, res_stateid_hash)
>>> +                     __field(loff_t, res_count)
>>> +                     __field(bool, res_sync)
>>> +                     __field(bool, res_cons)
>>> +                     __field(bool, intra)
>>> +             ),
>>> +
>>> +             TP_fast_assign(
>>> +                     const struct nfs_inode *src_nfsi = NFS_I(src_inode);
>>> +                     const struct nfs_inode *dst_nfsi = NFS_I(dst_inode);
>>> +
>>> +                     __entry->src_fileid = src_nfsi->fileid;
>>> +                     __entry->src_dev = src_inode->i_sb->s_dev;
>>> +                     __entry->src_fhandle = nfs_fhandle_hash(args->src_fh);
>>> +                     __entry->src_offset = args->src_pos;
>>> +                     __entry->dst_fileid = dst_nfsi->fileid;
>>> +                     __entry->dst_dev = dst_inode->i_sb->s_dev;
>>> +                     __entry->dst_fhandle = nfs_fhandle_hash(args->dst_fh);
>>> +                     __entry->dst_offset = args->dst_pos;
>>> +                     __entry->len = args->count;
>>> +                     __entry->sync = args->sync;
>>> +                     __entry->error = error < 0 ? -error : 0;
>>> +                     __entry->src_stateid_seq =
>>> +                             be32_to_cpu(args->src_stateid.seqid);
>>> +                     __entry->src_stateid_hash =
>>> +                             nfs_stateid_hash(&args->src_stateid);
>>> +                     __entry->dst_stateid_seq =
>>> +                             be32_to_cpu(args->dst_stateid.seqid);
>>> +                     __entry->dst_stateid_hash =
>>> +                             nfs_stateid_hash(&args->dst_stateid);
>>> +                     __entry->res_stateid_seq = error < 0 ? 0 :
>>> +                             be32_to_cpu(res->write_res.stateid.seqid);
>>> +                     __entry->res_stateid_hash = error < 0 ? 0 :
>>> +                             nfs_stateid_hash(&res->write_res.stateid);
>>> +                     __entry->res_count = error < 0 ? 0 :
>>> +                             res->write_res.count;
>>> +                     __entry->res_sync = error < 0 ? 0 :
>>> +                             res->synchronous;
>>> +                     __entry->res_cons = error < 0 ? 0 :
>>> +                             res->consecutive;
>>> +                     __entry->intra = nss ? 0 : 1;
>>> +             ),
>> 
>> I have some general comments about the ternaries here
>> and in some of the other patches.
>> 
>> At the very least you should instead have a single check:
>> 
>>        if (error) {
>>                /* record all the error values */
>>        } else {
>>                /* record zeroes */
>>        }
>> 
>> Although, I recommend a different approach entirely,
>> and that is to to have /two/ trace points: one for
>> the success case and one for the error case. That
>> way the error case can be enabled persistently, as
>> appropriate, and the success case can be used for
>> general debugging, which ought to be rare once the
>> code is working well and we have good error reporting
>> in user space.
> 
> I think I see what you are saying with having something like (in
> nfs42proc.c in copy)
> nfs4_call_sync()
> if (status)
>  trace_nfs4_copy_err()
> else
>  trace_nfs4_copy()
> 
> That would replace my checking for error and setting the field. I can
> do that. But I'm not sure how to handle sharing of "call" arguments
> that we'd want to display for both the error case tracepoint and
> non-error case. If I'm missing an approach on how to can you please
> share, or otherwise, in my revision I'd re-write using if (error)
> approach and keep just a single tracepoint.

A single error tracepoint is fine with me.

If you're curious about multiple tracepoints that record
and display the same information, one example is in the
fs/nfsd/trace.h file, starting with the
NFSD_TRACE_PROC_ARG_FIELDS macro. It's kinda ugly.


>> In some instances (maybe not here in copy), the
>> success tracepoint is completely unnecessary for
>> everyday operation and can be omitted.
>> 
>> What's your thought about that?
>> 
>> 
>>> +
>>> +             TP_printk(
>>> +                     "error=%ld (%s) intra=%d src_fileid=%02x:%02x:%llu "
>>> +                     "src_fhandle=0x%08x dst_fileid=%02x:%02x:%llu "
>>> +                     "dst_fhandle=0x%08x src_stateid=%d:0x%08x "
>>> +                     "dst_stateid=%d:0x%08x src_offset=%llu dst_offset=%llu "
>>> +                     "len=%llu sync=%d cb_stateid=%d:0x%08x res_sync=%d "
>>> +                     "res_cons=%d res_count=%llu",
>>> +                     -__entry->error,
>>> +                     show_nfsv4_errors(__entry->error),
>>> +                     __entry->intra,
>>> +                     MAJOR(__entry->src_dev), MINOR(__entry->src_dev),
>>> +                     (unsigned long long)__entry->src_fileid,
>>> +                     __entry->src_fhandle,
>>> +                     MAJOR(__entry->dst_dev), MINOR(__entry->dst_dev),
>>> +                     (unsigned long long)__entry->dst_fileid,
>>> +                     __entry->dst_fhandle,
>>> +                     __entry->src_stateid_seq, __entry->src_stateid_hash,
>>> +                     __entry->dst_stateid_seq, __entry->dst_stateid_hash,
>>> +                     __entry->src_offset,
>>> +                     __entry->dst_offset,
>>> +                     __entry->len,
>>> +                     __entry->sync,
>>> +                     __entry->res_stateid_seq, __entry->res_stateid_hash,
>>> +                     __entry->res_sync,
>>> +                     __entry->res_cons,
>>> +                     __entry->res_count
>>> +             )
>>> +);
>>> +
>>> #endif /* CONFIG_NFS_V4_1 */
>>> 
>>> #endif /* _TRACE_NFS4_H */
>>> --
>>> 2.27.0
>>> 
>> 
>> --
>> Chuck Lever

--
Chuck Lever
kernel test robot Oct. 27, 2021, 2:28 p.m. UTC | #4
Hi Olga,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on trondmy-nfs/linux-next]
[also build test ERROR on v5.15-rc7 next-20211027]
[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]

url:    https://github.com/0day-ci/linux/commits/Olga-Kornievskaia/NFSv4-2-add-tracepoints-to-sparse-files-and-copy/20211019-060455
base:   git://git.linux-nfs.org/projects/trondmy/linux-nfs.git linux-next
config: csky-randconfig-r035-20211027 (attached as .config)
compiler: csky-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/829a1d6d8ca869013f86f9f799c735b6f1ff1acf
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Olga-Kornievskaia/NFSv4-2-add-tracepoints-to-sparse-files-and-copy/20211019-060455
        git checkout 829a1d6d8ca869013f86f9f799c735b6f1ff1acf
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=csky 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All error/warnings (new ones prefixed by >>):

   fs/nfs/nfs4trace.h:2541:1: note: in expansion of macro 'DEFINE_NFS4_SPARSE_EVENT'
    2541 | DEFINE_NFS4_SPARSE_EVENT(nfs4_deallocate);
         | ^~~~~~~~~~~~~~~~~~~~~~~~
   fs/nfs/nfs4trace.h: At top level:
   fs/nfs/nfs4trace.h:2536:46: warning: 'struct nfs42_falloc_args' declared inside parameter list will not be visible outside of this definition or declaration
    2536 |                                 const struct nfs42_falloc_args *args, \
         |                                              ^~~~~~~~~~~~~~~~~
   include/linux/tracepoint.h:260:45: note: in definition of macro '__DECLARE_TRACE'
     260 |         register_trace_##name(void (*probe)(data_proto), void *data)    \
         |                                             ^~~~~~~~~~
   include/linux/tracepoint.h:421:25: note: in expansion of macro 'PARAMS'
     421 |                         PARAMS(void *__data, proto))
         |                         ^~~~~~
   include/linux/tracepoint.h:542:9: note: in expansion of macro 'DECLARE_TRACE'
     542 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |         ^~~~~~~~~~~~~
   include/linux/tracepoint.h:542:29: note: in expansion of macro 'PARAMS'
     542 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |                             ^~~~~~
   fs/nfs/nfs4trace.h:2533:9: note: in expansion of macro 'DEFINE_EVENT'
    2533 |         DEFINE_EVENT(nfs4_sparse_event, name, \
         |         ^~~~~~~~~~~~
   fs/nfs/nfs4trace.h:2534:25: note: in expansion of macro 'TP_PROTO'
    2534 |                         TP_PROTO( \
         |                         ^~~~~~~~
   fs/nfs/nfs4trace.h:2541:1: note: in expansion of macro 'DEFINE_NFS4_SPARSE_EVENT'
    2541 | DEFINE_NFS4_SPARSE_EVENT(nfs4_deallocate);
         | ^~~~~~~~~~~~~~~~~~~~~~~~
   fs/nfs/nfs4trace.h:2536:46: warning: 'struct nfs42_falloc_args' declared inside parameter list will not be visible outside of this definition or declaration
    2536 |                                 const struct nfs42_falloc_args *args, \
         |                                              ^~~~~~~~~~~~~~~~~
   include/linux/tracepoint.h:266:50: note: in definition of macro '__DECLARE_TRACE'
     266 |         register_trace_prio_##name(void (*probe)(data_proto), void *data,\
         |                                                  ^~~~~~~~~~
   include/linux/tracepoint.h:421:25: note: in expansion of macro 'PARAMS'
     421 |                         PARAMS(void *__data, proto))
         |                         ^~~~~~
   include/linux/tracepoint.h:542:9: note: in expansion of macro 'DECLARE_TRACE'
     542 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |         ^~~~~~~~~~~~~
   include/linux/tracepoint.h:542:29: note: in expansion of macro 'PARAMS'
     542 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |                             ^~~~~~
   fs/nfs/nfs4trace.h:2533:9: note: in expansion of macro 'DEFINE_EVENT'
    2533 |         DEFINE_EVENT(nfs4_sparse_event, name, \
         |         ^~~~~~~~~~~~
   fs/nfs/nfs4trace.h:2534:25: note: in expansion of macro 'TP_PROTO'
    2534 |                         TP_PROTO( \
         |                         ^~~~~~~~
   fs/nfs/nfs4trace.h:2541:1: note: in expansion of macro 'DEFINE_NFS4_SPARSE_EVENT'
    2541 | DEFINE_NFS4_SPARSE_EVENT(nfs4_deallocate);
         | ^~~~~~~~~~~~~~~~~~~~~~~~
   fs/nfs/nfs4trace.h:2536:46: warning: 'struct nfs42_falloc_args' declared inside parameter list will not be visible outside of this definition or declaration
    2536 |                                 const struct nfs42_falloc_args *args, \
         |                                              ^~~~~~~~~~~~~~~~~
   include/linux/tracepoint.h:273:47: note: in definition of macro '__DECLARE_TRACE'
     273 |         unregister_trace_##name(void (*probe)(data_proto), void *data)  \
         |                                               ^~~~~~~~~~
   include/linux/tracepoint.h:421:25: note: in expansion of macro 'PARAMS'
     421 |                         PARAMS(void *__data, proto))
         |                         ^~~~~~
   include/linux/tracepoint.h:542:9: note: in expansion of macro 'DECLARE_TRACE'
     542 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |         ^~~~~~~~~~~~~
   include/linux/tracepoint.h:542:29: note: in expansion of macro 'PARAMS'
     542 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |                             ^~~~~~
   fs/nfs/nfs4trace.h:2533:9: note: in expansion of macro 'DEFINE_EVENT'
    2533 |         DEFINE_EVENT(nfs4_sparse_event, name, \
         |         ^~~~~~~~~~~~
   fs/nfs/nfs4trace.h:2534:25: note: in expansion of macro 'TP_PROTO'
    2534 |                         TP_PROTO( \
         |                         ^~~~~~~~
   fs/nfs/nfs4trace.h:2541:1: note: in expansion of macro 'DEFINE_NFS4_SPARSE_EVENT'
    2541 | DEFINE_NFS4_SPARSE_EVENT(nfs4_deallocate);
         | ^~~~~~~~~~~~~~~~~~~~~~~~
   fs/nfs/nfs4trace.h:2536:46: warning: 'struct nfs42_falloc_args' declared inside parameter list will not be visible outside of this definition or declaration
    2536 |                                 const struct nfs42_falloc_args *args, \
         |                                              ^~~~~~~~~~~~~~~~~
   include/linux/tracepoint.h:279:53: note: in definition of macro '__DECLARE_TRACE'
     279 |         check_trace_callback_type_##name(void (*cb)(data_proto))        \
         |                                                     ^~~~~~~~~~
   include/linux/tracepoint.h:421:25: note: in expansion of macro 'PARAMS'
     421 |                         PARAMS(void *__data, proto))
         |                         ^~~~~~
   include/linux/tracepoint.h:542:9: note: in expansion of macro 'DECLARE_TRACE'
     542 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |         ^~~~~~~~~~~~~
   include/linux/tracepoint.h:542:29: note: in expansion of macro 'PARAMS'
     542 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |                             ^~~~~~
   fs/nfs/nfs4trace.h:2533:9: note: in expansion of macro 'DEFINE_EVENT'
    2533 |         DEFINE_EVENT(nfs4_sparse_event, name, \
         |         ^~~~~~~~~~~~
   fs/nfs/nfs4trace.h:2534:25: note: in expansion of macro 'TP_PROTO'
    2534 |                         TP_PROTO( \
         |                         ^~~~~~~~
   fs/nfs/nfs4trace.h:2541:1: note: in expansion of macro 'DEFINE_NFS4_SPARSE_EVENT'
    2541 | DEFINE_NFS4_SPARSE_EVENT(nfs4_deallocate);
         | ^~~~~~~~~~~~~~~~~~~~~~~~
>> fs/nfs/nfs4trace.h:2548:38: warning: 'struct nfs42_copy_res' declared inside parameter list will not be visible outside of this definition or declaration
    2548 |                         const struct nfs42_copy_res *res,
         |                                      ^~~~~~~~~~~~~~
   include/linux/tracepoint.h:242:39: note: in definition of macro '__DECLARE_TRACE'
     242 |         extern int __traceiter_##name(data_proto);                      \
         |                                       ^~~~~~~~~~
   include/linux/tracepoint.h:421:25: note: in expansion of macro 'PARAMS'
     421 |                         PARAMS(void *__data, proto))
         |                         ^~~~~~
   include/linux/tracepoint.h:553:9: note: in expansion of macro 'DECLARE_TRACE'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |         ^~~~~~~~~~~~~
   include/linux/tracepoint.h:553:29: note: in expansion of macro 'PARAMS'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |                             ^~~~~~
   fs/nfs/nfs4trace.h:2543:1: note: in expansion of macro 'TRACE_EVENT'
    2543 | TRACE_EVENT(nfs4_copy,
         | ^~~~~~~~~~~
   fs/nfs/nfs4trace.h:2544:17: note: in expansion of macro 'TP_PROTO'
    2544 |                 TP_PROTO(
         |                 ^~~~~~~~
>> fs/nfs/nfs4trace.h:2547:38: warning: 'struct nfs42_copy_args' declared inside parameter list will not be visible outside of this definition or declaration
    2547 |                         const struct nfs42_copy_args *args,
         |                                      ^~~~~~~~~~~~~~~
   include/linux/tracepoint.h:242:39: note: in definition of macro '__DECLARE_TRACE'
     242 |         extern int __traceiter_##name(data_proto);                      \
         |                                       ^~~~~~~~~~
   include/linux/tracepoint.h:421:25: note: in expansion of macro 'PARAMS'
     421 |                         PARAMS(void *__data, proto))
         |                         ^~~~~~
   include/linux/tracepoint.h:553:9: note: in expansion of macro 'DECLARE_TRACE'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |         ^~~~~~~~~~~~~
   include/linux/tracepoint.h:553:29: note: in expansion of macro 'PARAMS'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |                             ^~~~~~
   fs/nfs/nfs4trace.h:2543:1: note: in expansion of macro 'TRACE_EVENT'
    2543 | TRACE_EVENT(nfs4_copy,
         | ^~~~~~~~~~~
   fs/nfs/nfs4trace.h:2544:17: note: in expansion of macro 'TP_PROTO'
    2544 |                 TP_PROTO(
         |                 ^~~~~~~~
>> fs/nfs/nfs4trace.h:2548:38: warning: 'struct nfs42_copy_res' declared inside parameter list will not be visible outside of this definition or declaration
    2548 |                         const struct nfs42_copy_res *res,
         |                                      ^~~~~~~~~~~~~~
   include/linux/tracepoint.h:245:41: note: in definition of macro '__DECLARE_TRACE'
     245 |         static inline void trace_##name(proto)                          \
         |                                         ^~~~~
   include/linux/tracepoint.h:419:31: note: in expansion of macro 'PARAMS'
     419 |         __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args),              \
         |                               ^~~~~~
   include/linux/tracepoint.h:553:9: note: in expansion of macro 'DECLARE_TRACE'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |         ^~~~~~~~~~~~~
   include/linux/tracepoint.h:553:29: note: in expansion of macro 'PARAMS'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |                             ^~~~~~
   fs/nfs/nfs4trace.h:2543:1: note: in expansion of macro 'TRACE_EVENT'
    2543 | TRACE_EVENT(nfs4_copy,
         | ^~~~~~~~~~~
   fs/nfs/nfs4trace.h:2544:17: note: in expansion of macro 'TP_PROTO'
    2544 |                 TP_PROTO(
         |                 ^~~~~~~~
>> fs/nfs/nfs4trace.h:2547:38: warning: 'struct nfs42_copy_args' declared inside parameter list will not be visible outside of this definition or declaration
    2547 |                         const struct nfs42_copy_args *args,
         |                                      ^~~~~~~~~~~~~~~
   include/linux/tracepoint.h:245:41: note: in definition of macro '__DECLARE_TRACE'
     245 |         static inline void trace_##name(proto)                          \
         |                                         ^~~~~
   include/linux/tracepoint.h:419:31: note: in expansion of macro 'PARAMS'
     419 |         __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args),              \
         |                               ^~~~~~
   include/linux/tracepoint.h:553:9: note: in expansion of macro 'DECLARE_TRACE'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |         ^~~~~~~~~~~~~
   include/linux/tracepoint.h:553:29: note: in expansion of macro 'PARAMS'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |                             ^~~~~~
   fs/nfs/nfs4trace.h:2543:1: note: in expansion of macro 'TRACE_EVENT'
    2543 | TRACE_EVENT(nfs4_copy,
         | ^~~~~~~~~~~
   fs/nfs/nfs4trace.h:2544:17: note: in expansion of macro 'TP_PROTO'
    2544 |                 TP_PROTO(
         |                 ^~~~~~~~
   fs/nfs/nfs4trace.h: In function 'trace_nfs4_copy':
>> fs/nfs/nfs4trace.h:2553:47: error: passing argument 4 of '__traceiter_nfs4_copy' from incompatible pointer type [-Werror=incompatible-pointer-types]
    2553 |                 TP_ARGS(src_inode, dst_inode, args, res, nss, error),
         |                                               ^~~~
         |                                               |
         |                                               const struct nfs42_copy_args *
   include/linux/tracepoint.h:177:66: note: in definition of macro '__DO_TRACE_CALL'
     177 | #define __DO_TRACE_CALL(name, args)     __traceiter_##name(NULL, args)
         |                                                                  ^~~~
   include/linux/tracepoint.h:206:39: note: in expansion of macro 'TP_ARGS'
     206 |                 __DO_TRACE_CALL(name, TP_ARGS(args));                   \
         |                                       ^~~~~~~
   include/linux/tracepoint.h:248:25: note: in expansion of macro '__DO_TRACE'
     248 |                         __DO_TRACE(name,                                \
         |                         ^~~~~~~~~~
   include/linux/tracepoint.h:249:33: note: in expansion of macro 'TP_ARGS'
     249 |                                 TP_ARGS(args),                          \
         |                                 ^~~~~~~
   include/linux/tracepoint.h:419:9: note: in expansion of macro '__DECLARE_TRACE'
     419 |         __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args),              \
         |         ^~~~~~~~~~~~~~~
   include/linux/tracepoint.h:419:46: note: in expansion of macro 'PARAMS'
     419 |         __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args),              \
         |                                              ^~~~~~
   include/linux/tracepoint.h:553:9: note: in expansion of macro 'DECLARE_TRACE'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |         ^~~~~~~~~~~~~
   include/linux/tracepoint.h:553:44: note: in expansion of macro 'PARAMS'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |                                            ^~~~~~
   fs/nfs/nfs4trace.h:2543:1: note: in expansion of macro 'TRACE_EVENT'
    2543 | TRACE_EVENT(nfs4_copy,
         | ^~~~~~~~~~~
   fs/nfs/nfs4trace.h:2553:17: note: in expansion of macro 'TP_ARGS'
    2553 |                 TP_ARGS(src_inode, dst_inode, args, res, nss, error),
         |                 ^~~~~~~
   fs/nfs/nfs4trace.h:2547:55: note: expected 'const struct nfs42_copy_args *' but argument is of type 'const struct nfs42_copy_args *'
    2547 |                         const struct nfs42_copy_args *args,
         |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
   include/linux/tracepoint.h:242:39: note: in definition of macro '__DECLARE_TRACE'
     242 |         extern int __traceiter_##name(data_proto);                      \
         |                                       ^~~~~~~~~~
   include/linux/tracepoint.h:421:25: note: in expansion of macro 'PARAMS'
     421 |                         PARAMS(void *__data, proto))
         |                         ^~~~~~
   include/linux/tracepoint.h:553:9: note: in expansion of macro 'DECLARE_TRACE'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |         ^~~~~~~~~~~~~
   include/linux/tracepoint.h:553:29: note: in expansion of macro 'PARAMS'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |                             ^~~~~~
   fs/nfs/nfs4trace.h:2543:1: note: in expansion of macro 'TRACE_EVENT'
    2543 | TRACE_EVENT(nfs4_copy,
         | ^~~~~~~~~~~
   fs/nfs/nfs4trace.h:2544:17: note: in expansion of macro 'TP_PROTO'
    2544 |                 TP_PROTO(
         |                 ^~~~~~~~
   fs/nfs/nfs4trace.h:2553:53: error: passing argument 5 of '__traceiter_nfs4_copy' from incompatible pointer type [-Werror=incompatible-pointer-types]
    2553 |                 TP_ARGS(src_inode, dst_inode, args, res, nss, error),
         |                                                     ^~~
         |                                                     |
         |                                                     const struct nfs42_copy_res *
   include/linux/tracepoint.h:177:66: note: in definition of macro '__DO_TRACE_CALL'
     177 | #define __DO_TRACE_CALL(name, args)     __traceiter_##name(NULL, args)
         |                                                                  ^~~~
   include/linux/tracepoint.h:206:39: note: in expansion of macro 'TP_ARGS'
     206 |                 __DO_TRACE_CALL(name, TP_ARGS(args));                   \
         |                                       ^~~~~~~
   include/linux/tracepoint.h:248:25: note: in expansion of macro '__DO_TRACE'
     248 |                         __DO_TRACE(name,                                \
         |                         ^~~~~~~~~~
   include/linux/tracepoint.h:249:33: note: in expansion of macro 'TP_ARGS'
     249 |                                 TP_ARGS(args),                          \
         |                                 ^~~~~~~
   include/linux/tracepoint.h:419:9: note: in expansion of macro '__DECLARE_TRACE'
     419 |         __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args),              \
         |         ^~~~~~~~~~~~~~~
   include/linux/tracepoint.h:419:46: note: in expansion of macro 'PARAMS'
     419 |         __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args),              \
         |                                              ^~~~~~
   include/linux/tracepoint.h:553:9: note: in expansion of macro 'DECLARE_TRACE'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |         ^~~~~~~~~~~~~
   include/linux/tracepoint.h:553:44: note: in expansion of macro 'PARAMS'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |                                            ^~~~~~
   fs/nfs/nfs4trace.h:2543:1: note: in expansion of macro 'TRACE_EVENT'
    2543 | TRACE_EVENT(nfs4_copy,
         | ^~~~~~~~~~~
   fs/nfs/nfs4trace.h:2553:17: note: in expansion of macro 'TP_ARGS'
    2553 |                 TP_ARGS(src_inode, dst_inode, args, res, nss, error),
         |                 ^~~~~~~
   fs/nfs/nfs4trace.h:2548:54: note: expected 'const struct nfs42_copy_res *' but argument is of type 'const struct nfs42_copy_res *'
    2548 |                         const struct nfs42_copy_res *res,
         |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
   include/linux/tracepoint.h:242:39: note: in definition of macro '__DECLARE_TRACE'
     242 |         extern int __traceiter_##name(data_proto);                      \
         |                                       ^~~~~~~~~~
   include/linux/tracepoint.h:421:25: note: in expansion of macro 'PARAMS'
     421 |                         PARAMS(void *__data, proto))
         |                         ^~~~~~
   include/linux/tracepoint.h:553:9: note: in expansion of macro 'DECLARE_TRACE'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |         ^~~~~~~~~~~~~
   include/linux/tracepoint.h:553:29: note: in expansion of macro 'PARAMS'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |                             ^~~~~~
   fs/nfs/nfs4trace.h:2543:1: note: in expansion of macro 'TRACE_EVENT'
    2543 | TRACE_EVENT(nfs4_copy,
         | ^~~~~~~~~~~
   fs/nfs/nfs4trace.h:2544:17: note: in expansion of macro 'TP_PROTO'
    2544 |                 TP_PROTO(
         |                 ^~~~~~~~
   fs/nfs/nfs4trace.h: At top level:
>> fs/nfs/nfs4trace.h:2548:38: warning: 'struct nfs42_copy_res' declared inside parameter list will not be visible outside of this definition or declaration
    2548 |                         const struct nfs42_copy_res *res,
         |                                      ^~~~~~~~~~~~~~
   include/linux/tracepoint.h:218:51: note: in definition of macro '__DECLARE_TRACE_RCU'
     218 |         static inline void trace_##name##_rcuidle(proto)                \
         |                                                   ^~~~~
   include/linux/tracepoint.h:257:35: note: in expansion of macro 'PARAMS'
     257 |         __DECLARE_TRACE_RCU(name, PARAMS(proto), PARAMS(args),          \
         |                                   ^~~~~~
   include/linux/tracepoint.h:419:9: note: in expansion of macro '__DECLARE_TRACE'
     419 |         __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args),              \
         |         ^~~~~~~~~~~~~~~
   include/linux/tracepoint.h:419:31: note: in expansion of macro 'PARAMS'
     419 |         __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args),              \
         |                               ^~~~~~
   include/linux/tracepoint.h:553:9: note: in expansion of macro 'DECLARE_TRACE'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |         ^~~~~~~~~~~~~
   include/linux/tracepoint.h:553:29: note: in expansion of macro 'PARAMS'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |                             ^~~~~~
   fs/nfs/nfs4trace.h:2543:1: note: in expansion of macro 'TRACE_EVENT'
    2543 | TRACE_EVENT(nfs4_copy,
         | ^~~~~~~~~~~
   fs/nfs/nfs4trace.h:2544:17: note: in expansion of macro 'TP_PROTO'
    2544 |                 TP_PROTO(
         |                 ^~~~~~~~
>> fs/nfs/nfs4trace.h:2547:38: warning: 'struct nfs42_copy_args' declared inside parameter list will not be visible outside of this definition or declaration
    2547 |                         const struct nfs42_copy_args *args,
         |                                      ^~~~~~~~~~~~~~~
   include/linux/tracepoint.h:218:51: note: in definition of macro '__DECLARE_TRACE_RCU'
     218 |         static inline void trace_##name##_rcuidle(proto)                \
         |                                                   ^~~~~
   include/linux/tracepoint.h:257:35: note: in expansion of macro 'PARAMS'
     257 |         __DECLARE_TRACE_RCU(name, PARAMS(proto), PARAMS(args),          \
         |                                   ^~~~~~
   include/linux/tracepoint.h:419:9: note: in expansion of macro '__DECLARE_TRACE'
     419 |         __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args),              \
         |         ^~~~~~~~~~~~~~~
   include/linux/tracepoint.h:419:31: note: in expansion of macro 'PARAMS'
     419 |         __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args),              \
         |                               ^~~~~~
   include/linux/tracepoint.h:553:9: note: in expansion of macro 'DECLARE_TRACE'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |         ^~~~~~~~~~~~~
   include/linux/tracepoint.h:553:29: note: in expansion of macro 'PARAMS'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |                             ^~~~~~
   fs/nfs/nfs4trace.h:2543:1: note: in expansion of macro 'TRACE_EVENT'
    2543 | TRACE_EVENT(nfs4_copy,
         | ^~~~~~~~~~~
   fs/nfs/nfs4trace.h:2544:17: note: in expansion of macro 'TP_PROTO'
    2544 |                 TP_PROTO(
         |                 ^~~~~~~~
   fs/nfs/nfs4trace.h: In function 'trace_nfs4_copy_rcuidle':
>> fs/nfs/nfs4trace.h:2553:47: error: passing argument 4 of '__traceiter_nfs4_copy' from incompatible pointer type [-Werror=incompatible-pointer-types]
    2553 |                 TP_ARGS(src_inode, dst_inode, args, res, nss, error),
         |                                               ^~~~
         |                                               |
         |                                               const struct nfs42_copy_args *
   include/linux/tracepoint.h:177:66: note: in definition of macro '__DO_TRACE_CALL'
     177 | #define __DO_TRACE_CALL(name, args)     __traceiter_##name(NULL, args)
         |                                                                  ^~~~
   include/linux/tracepoint.h:206:39: note: in expansion of macro 'TP_ARGS'
     206 |                 __DO_TRACE_CALL(name, TP_ARGS(args));                   \
         |                                       ^~~~~~~
   include/linux/tracepoint.h:221:25: note: in expansion of macro '__DO_TRACE'
     221 |                         __DO_TRACE(name,                                \
         |                         ^~~~~~~~~~
   include/linux/tracepoint.h:222:33: note: in expansion of macro 'TP_ARGS'
     222 |                                 TP_ARGS(args),                          \
         |                                 ^~~~~~~
   include/linux/tracepoint.h:257:9: note: in expansion of macro '__DECLARE_TRACE_RCU'
     257 |         __DECLARE_TRACE_RCU(name, PARAMS(proto), PARAMS(args),          \
         |         ^~~~~~~~~~~~~~~~~~~
   include/linux/tracepoint.h:257:50: note: in expansion of macro 'PARAMS'
     257 |         __DECLARE_TRACE_RCU(name, PARAMS(proto), PARAMS(args),          \
         |                                                  ^~~~~~
   include/linux/tracepoint.h:419:9: note: in expansion of macro '__DECLARE_TRACE'
     419 |         __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args),              \
         |         ^~~~~~~~~~~~~~~
   include/linux/tracepoint.h:419:46: note: in expansion of macro 'PARAMS'
     419 |         __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args),              \
         |                                              ^~~~~~
   include/linux/tracepoint.h:553:9: note: in expansion of macro 'DECLARE_TRACE'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |         ^~~~~~~~~~~~~
   include/linux/tracepoint.h:553:44: note: in expansion of macro 'PARAMS'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |                                            ^~~~~~
   fs/nfs/nfs4trace.h:2543:1: note: in expansion of macro 'TRACE_EVENT'
    2543 | TRACE_EVENT(nfs4_copy,
         | ^~~~~~~~~~~
   fs/nfs/nfs4trace.h:2553:17: note: in expansion of macro 'TP_ARGS'
    2553 |                 TP_ARGS(src_inode, dst_inode, args, res, nss, error),
         |                 ^~~~~~~
   fs/nfs/nfs4trace.h:2547:55: note: expected 'const struct nfs42_copy_args *' but argument is of type 'const struct nfs42_copy_args *'
    2547 |                         const struct nfs42_copy_args *args,
         |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
   include/linux/tracepoint.h:242:39: note: in definition of macro '__DECLARE_TRACE'
     242 |         extern int __traceiter_##name(data_proto);                      \
         |                                       ^~~~~~~~~~
   include/linux/tracepoint.h:421:25: note: in expansion of macro 'PARAMS'
     421 |                         PARAMS(void *__data, proto))
         |                         ^~~~~~
   include/linux/tracepoint.h:553:9: note: in expansion of macro 'DECLARE_TRACE'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |         ^~~~~~~~~~~~~
   include/linux/tracepoint.h:553:29: note: in expansion of macro 'PARAMS'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |                             ^~~~~~
   fs/nfs/nfs4trace.h:2543:1: note: in expansion of macro 'TRACE_EVENT'
    2543 | TRACE_EVENT(nfs4_copy,
         | ^~~~~~~~~~~
   fs/nfs/nfs4trace.h:2544:17: note: in expansion of macro 'TP_PROTO'
    2544 |                 TP_PROTO(
         |                 ^~~~~~~~
   fs/nfs/nfs4trace.h:2553:53: error: passing argument 5 of '__traceiter_nfs4_copy' from incompatible pointer type [-Werror=incompatible-pointer-types]
    2553 |                 TP_ARGS(src_inode, dst_inode, args, res, nss, error),
         |                                                     ^~~
         |                                                     |
         |                                                     const struct nfs42_copy_res *
   include/linux/tracepoint.h:177:66: note: in definition of macro '__DO_TRACE_CALL'
     177 | #define __DO_TRACE_CALL(name, args)     __traceiter_##name(NULL, args)
         |                                                                  ^~~~
   include/linux/tracepoint.h:206:39: note: in expansion of macro 'TP_ARGS'
     206 |                 __DO_TRACE_CALL(name, TP_ARGS(args));                   \
         |                                       ^~~~~~~
   include/linux/tracepoint.h:221:25: note: in expansion of macro '__DO_TRACE'
     221 |                         __DO_TRACE(name,                                \
         |                         ^~~~~~~~~~
   include/linux/tracepoint.h:222:33: note: in expansion of macro 'TP_ARGS'
     222 |                                 TP_ARGS(args),                          \
         |                                 ^~~~~~~
   include/linux/tracepoint.h:257:9: note: in expansion of macro '__DECLARE_TRACE_RCU'
     257 |         __DECLARE_TRACE_RCU(name, PARAMS(proto), PARAMS(args),          \
         |         ^~~~~~~~~~~~~~~~~~~
   include/linux/tracepoint.h:257:50: note: in expansion of macro 'PARAMS'
     257 |         __DECLARE_TRACE_RCU(name, PARAMS(proto), PARAMS(args),          \
         |                                                  ^~~~~~
   include/linux/tracepoint.h:419:9: note: in expansion of macro '__DECLARE_TRACE'
     419 |         __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args),              \
         |         ^~~~~~~~~~~~~~~
   include/linux/tracepoint.h:419:46: note: in expansion of macro 'PARAMS'
     419 |         __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args),              \
         |                                              ^~~~~~
   include/linux/tracepoint.h:553:9: note: in expansion of macro 'DECLARE_TRACE'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |         ^~~~~~~~~~~~~
   include/linux/tracepoint.h:553:44: note: in expansion of macro 'PARAMS'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |                                            ^~~~~~
   fs/nfs/nfs4trace.h:2543:1: note: in expansion of macro 'TRACE_EVENT'
    2543 | TRACE_EVENT(nfs4_copy,
         | ^~~~~~~~~~~
   fs/nfs/nfs4trace.h:2553:17: note: in expansion of macro 'TP_ARGS'
    2553 |                 TP_ARGS(src_inode, dst_inode, args, res, nss, error),
         |                 ^~~~~~~
   fs/nfs/nfs4trace.h:2548:54: note: expected 'const struct nfs42_copy_res *' but argument is of type 'const struct nfs42_copy_res *'
    2548 |                         const struct nfs42_copy_res *res,
         |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
   include/linux/tracepoint.h:242:39: note: in definition of macro '__DECLARE_TRACE'
     242 |         extern int __traceiter_##name(data_proto);                      \
         |                                       ^~~~~~~~~~
   include/linux/tracepoint.h:421:25: note: in expansion of macro 'PARAMS'
     421 |                         PARAMS(void *__data, proto))
         |                         ^~~~~~
   include/linux/tracepoint.h:553:9: note: in expansion of macro 'DECLARE_TRACE'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |         ^~~~~~~~~~~~~
   include/linux/tracepoint.h:553:29: note: in expansion of macro 'PARAMS'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |                             ^~~~~~
   fs/nfs/nfs4trace.h:2543:1: note: in expansion of macro 'TRACE_EVENT'
    2543 | TRACE_EVENT(nfs4_copy,
         | ^~~~~~~~~~~
   fs/nfs/nfs4trace.h:2544:17: note: in expansion of macro 'TP_PROTO'
    2544 |                 TP_PROTO(
         |                 ^~~~~~~~
   fs/nfs/nfs4trace.h: At top level:
>> fs/nfs/nfs4trace.h:2548:38: warning: 'struct nfs42_copy_res' declared inside parameter list will not be visible outside of this definition or declaration
    2548 |                         const struct nfs42_copy_res *res,
         |                                      ^~~~~~~~~~~~~~
   include/linux/tracepoint.h:260:45: note: in definition of macro '__DECLARE_TRACE'
     260 |         register_trace_##name(void (*probe)(data_proto), void *data)    \
         |                                             ^~~~~~~~~~
   include/linux/tracepoint.h:421:25: note: in expansion of macro 'PARAMS'
     421 |                         PARAMS(void *__data, proto))
         |                         ^~~~~~
   include/linux/tracepoint.h:553:9: note: in expansion of macro 'DECLARE_TRACE'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |         ^~~~~~~~~~~~~
   include/linux/tracepoint.h:553:29: note: in expansion of macro 'PARAMS'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |                             ^~~~~~
   fs/nfs/nfs4trace.h:2543:1: note: in expansion of macro 'TRACE_EVENT'
    2543 | TRACE_EVENT(nfs4_copy,
         | ^~~~~~~~~~~
   fs/nfs/nfs4trace.h:2544:17: note: in expansion of macro 'TP_PROTO'
    2544 |                 TP_PROTO(
         |                 ^~~~~~~~
>> fs/nfs/nfs4trace.h:2547:38: warning: 'struct nfs42_copy_args' declared inside parameter list will not be visible outside of this definition or declaration
    2547 |                         const struct nfs42_copy_args *args,
         |                                      ^~~~~~~~~~~~~~~
   include/linux/tracepoint.h:260:45: note: in definition of macro '__DECLARE_TRACE'
     260 |         register_trace_##name(void (*probe)(data_proto), void *data)    \
         |                                             ^~~~~~~~~~
   include/linux/tracepoint.h:421:25: note: in expansion of macro 'PARAMS'
     421 |                         PARAMS(void *__data, proto))
         |                         ^~~~~~
   include/linux/tracepoint.h:553:9: note: in expansion of macro 'DECLARE_TRACE'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |         ^~~~~~~~~~~~~
   include/linux/tracepoint.h:553:29: note: in expansion of macro 'PARAMS'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |                             ^~~~~~
   fs/nfs/nfs4trace.h:2543:1: note: in expansion of macro 'TRACE_EVENT'
    2543 | TRACE_EVENT(nfs4_copy,
         | ^~~~~~~~~~~
   fs/nfs/nfs4trace.h:2544:17: note: in expansion of macro 'TP_PROTO'
    2544 |                 TP_PROTO(
         |                 ^~~~~~~~
>> fs/nfs/nfs4trace.h:2548:38: warning: 'struct nfs42_copy_res' declared inside parameter list will not be visible outside of this definition or declaration
    2548 |                         const struct nfs42_copy_res *res,
         |                                      ^~~~~~~~~~~~~~
   include/linux/tracepoint.h:266:50: note: in definition of macro '__DECLARE_TRACE'
     266 |         register_trace_prio_##name(void (*probe)(data_proto), void *data,\
         |                                                  ^~~~~~~~~~
   include/linux/tracepoint.h:421:25: note: in expansion of macro 'PARAMS'
     421 |                         PARAMS(void *__data, proto))
         |                         ^~~~~~
   include/linux/tracepoint.h:553:9: note: in expansion of macro 'DECLARE_TRACE'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |         ^~~~~~~~~~~~~
   include/linux/tracepoint.h:553:29: note: in expansion of macro 'PARAMS'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |                             ^~~~~~
   fs/nfs/nfs4trace.h:2543:1: note: in expansion of macro 'TRACE_EVENT'
    2543 | TRACE_EVENT(nfs4_copy,
         | ^~~~~~~~~~~
   fs/nfs/nfs4trace.h:2544:17: note: in expansion of macro 'TP_PROTO'
    2544 |                 TP_PROTO(
         |                 ^~~~~~~~
>> fs/nfs/nfs4trace.h:2547:38: warning: 'struct nfs42_copy_args' declared inside parameter list will not be visible outside of this definition or declaration
    2547 |                         const struct nfs42_copy_args *args,
         |                                      ^~~~~~~~~~~~~~~
   include/linux/tracepoint.h:266:50: note: in definition of macro '__DECLARE_TRACE'
     266 |         register_trace_prio_##name(void (*probe)(data_proto), void *data,\
         |                                                  ^~~~~~~~~~
   include/linux/tracepoint.h:421:25: note: in expansion of macro 'PARAMS'
     421 |                         PARAMS(void *__data, proto))
         |                         ^~~~~~
   include/linux/tracepoint.h:553:9: note: in expansion of macro 'DECLARE_TRACE'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |         ^~~~~~~~~~~~~
   include/linux/tracepoint.h:553:29: note: in expansion of macro 'PARAMS'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |                             ^~~~~~
   fs/nfs/nfs4trace.h:2543:1: note: in expansion of macro 'TRACE_EVENT'
    2543 | TRACE_EVENT(nfs4_copy,
         | ^~~~~~~~~~~
   fs/nfs/nfs4trace.h:2544:17: note: in expansion of macro 'TP_PROTO'
    2544 |                 TP_PROTO(
         |                 ^~~~~~~~
>> fs/nfs/nfs4trace.h:2548:38: warning: 'struct nfs42_copy_res' declared inside parameter list will not be visible outside of this definition or declaration
    2548 |                         const struct nfs42_copy_res *res,
         |                                      ^~~~~~~~~~~~~~
   include/linux/tracepoint.h:273:47: note: in definition of macro '__DECLARE_TRACE'
     273 |         unregister_trace_##name(void (*probe)(data_proto), void *data)  \
         |                                               ^~~~~~~~~~
   include/linux/tracepoint.h:421:25: note: in expansion of macro 'PARAMS'
     421 |                         PARAMS(void *__data, proto))
         |                         ^~~~~~
   include/linux/tracepoint.h:553:9: note: in expansion of macro 'DECLARE_TRACE'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |         ^~~~~~~~~~~~~
   include/linux/tracepoint.h:553:29: note: in expansion of macro 'PARAMS'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |                             ^~~~~~
   fs/nfs/nfs4trace.h:2543:1: note: in expansion of macro 'TRACE_EVENT'
    2543 | TRACE_EVENT(nfs4_copy,
         | ^~~~~~~~~~~
   fs/nfs/nfs4trace.h:2544:17: note: in expansion of macro 'TP_PROTO'
    2544 |                 TP_PROTO(
         |                 ^~~~~~~~
>> fs/nfs/nfs4trace.h:2547:38: warning: 'struct nfs42_copy_args' declared inside parameter list will not be visible outside of this definition or declaration
    2547 |                         const struct nfs42_copy_args *args,
         |                                      ^~~~~~~~~~~~~~~
   include/linux/tracepoint.h:273:47: note: in definition of macro '__DECLARE_TRACE'
     273 |         unregister_trace_##name(void (*probe)(data_proto), void *data)  \
         |                                               ^~~~~~~~~~
   include/linux/tracepoint.h:421:25: note: in expansion of macro 'PARAMS'
     421 |                         PARAMS(void *__data, proto))
         |                         ^~~~~~
   include/linux/tracepoint.h:553:9: note: in expansion of macro 'DECLARE_TRACE'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |         ^~~~~~~~~~~~~
   include/linux/tracepoint.h:553:29: note: in expansion of macro 'PARAMS'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |                             ^~~~~~
   fs/nfs/nfs4trace.h:2543:1: note: in expansion of macro 'TRACE_EVENT'
    2543 | TRACE_EVENT(nfs4_copy,
         | ^~~~~~~~~~~
   fs/nfs/nfs4trace.h:2544:17: note: in expansion of macro 'TP_PROTO'
    2544 |                 TP_PROTO(
         |                 ^~~~~~~~
>> fs/nfs/nfs4trace.h:2548:38: warning: 'struct nfs42_copy_res' declared inside parameter list will not be visible outside of this definition or declaration
    2548 |                         const struct nfs42_copy_res *res,
         |                                      ^~~~~~~~~~~~~~
   include/linux/tracepoint.h:279:53: note: in definition of macro '__DECLARE_TRACE'
     279 |         check_trace_callback_type_##name(void (*cb)(data_proto))        \
         |                                                     ^~~~~~~~~~
   include/linux/tracepoint.h:421:25: note: in expansion of macro 'PARAMS'
     421 |                         PARAMS(void *__data, proto))
         |                         ^~~~~~
   include/linux/tracepoint.h:553:9: note: in expansion of macro 'DECLARE_TRACE'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |         ^~~~~~~~~~~~~
   include/linux/tracepoint.h:553:29: note: in expansion of macro 'PARAMS'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |                             ^~~~~~
   fs/nfs/nfs4trace.h:2543:1: note: in expansion of macro 'TRACE_EVENT'
    2543 | TRACE_EVENT(nfs4_copy,
         | ^~~~~~~~~~~
   fs/nfs/nfs4trace.h:2544:17: note: in expansion of macro 'TP_PROTO'
    2544 |                 TP_PROTO(
         |                 ^~~~~~~~
>> fs/nfs/nfs4trace.h:2547:38: warning: 'struct nfs42_copy_args' declared inside parameter list will not be visible outside of this definition or declaration
    2547 |                         const struct nfs42_copy_args *args,
         |                                      ^~~~~~~~~~~~~~~
   include/linux/tracepoint.h:279:53: note: in definition of macro '__DECLARE_TRACE'
     279 |         check_trace_callback_type_##name(void (*cb)(data_proto))        \
         |                                                     ^~~~~~~~~~
   include/linux/tracepoint.h:421:25: note: in expansion of macro 'PARAMS'
     421 |                         PARAMS(void *__data, proto))
         |                         ^~~~~~
   include/linux/tracepoint.h:553:9: note: in expansion of macro 'DECLARE_TRACE'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |         ^~~~~~~~~~~~~
   include/linux/tracepoint.h:553:29: note: in expansion of macro 'PARAMS'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |                             ^~~~~~
   fs/nfs/nfs4trace.h:2543:1: note: in expansion of macro 'TRACE_EVENT'
    2543 | TRACE_EVENT(nfs4_copy,
         | ^~~~~~~~~~~
   fs/nfs/nfs4trace.h:2544:17: note: in expansion of macro 'TP_PROTO'
    2544 |                 TP_PROTO(
         |                 ^~~~~~~~
   fs/nfs/nfs4proc.c: In function 'nfs4_proc_create_session':
   fs/nfs/nfs4proc.c:9104:19: warning: variable 'ptr' set but not used [-Wunused-but-set-variable]
    9104 |         unsigned *ptr;
         |                   ^~~
   cc1: some warnings being treated as errors
..


vim +/__traceiter_nfs4_copy +2553 fs/nfs/nfs4trace.h

  2542	
  2543	TRACE_EVENT(nfs4_copy,
  2544			TP_PROTO(
  2545				const struct inode *src_inode,
  2546				const struct inode *dst_inode,
> 2547				const struct nfs42_copy_args *args,
> 2548				const struct nfs42_copy_res *res,
  2549				const struct nl4_server *nss,
  2550				int error
  2551			),
  2552	
> 2553			TP_ARGS(src_inode, dst_inode, args, res, nss, error),
  2554	
  2555			TP_STRUCT__entry(
  2556				__field(unsigned long, error)
  2557				__field(u32, src_fhandle)
  2558				__field(u32, src_fileid)
  2559				__field(u32, dst_fhandle)
  2560				__field(u32, dst_fileid)
  2561				__field(dev_t, src_dev)
  2562				__field(dev_t, dst_dev)
  2563				__field(int, src_stateid_seq)
  2564				__field(u32, src_stateid_hash)
  2565				__field(int, dst_stateid_seq)
  2566				__field(u32, dst_stateid_hash)
  2567				__field(loff_t, src_offset)
  2568				__field(loff_t, dst_offset)
  2569				__field(bool, sync)
  2570				__field(loff_t, len)
  2571				__field(int, res_stateid_seq)
  2572				__field(u32, res_stateid_hash)
  2573				__field(loff_t, res_count)
  2574				__field(bool, res_sync)
  2575				__field(bool, res_cons)
  2576				__field(bool, intra)
  2577			),
  2578	
  2579			TP_fast_assign(
  2580				const struct nfs_inode *src_nfsi = NFS_I(src_inode);
  2581				const struct nfs_inode *dst_nfsi = NFS_I(dst_inode);
  2582	
  2583				__entry->src_fileid = src_nfsi->fileid;
  2584				__entry->src_dev = src_inode->i_sb->s_dev;
  2585				__entry->src_fhandle = nfs_fhandle_hash(args->src_fh);
  2586				__entry->src_offset = args->src_pos;
  2587				__entry->dst_fileid = dst_nfsi->fileid;
  2588				__entry->dst_dev = dst_inode->i_sb->s_dev;
  2589				__entry->dst_fhandle = nfs_fhandle_hash(args->dst_fh);
  2590				__entry->dst_offset = args->dst_pos;
  2591				__entry->len = args->count;
  2592				__entry->sync = args->sync;
  2593				__entry->error = error < 0 ? -error : 0;
  2594				__entry->src_stateid_seq =
  2595					be32_to_cpu(args->src_stateid.seqid);
  2596				__entry->src_stateid_hash =
  2597					nfs_stateid_hash(&args->src_stateid);
  2598				__entry->dst_stateid_seq =
  2599					be32_to_cpu(args->dst_stateid.seqid);
  2600				__entry->dst_stateid_hash =
  2601					nfs_stateid_hash(&args->dst_stateid);
  2602				__entry->res_stateid_seq = error < 0 ? 0 :
  2603					be32_to_cpu(res->write_res.stateid.seqid);
  2604				__entry->res_stateid_hash = error < 0 ? 0 :
  2605					nfs_stateid_hash(&res->write_res.stateid);
  2606				__entry->res_count = error < 0 ? 0 :
  2607					res->write_res.count;
  2608				__entry->res_sync = error < 0 ? 0 :
  2609					res->synchronous;
  2610				__entry->res_cons = error < 0 ? 0 :
  2611					res->consecutive;
  2612				__entry->intra = nss ? 0 : 1;
  2613			),
  2614	
  2615			TP_printk(
  2616				"error=%ld (%s) intra=%d src_fileid=%02x:%02x:%llu "
  2617				"src_fhandle=0x%08x dst_fileid=%02x:%02x:%llu "
  2618				"dst_fhandle=0x%08x src_stateid=%d:0x%08x "
  2619				"dst_stateid=%d:0x%08x src_offset=%llu dst_offset=%llu "
  2620				"len=%llu sync=%d cb_stateid=%d:0x%08x res_sync=%d "
  2621				"res_cons=%d res_count=%llu",
  2622				-__entry->error,
  2623				show_nfsv4_errors(__entry->error),
  2624				__entry->intra,
  2625				MAJOR(__entry->src_dev), MINOR(__entry->src_dev),
  2626				(unsigned long long)__entry->src_fileid,
  2627				__entry->src_fhandle,
  2628				MAJOR(__entry->dst_dev), MINOR(__entry->dst_dev),
  2629				(unsigned long long)__entry->dst_fileid,
  2630				__entry->dst_fhandle,
  2631				__entry->src_stateid_seq, __entry->src_stateid_hash,
  2632				__entry->dst_stateid_seq, __entry->dst_stateid_hash,
  2633				__entry->src_offset,
  2634				__entry->dst_offset,
  2635				__entry->len,
  2636				__entry->sync,
  2637				__entry->res_stateid_seq, __entry->res_stateid_hash,
  2638				__entry->res_sync,
  2639				__entry->res_cons,
  2640				__entry->res_count
  2641			)
  2642	);
  2643	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
diff mbox series

Patch

diff --git a/fs/nfs/nfs42proc.c b/fs/nfs/nfs42proc.c
index c36824888601..a072cdaf7bdc 100644
--- a/fs/nfs/nfs42proc.c
+++ b/fs/nfs/nfs42proc.c
@@ -367,6 +367,7 @@  static ssize_t _nfs42_proc_copy(struct file *src,
 
 	status = nfs4_call_sync(dst_server->client, dst_server, &msg,
 				&args->seq_args, &res->seq_res, 0);
+	trace_nfs4_copy(src_inode, dst_inode, args, res, nss, status);
 	if (status == -ENOTSUPP)
 		dst_server->caps &= ~NFS_CAP_COPY;
 	if (status)
diff --git a/fs/nfs/nfs4trace.h b/fs/nfs/nfs4trace.h
index ba338ee4a82b..4beb59d78ff3 100644
--- a/fs/nfs/nfs4trace.h
+++ b/fs/nfs/nfs4trace.h
@@ -2540,6 +2540,107 @@  DECLARE_EVENT_CLASS(nfs4_sparse_event,
 DEFINE_NFS4_SPARSE_EVENT(nfs4_fallocate);
 DEFINE_NFS4_SPARSE_EVENT(nfs4_deallocate);
 
+TRACE_EVENT(nfs4_copy,
+		TP_PROTO(
+			const struct inode *src_inode,
+			const struct inode *dst_inode,
+			const struct nfs42_copy_args *args,
+			const struct nfs42_copy_res *res,
+			const struct nl4_server *nss,
+			int error
+		),
+
+		TP_ARGS(src_inode, dst_inode, args, res, nss, error),
+
+		TP_STRUCT__entry(
+			__field(unsigned long, error)
+			__field(u32, src_fhandle)
+			__field(u32, src_fileid)
+			__field(u32, dst_fhandle)
+			__field(u32, dst_fileid)
+			__field(dev_t, src_dev)
+			__field(dev_t, dst_dev)
+			__field(int, src_stateid_seq)
+			__field(u32, src_stateid_hash)
+			__field(int, dst_stateid_seq)
+			__field(u32, dst_stateid_hash)
+			__field(loff_t, src_offset)
+			__field(loff_t, dst_offset)
+			__field(bool, sync)
+			__field(loff_t, len)
+			__field(int, res_stateid_seq)
+			__field(u32, res_stateid_hash)
+			__field(loff_t, res_count)
+			__field(bool, res_sync)
+			__field(bool, res_cons)
+			__field(bool, intra)
+		),
+
+		TP_fast_assign(
+			const struct nfs_inode *src_nfsi = NFS_I(src_inode);
+			const struct nfs_inode *dst_nfsi = NFS_I(dst_inode);
+
+			__entry->src_fileid = src_nfsi->fileid;
+			__entry->src_dev = src_inode->i_sb->s_dev;
+			__entry->src_fhandle = nfs_fhandle_hash(args->src_fh);
+			__entry->src_offset = args->src_pos;
+			__entry->dst_fileid = dst_nfsi->fileid;
+			__entry->dst_dev = dst_inode->i_sb->s_dev;
+			__entry->dst_fhandle = nfs_fhandle_hash(args->dst_fh);
+			__entry->dst_offset = args->dst_pos;
+			__entry->len = args->count;
+			__entry->sync = args->sync;
+			__entry->error = error < 0 ? -error : 0;
+			__entry->src_stateid_seq =
+				be32_to_cpu(args->src_stateid.seqid);
+			__entry->src_stateid_hash =
+				nfs_stateid_hash(&args->src_stateid);
+			__entry->dst_stateid_seq =
+				be32_to_cpu(args->dst_stateid.seqid);
+			__entry->dst_stateid_hash =
+				nfs_stateid_hash(&args->dst_stateid);
+			__entry->res_stateid_seq = error < 0 ? 0 :
+				be32_to_cpu(res->write_res.stateid.seqid);
+			__entry->res_stateid_hash = error < 0 ? 0 :
+				nfs_stateid_hash(&res->write_res.stateid);
+			__entry->res_count = error < 0 ? 0 :
+				res->write_res.count;
+			__entry->res_sync = error < 0 ? 0 :
+				res->synchronous;
+			__entry->res_cons = error < 0 ? 0 :
+				res->consecutive;
+			__entry->intra = nss ? 0 : 1;
+		),
+
+		TP_printk(
+			"error=%ld (%s) intra=%d src_fileid=%02x:%02x:%llu "
+			"src_fhandle=0x%08x dst_fileid=%02x:%02x:%llu "
+			"dst_fhandle=0x%08x src_stateid=%d:0x%08x "
+			"dst_stateid=%d:0x%08x src_offset=%llu dst_offset=%llu "
+			"len=%llu sync=%d cb_stateid=%d:0x%08x res_sync=%d "
+			"res_cons=%d res_count=%llu",
+			-__entry->error,
+			show_nfsv4_errors(__entry->error),
+			__entry->intra,
+			MAJOR(__entry->src_dev), MINOR(__entry->src_dev),
+			(unsigned long long)__entry->src_fileid,
+			__entry->src_fhandle,
+			MAJOR(__entry->dst_dev), MINOR(__entry->dst_dev),
+			(unsigned long long)__entry->dst_fileid,
+			__entry->dst_fhandle,
+			__entry->src_stateid_seq, __entry->src_stateid_hash,
+			__entry->dst_stateid_seq, __entry->dst_stateid_hash,
+			__entry->src_offset,
+			__entry->dst_offset,
+			__entry->len,
+			__entry->sync,
+			__entry->res_stateid_seq, __entry->res_stateid_hash,
+			__entry->res_sync,
+			__entry->res_cons,
+			__entry->res_count
+		)
+);
+
 #endif /* CONFIG_NFS_V4_1 */
 
 #endif /* _TRACE_NFS4_H */