From: Chuck Lever III <chuck.lever@oracle.com>
To: Olga Kornievskaia <olga.kornievskaia@gmail.com>
Cc: Trond Myklebust <trond.myklebust@hammerspace.com>,
Anna Schumaker <anna.schumaker@netapp.com>,
Steve Dickson <steved@redhat.com>,
Linux NFS Mailing List <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH 5/7] NFSv4.2 add tracepoint to CB_OFFLOAD
Date: Tue, 19 Oct 2021 16:35:47 +0000 [thread overview]
Message-ID: <C818DA0E-207F-4FFC-AC38-61F58C131787@oracle.com> (raw)
In-Reply-To: <CAN-5tyH90dMe2QyLXVjZBZU_BV34a1=xc_NhwxDQmt1MbcnXQQ@mail.gmail.com>
> On Oct 19, 2021, at 12:01 PM, Olga Kornievskaia <olga.kornievskaia@gmail.com> wrote:
>
> On Tue, Oct 19, 2021 at 11:17 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 CB_OFFLOAD operation.
>>>
>>> Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
>>> ---
>>> fs/nfs/callback_proc.c | 3 +++
>>> fs/nfs/nfs4trace.h | 50 ++++++++++++++++++++++++++++++++++++++++++
>>> 2 files changed, 53 insertions(+)
>>>
>>> diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c
>>> index ed9d580826f5..09c5b1cb3e07 100644
>>> --- a/fs/nfs/callback_proc.c
>>> +++ b/fs/nfs/callback_proc.c
>>> @@ -739,6 +739,9 @@ __be32 nfs4_callback_offload(void *data, void *dummy,
>>> kfree(copy);
>>> spin_unlock(&cps->clp->cl_lock);
>>>
>>> + trace_nfs4_cb_offload(&args->coa_fh, &args->coa_stateid,
>>> + args->wr_count, args->error,
>>> + args->wr_writeverf.committed);
>>> return 0;
>>> }
>>> #endif /* CONFIG_NFS_V4_2 */
>>> diff --git a/fs/nfs/nfs4trace.h b/fs/nfs/nfs4trace.h
>>> index cc6537a20ebe..33f52d486528 100644
>>> --- a/fs/nfs/nfs4trace.h
>>> +++ b/fs/nfs/nfs4trace.h
>>> @@ -2714,6 +2714,56 @@ TRACE_EVENT(nfs4_clone,
>>> )
>>> );
>>>
>>> +#define show_write_mode(how) \
>>> + __print_symbolic(how, \
>>> + { NFS_UNSTABLE, "UNSTABLE" }, \
>>> + { NFS_DATA_SYNC, "DATA_SYNC" }, \
>>> + { NFS_FILE_SYNC, "FILE_SYNC"})
>>
>> Is there no way to reuse fs/nfs/nfstrace.h::nfs_show_stable() ?
>>
>> Btw, I have patches that move some NFS trace infrastructure
>> into include/trace/events so that it can be shared between the
>> NFS client and server trace subsystems. They might be useful
>> here too.
>>
>> The generic FS macros are moved in this commit:
>>
>> https://git.kernel.org/pub/scm/linux/kernel/git/cel/linux.git/commit/?h=nfsd-more-tracepoints&id=495731e1332c7e26af1e04a88eb65e3c08dfbf53
>>
>> Some NFS macros are moved in this commit:
>>
>> https://git.kernel.org/pub/scm/linux/kernel/git/cel/linux.git/commit/?h=nfsd-more-tracepoints&id=24763f8889e0a18a8d06ddcd05bac06a7d043515
>>
>> Additional macros are introduced later in that same branch.
>>
>> I don't have any opinion about whether these should be
>> applied before your patches or after them.
>
> It sounds like, if there was already a show_nfs_stable_how() that I
> could call then I don't need to define what I'm defining? So if I
> apply your patches and and then my patches on top of that, that seems
> like the way to go? That depends on if your patch(es) are ready to be
> submitted or not? Alternatively, your patch(es) can fix my code. I
> don't have a preference either way.
I can post those two now and the list can decide if they are ready.
>>> +
>>> +TRACE_EVENT(nfs4_cb_offload,
>>> + TP_PROTO(
>>> + const struct nfs_fh *cb_fh,
>>> + const nfs4_stateid *cb_stateid,
>>> + uint64_t cb_count,
>>> + int cb_error,
>>> + int cb_how_stable
>>> + ),
>>> +
>>> + TP_ARGS(cb_fh, cb_stateid, cb_count, cb_error,
>>> + cb_how_stable),
>>> +
>>> + TP_STRUCT__entry(
>>> + __field(unsigned long, error)
>>> + __field(u32, fhandle)
>>> + __field(loff_t, cb_count)
>>> + __field(int, cb_how)
>>> + __field(int, cb_stateid_seq)
>>> + __field(u32, cb_stateid_hash)
>>> + ),
>>> +
>>> + TP_fast_assign(
>>> + __entry->error = cb_error < 0 ? -cb_error : 0;
>>> + __entry->fhandle = nfs_fhandle_hash(cb_fh);
>>> + __entry->cb_stateid_seq =
>>> + be32_to_cpu(cb_stateid->seqid);
>>> + __entry->cb_stateid_hash =
>>> + nfs_stateid_hash(cb_stateid);
>>> + __entry->cb_count = cb_count;
>>> + __entry->cb_how = cb_how_stable;
>>> + ),
>>> +
>>> + TP_printk(
>>> + "error=%ld (%s) fhandle=0x%08x cb_stateid=%d:0x%08x "
>>> + "cb_count=%llu cb_how=%s",
>>> + -__entry->error,
>>> + show_nfsv4_errors(__entry->error),
>>> + __entry->fhandle,
>>> + __entry->cb_stateid_seq, __entry->cb_stateid_hash,
>>> + __entry->cb_count,
>>> + show_write_mode(__entry->cb_how)
>>> + )
>>> +);
>>> +
>>> #endif /* CONFIG_NFS_V4_1 */
>>>
>>> #endif /* _TRACE_NFS4_H */
>>> --
>>> 2.27.0
>>>
>>
>> --
>> Chuck Lever
--
Chuck Lever
next prev parent reply other threads:[~2021-10-19 16:36 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-18 22:03 [PATCH 0/7] NFSv4.2 add tracepoints to sparse files and copy Olga Kornievskaia
2021-10-18 22:03 ` [PATCH 1/7] NFSv4.2 add tracepoint to SEEK Olga Kornievskaia
2021-10-19 17:08 ` Anna Schumaker
2021-10-27 7:50 ` kernel test robot
2021-10-18 22:03 ` [PATCH 2/7] NFSv4.2 add tracepoints to FALLOCATE and DEALLOCATE Olga Kornievskaia
2021-10-18 22:03 ` [PATCH 3/7] NFSv4.2 add tracepoint to COPY Olga Kornievskaia
2021-10-19 15:31 ` Chuck Lever III
2021-10-19 15:51 ` Olga Kornievskaia
2021-10-19 16:01 ` Chuck Lever III
2021-10-27 14:28 ` kernel test robot
2021-10-18 22:03 ` [PATCH 4/7] NFSv4.2 add tracepoint to CLONE Olga Kornievskaia
2021-10-18 22:03 ` [PATCH 5/7] NFSv4.2 add tracepoint to CB_OFFLOAD Olga Kornievskaia
2021-10-19 15:16 ` Chuck Lever III
2021-10-19 16:01 ` Olga Kornievskaia
2021-10-19 16:35 ` Chuck Lever III [this message]
2021-10-18 22:03 ` [PATCH 6/7] NFSv4.2 add tracepoint to COPY_NOTIFY Olga Kornievskaia
2021-10-18 22:03 ` [PATCH 7/7] NFSv4.2 add tracepoint to OFFLOAD_CANCEL Olga Kornievskaia
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=C818DA0E-207F-4FFC-AC38-61F58C131787@oracle.com \
--to=chuck.lever@oracle.com \
--cc=anna.schumaker@netapp.com \
--cc=linux-nfs@vger.kernel.org \
--cc=olga.kornievskaia@gmail.com \
--cc=steved@redhat.com \
--cc=trond.myklebust@hammerspace.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox