From patchwork Mon Aug 26 12:50:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 13777899 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A1F7718BB97; Mon, 26 Aug 2024 12:50:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724676615; cv=none; b=jGQMuhCWdeoWKPoQmxPNtaEnV8wOYazXG4T4FNxghj4iinRRRUomqNt8ma3xBOpw9DhQXV5XLAdQDPgzxSyDOpWMoPi/9ZiD5LkFRkOR+u2U4CtYh/C+Zk6+5nDjBpd/AX8HlLfR+6wNYrnetGgQaRgWaCvYSOv+WFLABA6K674= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724676615; c=relaxed/simple; bh=uX/vVKUZWx7C0IhR59T1sW5G6FbuARVCQ2QSeOWChrA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Oi5vDSH9fgpYgSefpVQuXtE7ieMp8vGzdYr/l9SbcOadrymoE7DN7n8LL6a5iUV9jhaVPIUKjvU1881w+BeffiZ3LZtH7wH56yJbjCWfENgnuZMxjxjBTi4e0PU/PzNYO483pYHEOEEV42LAZvG4lS80CscikTDtBq/3Ssu3p6A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=OrLEccks; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="OrLEccks" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 80FFCC4FEF0; Mon, 26 Aug 2024 12:50:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1724676615; bh=uX/vVKUZWx7C0IhR59T1sW5G6FbuARVCQ2QSeOWChrA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=OrLEccksyqdhhi69bEerGQ6cSSpYqm7eyreWBeuo+LhEurso51M4OP7wGFaH/l+iM Th8eujaI4goDs6kzgoef+a21p9z+wLGITMBJMjUwFxiDbQi2pV03+RRZW24ehofbTs gn59HVUJwj4Iu4QrsDMviRhXB6GxnsCYtK1RItT5ES1lVQUso3X/HxEbZih24DXZZ5 TQ09Z0mOq0vdjIpHB4bGYJsa8kp6Frt0CxLMDrmhZxOvHBsT4pEQk5MzT9lt1wIctG n1M6ocYKMA+ig4x/MqvQ3vJzJm8/IIkG2qzY2LdeRTSTVHQuGtn5gLvxWqNw3qov+p qqp+4T9pZKJIA== From: Jeff Layton Date: Mon, 26 Aug 2024 08:50:11 -0400 Subject: [PATCH 1/3] nfsd: add more info to WARN_ON_ONCE on failed callbacks Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240826-nfsd-cb-v1-1-82d3a4e5913b@kernel.org> References: <20240826-nfsd-cb-v1-0-82d3a4e5913b@kernel.org> In-Reply-To: <20240826-nfsd-cb-v1-0-82d3a4e5913b@kernel.org> To: Chuck Lever , Neil Brown , Olga Kornievskaia , Dai Ngo , Tom Talpey Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, Jeff Layton X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=743; i=jlayton@kernel.org; h=from:subject:message-id; bh=uX/vVKUZWx7C0IhR59T1sW5G6FbuARVCQ2QSeOWChrA=; b=owEBbQKS/ZANAwAIAQAOaEEZVoIVAcsmYgBmzHoFDZVH1tpRPHbaIdVGOIdT5qpP/tPk5SDWx +GdrT5eJqOJAjMEAAEIAB0WIQRLwNeyRHGyoYTq9dMADmhBGVaCFQUCZsx6BQAKCRAADmhBGVaC FWh5D/9+CM/Y3KA63VAgrlPq7Hv+Dh5GfwT6xbX0uQDetwXlgXCm8S2boR+tZ765rLtBpZ4y1y8 NfhOm13EsRaI3vMWRl2OV+R4J7xjWcOHDoUTMmuuZ3ivFyRWoaDM8nknO7vI6V3A+/EO0hPZeph jIEpC9M1iSa55tP2W7kVzNmhRiCquh/ThACzAVMgPFbthw5xJxt8O3ERtEbMXstqWphe/XiuWID CxyroemAqArBwDovo2oY+bqtZIi7j1Ih7mtfSeRXDcfwGLSIc1jUEokZImsQ2pSfobw8Xl+4AaY L9X3HyZ8E//7aBB3gWEFmnRyNxYmpRSy6OWh/6QKQIhlAzpGWEYiWsCqMHS7wnzOeVbDW2X0RL7 8kH8v9ZxzEFkVC9tb+FSdC+vV8mkbzXqMQ/QNB/RNPLgXZ1yG2l/icG4pHxT355wX4cT93lQTUd mkBSk4ND4sshtxGEnaLjD1XZXGGYJiPlRiNP4E5cei5mlEk50/yUNTtzWpJxfpTIW9jS/uJf1CF AzGtrgDnoVIU+4UrE9pRZbEXSOjE8Y5W1nFd6mBL1UCiA9R27bm4inB3K5JUdEmZjviKvr8Eoi0 R+B35gV4ObmHWn7k8Xi5b9sG76Z6UTG8uIzASWAKUK6MLFTCubNwuFqdZafvdAIz1QZjA/OdbU9 UK4YVl5mceLL8eA== X-Developer-Key: i=jlayton@kernel.org; a=openpgp; fpr=4BC0D7B24471B2A184EAF5D3000E684119568215 Currently, you get the warning and stack trace, but nothing is printed about the relevant error codes. Add that in. Signed-off-by: Jeff Layton --- fs/nfsd/nfs4callback.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c index d756f443fc44..dee9477cc5b5 100644 --- a/fs/nfsd/nfs4callback.c +++ b/fs/nfsd/nfs4callback.c @@ -1333,7 +1333,8 @@ static void nfsd4_cb_done(struct rpc_task *task, void *calldata) return; if (cb->cb_status) { - WARN_ON_ONCE(task->tk_status); + WARN_ONCE(task->tk_status, "cb_status=%d tk_status=%d", + cb->cb_status, task->tk_status); task->tk_status = cb->cb_status; } From patchwork Mon Aug 26 12:50:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 13777900 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9017B18C907; Mon, 26 Aug 2024 12:50:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724676616; cv=none; b=oC4hruiAOWpHUKrn5MCDlBOQQqPzl3aG3nzT/7xt4Keb/Yhc+EkT1EzOWzvz9z6ra8sl4EUzM1ON2XR4pJTLOy3UPQkmz9zBWcxEfZl6peGLwMa1b4vhbDzr91kE+qVZZGiWTKuQsg3Z4bnzxa+IfUkhbXl8bVfKA79YUN4k6tU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724676616; c=relaxed/simple; bh=MQR0S4IRyQKASIeLaUjbSY5DKEzIU5scNL67pkVOjw4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=D2WCFp9rqU1CTT+2ng8neY6dVp16fUyRdpACTj0NyrydwjEvYUPgpFxzwbn8w/R0KcmlnoUzPnn29daY4BoejJDfdrGRx9+46/CMGcdziI4O7PcyEqmx6djYzFNY7SNnD/H+isBa1NRheIx22ZSAi69h2SXWji0Mm38SFMzU30I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=UGc9QE9S; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="UGc9QE9S" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6E654C4FEEE; Mon, 26 Aug 2024 12:50:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1724676616; bh=MQR0S4IRyQKASIeLaUjbSY5DKEzIU5scNL67pkVOjw4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=UGc9QE9Shj8Qt8nDb5If7BLMGFbRAb0rfDfCmWNbOlXJTlLw8AwiUbiikGldBKsAH 2nXH7bm69V/y5lOZOU6EskaVqvcA6f4TGrClumwcv+3cocwvE3TCc3p12o/LXxB/Fa FvSFL1TJ9O9Of3a9lSUIHS+QrcWVUxvszydDhEMB4Fytq0eFyhFp4w6fl8geeA4QWO vybvJk8RQTvu/Ls0nkqia27cULIdOLDFfCSBywGqppLX8S7jsWZFF44Sa/r8UDSup8 aTNt/mVmUBH0i+kxh+Nz+r1sr/R6p+qtqhuggWQZiHaPLIkICA46ROKAqkg4Y/2Iv5 Ii8rpvEL8oznQ== From: Jeff Layton Date: Mon, 26 Aug 2024 08:50:12 -0400 Subject: [PATCH 2/3] nfsd: track the main opcode for callbacks Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240826-nfsd-cb-v1-2-82d3a4e5913b@kernel.org> References: <20240826-nfsd-cb-v1-0-82d3a4e5913b@kernel.org> In-Reply-To: <20240826-nfsd-cb-v1-0-82d3a4e5913b@kernel.org> To: Chuck Lever , Neil Brown , Olga Kornievskaia , Dai Ngo , Tom Talpey Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, Jeff Layton X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=4974; i=jlayton@kernel.org; h=from:subject:message-id; bh=MQR0S4IRyQKASIeLaUjbSY5DKEzIU5scNL67pkVOjw4=; b=owEBbQKS/ZANAwAIAQAOaEEZVoIVAcsmYgBmzHoFMymKvgN8Wk/PUtgebDOEWq7hp7p9WMmuA IOx/CQ+JeiJAjMEAAEIAB0WIQRLwNeyRHGyoYTq9dMADmhBGVaCFQUCZsx6BQAKCRAADmhBGVaC FW1ED/91j6Sbg9mPHztH1MYax9ESJyc1+MXdUSWHeyOmg74MRwYy/KY1xphea/FV0K0To2UXtpb owNAcnalPyPhtrWNrBWNzna7OBU3wvAvP/N+1BtweuaqgRQLXyel0VUDmXGvrQH+dUbbtkShehT 9xdHe14gOzivgho6JCN+u0wiOFpII3lgw+56JtR6Dp7w15ZCmptAtEokIq/+p3RKBQ6KppvDY+J Di5VedHF2mMDfQljJ9u+jrJjRWpslhgCt6X7wKDyduC1KNEw3mMSbwtuatEb+VhkkbyvEzayZJ1 C3Hoqw7tb9jXmsBL5rRXaRqCvHmfqWtEjzvrEEapg6NAja4cAK86a6l8lUFo1ayIq1lnI8EjUVd FvpVcpuPkb1jjY4ayC/Vr8HwX+LbyIC9ww5MrZSdAOCBRUhiODMHcWM/yMjH+j6JHwnQvIzm6Fz behHkY5yTQ6uIqYKaApM9M4x1oJRlsb9CoCuvBrAxvmJ0un+IqHGzMFoGPSdWr0HHZ/+AkzI6u7 5OH2YbsnUNVFlt5ttCARM1mI7ryFRyPZMWVZhMQy2gJpiTsWH0XH12/2jex06VAQ3BUAGcShLBC hz8uHPU8GbkZCNT+mpFhmTxXya7TC2DagV40k1g39LLtb00QbA4VcS2F7qe4VYD6m4VKWJI3h50 WTRCbuPs4drR+1w== X-Developer-Key: i=jlayton@kernel.org; a=openpgp; fpr=4BC0D7B24471B2A184EAF5D3000E684119568215 Keep track of the "main" opcode for the callback, and display it in the tracepoint. This makes it simpler to discern what's happening when there is more than one callback in flight. The one special case is the CB_NULL RPC. That's not a CB_COMPOUND opcode, so designate the value 0 for that. Signed-off-by: Jeff Layton --- fs/nfsd/nfs4layouts.c | 1 + fs/nfsd/nfs4proc.c | 3 ++- fs/nfsd/nfs4state.c | 4 ++++ fs/nfsd/state.h | 1 + fs/nfsd/trace.h | 23 +++++++++++++++++++---- 5 files changed, 27 insertions(+), 5 deletions(-) diff --git a/fs/nfsd/nfs4layouts.c b/fs/nfsd/nfs4layouts.c index 4f3072b5979a..fbfddd3c4c94 100644 --- a/fs/nfsd/nfs4layouts.c +++ b/fs/nfsd/nfs4layouts.c @@ -740,6 +740,7 @@ static const struct nfsd4_callback_ops nfsd4_cb_layout_ops = { .prepare = nfsd4_cb_layout_prepare, .done = nfsd4_cb_layout_done, .release = nfsd4_cb_layout_release, + .opcode = OP_CB_LAYOUTRECALL, }; static bool diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index 2e39cf2e502a..1dac934686b1 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c @@ -1621,7 +1621,8 @@ static int nfsd4_cb_offload_done(struct nfsd4_callback *cb, static const struct nfsd4_callback_ops nfsd4_cb_offload_ops = { .release = nfsd4_cb_offload_release, - .done = nfsd4_cb_offload_done + .done = nfsd4_cb_offload_done, + .opcode = OP_CB_OFFLOAD, }; static void nfsd4_init_copy_res(struct nfsd4_copy *copy, bool sync) diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index a20c2c9d7d45..2843f623163d 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -400,6 +400,7 @@ static const struct nfsd4_callback_ops nfsd4_cb_notify_lock_ops = { .prepare = nfsd4_cb_notify_lock_prepare, .done = nfsd4_cb_notify_lock_done, .release = nfsd4_cb_notify_lock_release, + .opcode = OP_CB_NOTIFY_LOCK, }; /* @@ -3083,11 +3084,13 @@ nfsd4_cb_getattr_release(struct nfsd4_callback *cb) static const struct nfsd4_callback_ops nfsd4_cb_recall_any_ops = { .done = nfsd4_cb_recall_any_done, .release = nfsd4_cb_recall_any_release, + .opcode = OP_CB_RECALL_ANY, }; static const struct nfsd4_callback_ops nfsd4_cb_getattr_ops = { .done = nfsd4_cb_getattr_done, .release = nfsd4_cb_getattr_release, + .opcode = OP_CB_GETATTR, }; static void nfs4_cb_getattr(struct nfs4_cb_fattr *ncf) @@ -5215,6 +5218,7 @@ static const struct nfsd4_callback_ops nfsd4_cb_recall_ops = { .prepare = nfsd4_cb_recall_prepare, .done = nfsd4_cb_recall_done, .release = nfsd4_cb_recall_release, + .opcode = OP_CB_RECALL, }; static void nfsd_break_one_deleg(struct nfs4_delegation *dp) diff --git a/fs/nfsd/state.h b/fs/nfsd/state.h index ffc217099d19..14f9df2bc1ba 100644 --- a/fs/nfsd/state.h +++ b/fs/nfsd/state.h @@ -79,6 +79,7 @@ struct nfsd4_callback_ops { void (*prepare)(struct nfsd4_callback *); int (*done)(struct nfsd4_callback *, struct rpc_task *); void (*release)(struct nfsd4_callback *); + uint32_t opcode; }; /* diff --git a/fs/nfsd/trace.h b/fs/nfsd/trace.h index 77bbd23aa150..476f278e7115 100644 --- a/fs/nfsd/trace.h +++ b/fs/nfsd/trace.h @@ -1553,6 +1553,19 @@ TRACE_EVENT(nfsd_cb_setup_err, __entry->error) ); +/* Not a real opcode, but there is no 0 operation. */ +#define _CB_NULL 0 + +#define show_nfsd_cb_opcode(val) \ + __print_symbolic(val, \ + { _CB_NULL, "CB_NULL" }, \ + { OP_CB_GETATTR, "CB_GETATTR" }, \ + { OP_CB_RECALL, "CB_RECALL" }, \ + { OP_CB_LAYOUTRECALL, "CB_LAYOUTRECALL" }, \ + { OP_CB_RECALL_ANY, "CB_RECALL_ANY" }, \ + { OP_CB_NOTIFY_LOCK, "CB_NOTIFY_LOCK" }, \ + { OP_CB_OFFLOAD, "CB_OFFLOAD" }) + DECLARE_EVENT_CLASS(nfsd_cb_lifetime_class, TP_PROTO( const struct nfs4_client *clp, @@ -1563,6 +1576,7 @@ DECLARE_EVENT_CLASS(nfsd_cb_lifetime_class, __field(u32, cl_boot) __field(u32, cl_id) __field(const void *, cb) + __field(u32, opcode) __field(bool, need_restart) __sockaddr(addr, clp->cl_cb_conn.cb_addrlen) ), @@ -1570,14 +1584,15 @@ DECLARE_EVENT_CLASS(nfsd_cb_lifetime_class, __entry->cl_boot = clp->cl_clientid.cl_boot; __entry->cl_id = clp->cl_clientid.cl_id; __entry->cb = cb; + __entry->opcode = cb->cb_ops ? cb->cb_ops->opcode : _CB_NULL; __entry->need_restart = cb->cb_need_restart; __assign_sockaddr(addr, &clp->cl_cb_conn.cb_addr, clp->cl_cb_conn.cb_addrlen) ), - TP_printk("addr=%pISpc client %08x:%08x cb=%p%s", - __get_sockaddr(addr), __entry->cl_boot, __entry->cl_id, - __entry->cb, __entry->need_restart ? - " (need restart)" : " (first try)" + TP_printk("addr=%pISpc client %08x:%08x cb=%p%s opcode=%s", + __get_sockaddr(addr), __entry->cl_boot, __entry->cl_id, __entry->cb, + __entry->need_restart ? " (need restart)" : " (first try)", + show_nfsd_cb_opcode(__entry->opcode) ) ); From patchwork Mon Aug 26 12:50:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 13777901 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 89E2918D634; Mon, 26 Aug 2024 12:50:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724676617; cv=none; b=GTX7v64nUoFO+vIEurNN1trD7GfF0xcASqaQug+ixuJ+MWrsyuEk88dAGyf1nUYa/buqRKdqQNn/shSbW4RC32hKAXFnb8NimLPzTq/e1sOBijdPK6H3bkZgbDAuAiuq7cyuO4uSXcSQ0pKIb4+eBVsdW9LjfnPlFqQ9cwTMuYQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724676617; c=relaxed/simple; bh=jaLAOBhtQ23Mxe3I8x/MN/JlMJPGuatZ77ZZrAQldNg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=NTBy0KSo9uKztRjc8ZkYjbdimunS9e/mVJiBr4c2g7eNiQEx3bsC8uLYIyeIye0Yq4OTl8RmZBeiiTUia1Z4RDt97dVycpY85X9OofNwPUUc8HoPr8uxZfD3YtclSYapfKEOCPyk7JcDVtAMoQCucQRRcXJrq5XROY+ke2dGcs0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=a885E9PO; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="a885E9PO" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5BD4FC4FEF0; Mon, 26 Aug 2024 12:50:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1724676617; bh=jaLAOBhtQ23Mxe3I8x/MN/JlMJPGuatZ77ZZrAQldNg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=a885E9PO5/hRZXeEGgslQY+EDoX/O7FfWd3FojTlTnNRKOh8NDCIi29xdiaS26xMl mwuT3T0KvkTctv4Ie97HhG0o0Q8addN+9nUHnKCdlFyrTr5nRDErmt7DKOn/CKuR3j M00MGiYW6brXZanYH/m4ayXgq/6h9O6SFBIHW4F9Zozj2dc7/cAS1Ony4UU+hLc9B7 cI1lGRRRiaFJAgC+UJxDraWZOTh9NhLMfYaUcS6BxyLZ/SILQ8xvKwwf6qIbXKcfDG RE3+3vpK+nRJuwiRcprwmHfSAojJKbtIHvQEP/rgXrSZWBmySOTULyM4R4CrtCQr0U HBTdO2CqGqaDQ== From: Jeff Layton Date: Mon, 26 Aug 2024 08:50:13 -0400 Subject: [PATCH 3/3] nfsd: add more nfsd_cb tracepoints Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240826-nfsd-cb-v1-3-82d3a4e5913b@kernel.org> References: <20240826-nfsd-cb-v1-0-82d3a4e5913b@kernel.org> In-Reply-To: <20240826-nfsd-cb-v1-0-82d3a4e5913b@kernel.org> To: Chuck Lever , Neil Brown , Olga Kornievskaia , Dai Ngo , Tom Talpey Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, Jeff Layton X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2718; i=jlayton@kernel.org; h=from:subject:message-id; bh=jaLAOBhtQ23Mxe3I8x/MN/JlMJPGuatZ77ZZrAQldNg=; b=owEBbQKS/ZANAwAIAQAOaEEZVoIVAcsmYgBmzHoF16TD2KYxszyHQmgDLZBUYzkUDutv3Ob5K tZyEL16IEqJAjMEAAEIAB0WIQRLwNeyRHGyoYTq9dMADmhBGVaCFQUCZsx6BQAKCRAADmhBGVaC FRaSEADW56ICHIlY78FVgCn9+Gd7SNdTLWiTBoVwBKC6wjO5h/47vSH+/9GbzLCIC15zm4yaWNa 2ir9V0jfa6yOoeThPRthiOcsVoZfSlFdFr6P4+9d9IuocU4q6b0X6BI7FOZDatB9gFFdtAk1dCO 8ZvMSLt9eXMO0VJP9xW0AeAdxSXfwUzBvmKKCHqdhDV9Ad0cOgSViU4D+CrV/JdxK2mRgzX95EL HePzP5opDfTHU3MwPXn9V3sWOGZoxfjdPiBKQ7Ol9fODcV+kRQYEM2tzbGk5/jUm5Ifs4gb2eMU 6Ibl4426ReGmDO0B/EM04/AApKpdDb8wd8NpZ9PPTpXxiVOgp0rkrAUQJyL00FscHRL/mEWs+fV pUBr+KtCabujItFSTMBuNHfNhvSD/SykYULr1w5vWl6RQHLdb3jp/2gIPRJw9lfS7lJDcJdb99f yjyZxWirjQnQUgZ3HCfuBjJ+pjO9k+1J++yE+L4Umze08V29Mp7PZyc8nMQS+WNc3sRryhAGryz DsNG1OrMAMzr4QlRlBhR1hm5pCkW7ryeYgW/n9Vc0yvflnYxZUDDZTJft+KoidqMBT3IEpnt+OK HYdCUvnQpF4zBwLsa+kuf8ZzapyF7n4ppSDKao3UC0kmr/v8EKdx04zoGE+uZ7PFALzgqlTPFO+ uNpxPwHCQzlYOsQ== X-Developer-Key: i=jlayton@kernel.org; a=openpgp; fpr=4BC0D7B24471B2A184EAF5D3000E684119568215 Add some tracepoints in the callback client RPC operations. Also add a tracepoint to nfsd4_cb_getattr_done. Signed-off-by: Jeff Layton --- fs/nfsd/nfs4callback.c | 5 +++++ fs/nfsd/nfs4state.c | 3 +++ fs/nfsd/trace.h | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c index dee9477cc5b5..b5b3ab9d719a 100644 --- a/fs/nfsd/nfs4callback.c +++ b/fs/nfsd/nfs4callback.c @@ -1223,6 +1223,7 @@ static void nfsd4_cb_prepare(struct rpc_task *task, void *calldata) * cb_seq_status is only set in decode_cb_sequence4res, * and so will remain 1 if an rpc level failure occurs. */ + trace_nfsd_cb_rpc_prepare(clp); cb->cb_seq_status = 1; cb->cb_status = 0; if (minorversion && !nfsd41_cb_get_slot(cb, task)) @@ -1329,6 +1330,8 @@ static void nfsd4_cb_done(struct rpc_task *task, void *calldata) struct nfsd4_callback *cb = calldata; struct nfs4_client *clp = cb->cb_clp; + trace_nfsd_cb_rpc_done(clp); + if (!nfsd4_cb_sequence_done(task, cb)) return; @@ -1360,6 +1363,8 @@ static void nfsd4_cb_release(void *calldata) { struct nfsd4_callback *cb = calldata; + trace_nfsd_cb_rpc_release(cb->cb_clp); + if (cb->cb_need_restart) nfsd4_queue_cb(cb); else diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 2843f623163d..918d15fb76b2 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -3057,7 +3057,10 @@ nfsd4_cb_getattr_done(struct nfsd4_callback *cb, struct rpc_task *task) { struct nfs4_cb_fattr *ncf = container_of(cb, struct nfs4_cb_fattr, ncf_getattr); + struct nfs4_delegation *dp = + container_of(ncf, struct nfs4_delegation, dl_cb_fattr); + trace_nfsd_cb_getattr_done(&dp->dl_stid.sc_stateid, task); ncf->ncf_cb_status = task->tk_status; switch (task->tk_status) { case -NFS4ERR_DELAY: diff --git a/fs/nfsd/trace.h b/fs/nfsd/trace.h index 476f278e7115..592bf759b85b 100644 --- a/fs/nfsd/trace.h +++ b/fs/nfsd/trace.h @@ -1486,6 +1486,9 @@ DEFINE_NFSD_CB_EVENT(new_state); DEFINE_NFSD_CB_EVENT(probe); DEFINE_NFSD_CB_EVENT(lost); DEFINE_NFSD_CB_EVENT(shutdown); +DEFINE_NFSD_CB_EVENT(rpc_prepare); +DEFINE_NFSD_CB_EVENT(rpc_done); +DEFINE_NFSD_CB_EVENT(rpc_release); TRACE_DEFINE_ENUM(RPC_AUTH_NULL); TRACE_DEFINE_ENUM(RPC_AUTH_UNIX); @@ -1845,6 +1848,7 @@ DEFINE_NFSD_CB_DONE_EVENT(nfsd_cb_recall_done); DEFINE_NFSD_CB_DONE_EVENT(nfsd_cb_notify_lock_done); DEFINE_NFSD_CB_DONE_EVENT(nfsd_cb_layout_done); DEFINE_NFSD_CB_DONE_EVENT(nfsd_cb_offload_done); +DEFINE_NFSD_CB_DONE_EVENT(nfsd_cb_getattr_done); TRACE_EVENT(nfsd_cb_recall_any_done, TP_PROTO(