Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp762295rdb; Fri, 26 Jan 2024 09:50:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IG2aXoCUpuEEFD1bJvhGJdIOfBKi41h+OgCQeaMaCtEENaqk1HrACAghNNEZoRf7TdEnmA1 X-Received: by 2002:a05:6a20:6e93:b0:19a:b7e5:7f05 with SMTP id gr19-20020a056a206e9300b0019ab7e57f05mr46598pzb.124.1706291426043; Fri, 26 Jan 2024 09:50:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706291426; cv=pass; d=google.com; s=arc-20160816; b=hkvm+t2Mb3iYRow8HrZlLQuAITlga9ycCV52UJp3JrYjVPWI/I9NgIdI3TEUJxgbYu /3u2ZUnFDrkrWux1YVxvvo3dge2563lsZfJ7HgJuF2mNpG5nsrem3DnkoLqlHEi2j0y7 5vnOthTV53+gfw8Xm5rnNeJJNcR28hoPjHTfF9wCasEpOI9K/rckFzk4CViUpVIG7DQf GgMAc68R1EhX7qw1uffPDgV6Yhx860RHHzx/UbAs5nbI6YfjGl2bSj6T+PnAGF+0Btqw Jo5AqTWSXVWh+DlsPKr69QXPTQdmYfCE4uxO8ik9DaKSXcBbF6vIrU5SBFcDmaAeLI/r Xz8g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:user-agent:references:in-reply-to :message-id:date:to:from:subject:dkim-signature; bh=w0Vr3nmiyMDsuFbvuwMJo1tMZdIot7SeZDkmilEJRoo=; fh=Mys3y4MwsHRytUQMpdfGBn3oGRYLcLloxNwkFYMYMmg=; b=db+IIAVG4fQ+fJQlfCBia1E2dTw8C7FL+fv2suYfxfrdXtBsaebUh7txNuMwjK83a6 YkuhQCzsKTK5ygdxzRoRYCexlc99kbfwwIID4sbwEVrgiaMyWSveGRAjviySRMjc2qqf 2DSCAy0j/TzGzkil8g1ts6ZWOWIBhu/ob26V/L2VXmqjax/sGa9Z/MdvEE/8r8Y5GJIQ nECtlJ7/j4nD4OUnBStN4MwJNZyeaUeNHj+P3w9CjxS9n5YYMbzjZR0tRsijJJlMKkt0 8cA22eXLUpWQXA08Tg6YJEzr53+OfheLisrolFdcnvy5hoaOXpw4fC5t+Rn+7ySH9M2C MkoQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FaaRCeiL; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-nfs+bounces-1495-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1495-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id bx31-20020a056a02051f00b005cdf7e87091si1491641pgb.248.2024.01.26.09.50.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jan 2024 09:50:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-1495-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FaaRCeiL; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-nfs+bounces-1495-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1495-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 8BBD6B240CE for ; Fri, 26 Jan 2024 17:47:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 57B2C208DA; Fri, 26 Jan 2024 17:45:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FaaRCeiL" X-Original-To: linux-nfs@vger.kernel.org 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 324EB208A7 for ; Fri, 26 Jan 2024 17:45:49 +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=1706291150; cv=none; b=PzzNQqrY6Ov3V55cJzRF+yQviwBWx6PIucvvp4bAJ7ctpjoKcSAV3lJaRkGQwKncnw8jAI2pN/UPJFomv3jwxuag2J0CSVmcO8E9/TzUNVEdBrsoRheW1+h77ygYv8Jg0gnADdeWdZysqp1FmaY8LH8HPrOCz0H6tAMGQIz4aPc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706291150; c=relaxed/simple; bh=p6AHnFHKX18WddjVdsVpNt9qXCxw0HaBX+zRFxXcUZU=; h=Subject:From:To:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=aCjrjPjv924iuzAOpovtaHcRWsPJmgHCINFA3ApSpjoWJCX7p82wPSLL2w+M/P6lexLBM72Yk/wBhZGU1gcENSUKHVA4cZWJnBrsRThYPTWCKZFU3HMRfcl6QSiZnYL7meXB4E5TaLNyLeEKV4cn0iDIrpORXLgFhymXFmEb1K0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FaaRCeiL; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9DF29C43143 for ; Fri, 26 Jan 2024 17:45:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706291149; bh=p6AHnFHKX18WddjVdsVpNt9qXCxw0HaBX+zRFxXcUZU=; h=Subject:From:To:Date:In-Reply-To:References:From; b=FaaRCeiLkK0fHj8Re92ribO/2HSgWzDjIRg1esa94XyH2Zjbc57a3UPQEzEA+DAAh w43XD3ait6tq39kw7sbZaXKpDBzZERTSb7JotPkiUNRKLJ+bXw+STrw4iZtUiBZZ2K XtL6CvaL5UdmaPvzLhtIOlSa1LB43K/kkN/JspnPgzem/cCEnCjeLWaJIgeSdzFJTo KufcZmYdHEUTOOYRZgF8oJ2zMNgwBxHaBgsKE+yyDk8EICrhQTVhaByYmn7q2NHJ7b 26hxP6/9yRahCSCNT70Is1tIaIt4jmvjU/rRz/CbBTXbjBANm1db8rGf49p8Aiakk/ 7hsHHEBRZD1rA== Subject: [PATCH 2 06/14] NFSD: Replace dprintks in nfsd4_cb_sequence_done() From: Chuck Lever To: linux-nfs@vger.kernel.org Date: Fri, 26 Jan 2024 12:45:48 -0500 Message-ID: <170629114861.20612.12626133349616644679.stgit@manet.1015granger.net> In-Reply-To: <170629091560.20612.563908774748586696.stgit@manet.1015granger.net> References: <170629091560.20612.563908774748586696.stgit@manet.1015granger.net> User-Agent: StGit/1.5 Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit From: Chuck Lever Improve observability of backchannel session operation. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever --- fs/nfsd/nfs4callback.c | 9 ++--- fs/nfsd/trace.h | 82 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+), 5 deletions(-) diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c index 3bff14241b3c..78d9939cf4b0 100644 --- a/fs/nfsd/nfs4callback.c +++ b/fs/nfsd/nfs4callback.c @@ -1165,6 +1165,8 @@ static bool nfsd4_cb_sequence_done(struct rpc_task *task, struct nfsd4_callback if (!cb->cb_holds_slot) goto need_restart; + /* This is the operation status code for CB_SEQUENCE */ + trace_nfsd_cb_seq_status(task, cb); switch (cb->cb_seq_status) { case 0: /* @@ -1210,13 +1212,10 @@ static bool nfsd4_cb_sequence_done(struct rpc_task *task, struct nfsd4_callback break; default: nfsd4_mark_cb_fault(cb->cb_clp, cb->cb_seq_status); - dprintk("%s: unprocessed error %d\n", __func__, - cb->cb_seq_status); } - nfsd41_cb_release_slot(cb); - dprintk("%s: freed slot, new seqid=%d\n", __func__, - clp->cl_cb_session->se_cb_seq_nr); + + trace_nfsd_cb_free_slot(task, cb); if (RPC_SIGNALLED(task)) goto need_restart; diff --git a/fs/nfsd/trace.h b/fs/nfsd/trace.h index 38d11b43779c..c134c755ae5d 100644 --- a/fs/nfsd/trace.h +++ b/fs/nfsd/trace.h @@ -9,8 +9,10 @@ #define _NFSD_TRACE_H #include +#include #include #include +#include #include "export.h" #include "nfsfh.h" @@ -1440,6 +1442,86 @@ TRACE_EVENT(nfsd_cb_setup_err, __entry->error) ); +TRACE_EVENT(nfsd_cb_seq_status, + TP_PROTO( + const struct rpc_task *task, + const struct nfsd4_callback *cb + ), + TP_ARGS(task, cb), + TP_STRUCT__entry( + __field(unsigned int, task_id) + __field(unsigned int, client_id) + __field(u32, cl_boot) + __field(u32, cl_id) + __field(u32, seqno) + __field(u32, reserved) + __field(int, tk_status) + __field(int, seq_status) + ), + TP_fast_assign( + const struct nfs4_client *clp = cb->cb_clp; + const struct nfsd4_session *session = clp->cl_cb_session; + const struct nfsd4_sessionid *sid = + (struct nfsd4_sessionid *)&session->se_sessionid; + + __entry->task_id = task->tk_pid; + __entry->client_id = task->tk_client ? + task->tk_client->cl_clid : -1; + __entry->cl_boot = sid->clientid.cl_boot; + __entry->cl_id = sid->clientid.cl_id; + __entry->seqno = sid->sequence; + __entry->reserved = sid->reserved; + __entry->tk_status = task->tk_status; + __entry->seq_status = cb->cb_seq_status; + ), + TP_printk(SUNRPC_TRACE_TASK_SPECIFIER + " sessionid=%08x:%08x:%08x:%08x tk_status=%d seq_status=%d\n", + __entry->task_id, __entry->client_id, + __entry->cl_boot, __entry->cl_id, + __entry->seqno, __entry->reserved, + __entry->tk_status, __entry->seq_status + ) +); + +TRACE_EVENT(nfsd_cb_free_slot, + TP_PROTO( + const struct rpc_task *task, + const struct nfsd4_callback *cb + ), + TP_ARGS(task, cb), + TP_STRUCT__entry( + __field(unsigned int, task_id) + __field(unsigned int, client_id) + __field(u32, cl_boot) + __field(u32, cl_id) + __field(u32, seqno) + __field(u32, reserved) + __field(u32, slot_seqno) + ), + TP_fast_assign( + const struct nfs4_client *clp = cb->cb_clp; + const struct nfsd4_session *session = clp->cl_cb_session; + const struct nfsd4_sessionid *sid = + (struct nfsd4_sessionid *)&session->se_sessionid; + + __entry->task_id = task->tk_pid; + __entry->client_id = task->tk_client ? + task->tk_client->cl_clid : -1; + __entry->cl_boot = sid->clientid.cl_boot; + __entry->cl_id = sid->clientid.cl_id; + __entry->seqno = sid->sequence; + __entry->reserved = sid->reserved; + __entry->slot_seqno = session->se_cb_seq_nr; + ), + TP_printk(SUNRPC_TRACE_TASK_SPECIFIER + " sessionid=%08x:%08x:%08x:%08x new slot seqno=%u\n", + __entry->task_id, __entry->client_id, + __entry->cl_boot, __entry->cl_id, + __entry->seqno, __entry->reserved, + __entry->slot_seqno + ) +); + TRACE_EVENT_CONDITION(nfsd_cb_recall, TP_PROTO( const struct nfs4_stid *stid