nfsd: add tracepoint in mark_client_expired_locked

Show client info alongside the number of cl_rpc_users. If that's
elevated, then we can infer that this function returned nfserr_jukebox.

[ cel: For additional debugging of RPC user refcounting ]

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Tested-by: Vladimir Benes <vbenes@redhat.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
This commit is contained in:
Jeff Layton 2024-04-05 14:40:51 -04:00 committed by Chuck Lever
parent 2d49901150
commit 9320f27fda
2 changed files with 29 additions and 1 deletions

View File

@ -2347,7 +2347,11 @@ unhash_client(struct nfs4_client *clp)
static __be32 mark_client_expired_locked(struct nfs4_client *clp)
{
if (atomic_read(&clp->cl_rpc_users))
int users = atomic_read(&clp->cl_rpc_users);
trace_nfsd_mark_client_expired(clp, users);
if (users)
return nfserr_jukebox;
unhash_client_locked(clp);
return nfs_ok;

View File

@ -848,6 +848,30 @@ DEFINE_CLIENTID_EVENT(purged);
DEFINE_CLIENTID_EVENT(renew);
DEFINE_CLIENTID_EVENT(stale);
TRACE_EVENT(nfsd_mark_client_expired,
TP_PROTO(
const struct nfs4_client *clp,
int cl_rpc_users
),
TP_ARGS(clp, cl_rpc_users),
TP_STRUCT__entry(
__field(int, cl_rpc_users)
__field(u32, cl_boot)
__field(u32, cl_id)
__sockaddr(addr, clp->cl_cb_conn.cb_addrlen)
),
TP_fast_assign(
__entry->cl_rpc_users = cl_rpc_users;
__entry->cl_boot = clp->cl_clientid.cl_boot;
__entry->cl_id = clp->cl_clientid.cl_id;
__assign_sockaddr(addr, &clp->cl_cb_conn.cb_addr,
clp->cl_cb_conn.cb_addrlen)
),
TP_printk("addr=%pISpc client %08x:%08x cl_rpc_users=%d",
__get_sockaddr(addr), __entry->cl_boot, __entry->cl_id,
__entry->cl_rpc_users)
);
DECLARE_EVENT_CLASS(nfsd_net_class,
TP_PROTO(const struct nfsd_net *nn),
TP_ARGS(nn),