Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp69684rdb; Thu, 25 Jan 2024 08:29:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IGWWw7fn+8qt5N5Yb6U5jt/GgVAVhXzm4jrtdNBW2WKQBHPwT+KIOJc2Lq/eLrLwTV/OBhU X-Received: by 2002:a05:620a:3181:b0:783:a929:a3f0 with SMTP id bi1-20020a05620a318100b00783a929a3f0mr1676356qkb.154.1706200154415; Thu, 25 Jan 2024 08:29:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706200154; cv=pass; d=google.com; s=arc-20160816; b=dd9clIrTA0H86ILn/YAhDVc9iNWxvoMZTSme2noKxfBcNubEwAeuUXH356NzChpuGm 3OONINey6Rqr8D9Y4xw5ivf9rY5oZ1JMeehu9Vb2tZcFzKPBSDrbSe+wBEH86HwM5SJS o8AF0NftmhdD+tlZTsJ/GAhqDrp2pDrq0pJEFmpfYsdrfzEhgNkqqcPt4iSjuj9rzzNq EtC3CB/73UqpmoT9wBytKC5Y7+OKj/PtK4RCwkkgtEBs1XRYDY1PmJbZy/yNoROG/BPU HVu4H1/GgE3rZzF81GtIbrjT0v/+lh2f3gME5wTEHhkACAzPIMGzabqleEW6STWgg9/n 3i3A== 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=Be1o5YcofOuDQGIquHsvxPe+zPFnQVBBBcoB/QA+nfM=; fh=Mys3y4MwsHRytUQMpdfGBn3oGRYLcLloxNwkFYMYMmg=; b=xcwyi0cGjo/Ph89JkKMGrm+oCQLfBrNipvrxLLgpPLspoHStaMSgM/9LMEXX5VR0lo YWvJ2THvFZqVAjlR0urEBZiol3gqGl6hhkE6epq6IN5tbY+nHcd2PD+vbtZwlr2UhcnK jqOQCxyqYg0RJh/v95Q1pGnLbzTVLGebu75nSMrLMD8eX4Jd2s76y8kBgBkDObTrthHx w3kID3kM1t8DeKIZzRND39IDbow2HrTgXmKMjJ+afyG9LmTU6+8xzgJhmYxdcQarUG+g ADDg63wJjeY1nF2RopaD0M7C5KfryzkeISZ5x6oXIPu1ZLG0LMbkau3ENX09CHnxoPST PzBQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Lr9m2JgI; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-nfs+bounces-1391-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1391-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id w20-20020a05620a445400b00783c7fe92basi185316qkp.364.2024.01.25.08.29.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 08:29:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-1391-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Lr9m2JgI; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-nfs+bounces-1391-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1391-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 200561C24D8F for ; Thu, 25 Jan 2024 16:29:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8033C7762A; Thu, 25 Jan 2024 16:29:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Lr9m2JgI" 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 5D19E73177 for ; Thu, 25 Jan 2024 16:29:13 +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=1706200153; cv=none; b=UcT4/h/zbU/E1WWaQ2lGKqbfvsUFY669NzlERElAAPGPRzHDrKjS0IQDUntwyE1EpiFeBqq+Hdyct+VQyzC4MOop4f4EGIk2+4blIyl0VXyNr3kG9pS3fFVYw0CiesYjhR3DWKjLQMgTg5AJmwERz+U2bPql3oQ1/VZEHAKfCJ8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706200153; c=relaxed/simple; bh=yg1cathIUyrV9IS6y9PWgPaIGAsOOS1P24iPNTZKq58=; h=Subject:From:To:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=CRFnchcTiPwcZ44r54oLxUD1kS08wSE8j0E1dLRo/YKYgBLNuXFulh0zDkKggdLMe7g3M8dtFdtWpNNHDh803pnk+BcEo6HhToVIKfiRYXX+MuFvPBARoOOvI8gVKFJw0acqIIlPRCjCHtHXag8tGhpGHZ4zMDTxxLSLlV+jCbs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Lr9m2JgI; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id CCF91C433F1 for ; Thu, 25 Jan 2024 16:29:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706200153; bh=yg1cathIUyrV9IS6y9PWgPaIGAsOOS1P24iPNTZKq58=; h=Subject:From:To:Date:In-Reply-To:References:From; b=Lr9m2JgIJ904brilZ2ichIILSswrLRueCRoWDIPA7eXt0Ejo+pQc9Y026Uyheffl5 K3BmcWnohsq++yrpP0GA8qQamkmasazj1J5QWYbXkmbl1C8Yq8LbnsKCmvT2N1sQb4 NcacEhvt+MCJatoJgBwTQpl7AxvXx+BU2pKMP1hVTFmIaPylpJHvIG1mV9Bz8Q7WR5 LJlF6a0uJlpAD+mUp+qSCWYjVqyzanxF2yO7pZY8DBAdBPeezMzIzc3sBlVEquuJ1k IoH3liyYLmhiW3ETHO/EDu9an+5GeXwMKPioKG1ZzfBKBprApnIoeSDct/aKOJFbuH icTjoT0WQJQvw== Subject: [PATCH RFC 05/13] NFSD: Replace dprintks in nfsd4_cb_sequence_done() From: Chuck Lever To: linux-nfs@vger.kernel.org Date: Thu, 25 Jan 2024 11:29:11 -0500 Message-ID: <170620015178.2833.16037962437262794375.stgit@manet.1015granger.net> In-Reply-To: <170619984210.2833.7173004255003914651.stgit@manet.1015granger.net> References: <170619984210.2833.7173004255003914651.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. 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 1ff64efe1f5c..9f5aebeef83c 100644 --- a/fs/nfsd/nfs4callback.c +++ b/fs/nfsd/nfs4callback.c @@ -1158,6 +1158,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: /* @@ -1203,13 +1205,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