All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chuck Lever <chuck.lever@oracle.com>
To: linux-nfs@vger.kernel.org
Cc: dwysocha@redhat.com, bfields@fieldses.org
Subject: [PATCH v3 06/24] NFSD: Add nfsd_clid_confirmed tracepoint
Date: Fri, 14 May 2021 15:55:48 -0400	[thread overview]
Message-ID: <162102214829.10915.87138989011618600.stgit@klimt.1015granger.net> (raw)
In-Reply-To: <162102191240.10915.5003178983503027218.stgit@klimt.1015granger.net>

This replaces a dprintk call site in order to get greater visibility
on when client IDs are confirmed or re-used. Simple example:

            nfsd-995   [000]   126.622975: nfsd_compound:        xid=0x3a34e2b1 opcnt=1
            nfsd-995   [000]   126.623005: nfsd_cb_args:         addr=192.168.2.51:45901 client 60958e3b:9213ef0e prog=1073741824 ident=1
            nfsd-995   [000]   126.623007: nfsd_compound_status: op=1/1 OP_SETCLIENTID status=0
            nfsd-996   [001]   126.623142: nfsd_compound:        xid=0x3b34e2b1 opcnt=1
  >>>>      nfsd-996   [001]   126.623146: nfsd_clid_confirmed:  client 60958e3b:9213ef0e
            nfsd-996   [001]   126.623148: nfsd_cb_probe:        addr=192.168.2.51:45901 client 60958e3b:9213ef0e state=UNKNOWN
            nfsd-996   [001]   126.623154: nfsd_compound_status: op=1/1 OP_SETCLIENTID_CONFIRM status=0

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 fs/nfsd/nfs4state.c |   10 +++++-----
 fs/nfsd/trace.h     |    1 +
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 69405cc9d823..37cef1f498e1 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -2816,14 +2816,14 @@ move_to_confirmed(struct nfs4_client *clp)
 
 	lockdep_assert_held(&nn->client_lock);
 
-	dprintk("NFSD: move_to_confirm nfs4_client %p\n", clp);
 	list_move(&clp->cl_idhash, &nn->conf_id_hashtbl[idhashval]);
 	rb_erase(&clp->cl_namenode, &nn->unconf_name_tree);
 	add_clp_to_name_tree(clp, &nn->conf_name_tree);
-	if (!test_and_set_bit(NFSD4_CLIENT_CONFIRMED, &clp->cl_flags) &&
-	    clp->cl_nfsd_dentry &&
-	    clp->cl_nfsd_info_dentry)
-		fsnotify_dentry(clp->cl_nfsd_info_dentry, FS_MODIFY);
+	if (!test_and_set_bit(NFSD4_CLIENT_CONFIRMED, &clp->cl_flags)) {
+		trace_nfsd_clid_confirmed(&clp->cl_clientid);
+		if (clp->cl_nfsd_dentry && clp->cl_nfsd_info_dentry)
+			fsnotify_dentry(clp->cl_nfsd_info_dentry, FS_MODIFY);
+	}
 	renew_client_locked(clp);
 }
 
diff --git a/fs/nfsd/trace.h b/fs/nfsd/trace.h
index 1265d6f058ee..c3d47fd68ff5 100644
--- a/fs/nfsd/trace.h
+++ b/fs/nfsd/trace.h
@@ -511,6 +511,7 @@ DEFINE_EVENT(nfsd_clientid_class, nfsd_clid_##name, \
 	TP_PROTO(const clientid_t *clid), \
 	TP_ARGS(clid))
 
+DEFINE_CLIENTID_EVENT(confirmed);
 DEFINE_CLIENTID_EVENT(expired);
 DEFINE_CLIENTID_EVENT(purged);
 DEFINE_CLIENTID_EVENT(renew);



  parent reply	other threads:[~2021-05-14 19:55 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-14 19:55 [PATCH v3 00/24] NFSD callback and lease management observability Chuck Lever
2021-05-14 19:55 ` [PATCH v3 01/24] NFSD: Fix TP_printk() format specifier in nfsd_clid_class Chuck Lever
2021-05-14 19:55 ` [PATCH v3 02/24] NFSD: Add an RPC authflavor tracepoint display helper Chuck Lever
2021-05-14 19:55 ` [PATCH v3 03/24] NFSD: Add nfsd_clid_cred_mismatch tracepoint Chuck Lever
2021-05-14 19:55 ` [PATCH v3 04/24] NFSD: Add nfsd_clid_verf_mismatch tracepoint Chuck Lever
2021-05-14 19:55 ` [PATCH v3 05/24] NFSD: Remove trace_nfsd_clid_inuse_err Chuck Lever
2021-05-14 19:55 ` Chuck Lever [this message]
2021-05-14 19:55 ` [PATCH v3 07/24] NFSD: Add nfsd_clid_reclaim_complete tracepoint Chuck Lever
2021-05-14 19:56 ` [PATCH v3 08/24] NFSD: Add nfsd_clid_destroyed tracepoint Chuck Lever
2021-05-14 19:56 ` [PATCH v3 09/24] NFSD: Add a couple more nfsd_clid_expired call sites Chuck Lever
2021-05-14 19:56 ` [PATCH v3 10/24] NFSD: Add tracepoints for SETCLIENTID edge cases Chuck Lever
2021-05-14 19:56 ` [PATCH v3 11/24] NFSD: Add tracepoints for EXCHANGEID " Chuck Lever
2021-05-14 19:56 ` [PATCH v3 12/24] NFSD: Constify @fh argument of knfsd_fh_hash() Chuck Lever
2021-05-14 19:56 ` [PATCH v3 13/24] NFSD: Capture every CB state transition Chuck Lever
2021-05-14 19:56 ` [PATCH v3 14/24] NFSD: Drop TRACE_DEFINE_ENUM for NFSD4_CB_<state> macros Chuck Lever
2021-05-14 19:56 ` [PATCH v3 15/24] NFSD: Add cb_lost tracepoint Chuck Lever
2021-05-14 19:56 ` [PATCH v3 16/24] NFSD: Adjust cb_shutdown tracepoint Chuck Lever
2021-05-14 19:56 ` [PATCH v3 17/24] NFSD: Remove spurious cb_setup_err tracepoint Chuck Lever
2021-05-14 19:57 ` [PATCH v3 18/24] NFSD: Enhance the nfsd_cb_setup tracepoint Chuck Lever
2021-05-14 19:57 ` [PATCH v3 19/24] NFSD: Add an nfsd_cb_lm_notify tracepoint Chuck Lever
2021-05-14 19:57 ` [PATCH v3 20/24] NFSD: Add an nfsd_cb_offload tracepoint Chuck Lever
2021-05-14 19:57 ` [PATCH v3 21/24] NFSD: Replace the nfsd_deleg_break tracepoint Chuck Lever
2021-05-14 19:57 ` [PATCH v3 22/24] NFSD: Add an nfsd_cb_probe tracepoint Chuck Lever
2021-05-14 19:57 ` [PATCH v3 23/24] NFSD: Remove the nfsd_cb_work and nfsd_cb_done tracepoints Chuck Lever
2021-05-14 19:57 ` [PATCH v3 24/24] NFSD: Update nfsd_cb_args tracepoint Chuck Lever

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=162102214829.10915.87138989011618600.stgit@klimt.1015granger.net \
    --to=chuck.lever@oracle.com \
    --cc=bfields@fieldses.org \
    --cc=dwysocha@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.