Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp1846271pxy; Mon, 2 Aug 2021 11:45:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwVOBNccHfnRbsLzrNMfRowhE8N1/dnlRLa75lEa57Km5MENgHhkQrL67Ji9h0ftM44nAZY X-Received: by 2002:a05:6e02:1073:: with SMTP id q19mr301882ilj.110.1627929907458; Mon, 02 Aug 2021 11:45:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627929907; cv=none; d=google.com; s=arc-20160816; b=LIsbyt4/y1JBf82h+AtyuLS8cvCdm3eunTgtJEC33v+cKxqqrEas37GpTnPBUnwCYT a0pxLIKzer5FEpB+PkTHFtWdmSd/bMfST0LUvTnJmTUP+ndBkxm0mKzC8vEzYxl7Hk4l NX9Vo+E1Rcnxz6kJ+JzcKp+UupndVbg3WQxAjMf6D7PJH90GJuMA1gDHlRPemL23OW3o 1QHYMBfqfC4aLN3qIe0xhLxCHSzklqJLqqpo+UmsBC+7fx6rsrbMt+MkyhDQVdsb2w9/ OJ3alfkKnnQodagHqd3VTxBfDfpCGyYvVdoS1PMSg6HwLiSR08YPHwdA/+C7PG9RjSFU SDpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:cc:to:from :subject; bh=wCU+Ptr8CVyWY2jxcdPxrISaK5KDvkJNayErhHdNYjA=; b=BOkW4BpI64wkA8glNa5o7+b6hseAMYsHjWdku2kuQ2jEulZu0AC1MHkJt6Ml9lCdwo JnG/94UDYh/1Kdw1wRoaIG2A1xwSF0mqa1MTMjQS4inGfDy59MSl3zjo2msYCTaqgK49 KUvvU/NKQ2e3Ev4Gr+ky/RrO584vs2rLwe6t4XRANIkDP1BTXJ4GZVpVLm3uoSqGAIf0 kISRiyv4NiGEsWXTG6ZzQsHlhuJ+uvnNc9U/44WbpnEklB+q+lFPi/quhF6I9foHwyQQ ir6zaMLviPWdXlTI/ciwspOI/yyI0d5hejEqUXDiF8fe3zVLKCOV04go+H4G3QmihVNb TsYw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n14si13783864ilk.78.2021.08.02.11.44.51; Mon, 02 Aug 2021 11:45:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229677AbhHBSol (ORCPT + 99 others); Mon, 2 Aug 2021 14:44:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:58560 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229567AbhHBSol (ORCPT ); Mon, 2 Aug 2021 14:44:41 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0EB6B60EC0; Mon, 2 Aug 2021 18:44:30 +0000 (UTC) Subject: [PATCH v1 3/5] xprtrdma: Add xprtrdma_post_recvs_err() tracepoint From: Chuck Lever To: trondmy@hammerspace.com, anna.schumaker@netapp.com Cc: linux-rdma@vger.kernel.org, linux-nfs@vger.kernel.org Date: Mon, 02 Aug 2021 14:44:30 -0400 Message-ID: <162792987034.3902.11838917235968655780.stgit@manet.1015granger.net> In-Reply-To: <162792979429.3902.11831790821518477892.stgit@manet.1015granger.net> References: <162792979429.3902.11831790821518477892.stgit@manet.1015granger.net> User-Agent: StGit/1.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org In the vast majority of cases, rc=0. Don't record that in the post_recvs tracepoint. Instead, add a separate tracepoint that can be left enabled all the time to capture the very rare immediate errors returned by ib_post_recv(). Signed-off-by: Chuck Lever --- include/trace/events/rpcrdma.h | 41 +++++++++++++++++++++++++++++++++------- net/sunrpc/xprtrdma/verbs.c | 3 ++- 2 files changed, 36 insertions(+), 8 deletions(-) diff --git a/include/trace/events/rpcrdma.h b/include/trace/events/rpcrdma.h index bd55908c1bef..d65a84bd040c 100644 --- a/include/trace/events/rpcrdma.h +++ b/include/trace/events/rpcrdma.h @@ -818,16 +818,14 @@ TRACE_EVENT(xprtrdma_post_recv, TRACE_EVENT(xprtrdma_post_recvs, TP_PROTO( const struct rpcrdma_xprt *r_xprt, - unsigned int count, - int status + unsigned int count ), - TP_ARGS(r_xprt, count, status), + TP_ARGS(r_xprt, count), TP_STRUCT__entry( __field(u32, cq_id) __field(unsigned int, count) - __field(int, status) __field(int, posted) __string(addr, rpcrdma_addrstr(r_xprt)) __string(port, rpcrdma_portstr(r_xprt)) @@ -838,15 +836,44 @@ TRACE_EVENT(xprtrdma_post_recvs, __entry->cq_id = ep->re_attr.recv_cq->res.id; __entry->count = count; - __entry->status = status; __entry->posted = ep->re_receive_count; __assign_str(addr, rpcrdma_addrstr(r_xprt)); __assign_str(port, rpcrdma_portstr(r_xprt)); ), - TP_printk("peer=[%s]:%s cq.id=%d %u new recvs, %d active (rc %d)", + TP_printk("peer=[%s]:%s cq.id=%d %u new recvs, %d active", + __get_str(addr), __get_str(port), __entry->cq_id, + __entry->count, __entry->posted + ) +); + +TRACE_EVENT(xprtrdma_post_recvs_err, + TP_PROTO( + const struct rpcrdma_xprt *r_xprt, + int status + ), + + TP_ARGS(r_xprt, status), + + TP_STRUCT__entry( + __field(u32, cq_id) + __field(int, status) + __string(addr, rpcrdma_addrstr(r_xprt)) + __string(port, rpcrdma_portstr(r_xprt)) + ), + + TP_fast_assign( + const struct rpcrdma_ep *ep = r_xprt->rx_ep; + + __entry->cq_id = ep->re_attr.recv_cq->res.id; + __entry->status = status; + __assign_str(addr, rpcrdma_addrstr(r_xprt)); + __assign_str(port, rpcrdma_portstr(r_xprt)); + ), + + TP_printk("peer=[%s]:%s cq.id=%d rc=%d", __get_str(addr), __get_str(port), __entry->cq_id, - __entry->count, __entry->posted, __entry->status + __entry->status ) ); diff --git a/net/sunrpc/xprtrdma/verbs.c b/net/sunrpc/xprtrdma/verbs.c index 016f10a781b4..1e9041c022b6 100644 --- a/net/sunrpc/xprtrdma/verbs.c +++ b/net/sunrpc/xprtrdma/verbs.c @@ -1417,6 +1417,7 @@ void rpcrdma_post_recvs(struct rpcrdma_xprt *r_xprt, int needed, bool temp) rc = ib_post_recv(ep->re_id->qp, wr, (const struct ib_recv_wr **)&bad_wr); if (rc) { + trace_xprtrdma_post_recvs_err(r_xprt, rc); for (wr = bad_wr; wr;) { struct rpcrdma_rep *rep; @@ -1430,7 +1431,7 @@ void rpcrdma_post_recvs(struct rpcrdma_xprt *r_xprt, int needed, bool temp) complete(&ep->re_done); out: - trace_xprtrdma_post_recvs(r_xprt, count, rc); + trace_xprtrdma_post_recvs(r_xprt, count); ep->re_receive_count += count; return; }