Commit 9320f27f authored by Jeff Layton's avatar Jeff Layton Committed by Chuck Lever
Browse files

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: default avatarJeff Layton <jlayton@kernel.org>
Tested-by: default avatarVladimir Benes <vbenes@redhat.com>
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
parent 2d499011
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -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;
+24 −0
Original line number Diff line number Diff line
@@ -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),