Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2777309pxb; Mon, 19 Apr 2021 13:44:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXvEnQ8fwPGTKtdj2PVP+xzPDF/Ct5Xpj15ypeFfKnk681omN82bzQ0WzmrAs35ZRgruXV X-Received: by 2002:a17:90a:d41:: with SMTP id 1mr1059579pju.232.1618865091134; Mon, 19 Apr 2021 13:44:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618865091; cv=none; d=google.com; s=arc-20160816; b=LbOYkK4Wb9R5jV5mcF1jECY6aAyYB/yLrPubKCnlcx4ZAq0icDwxhQZ5qWKffxUwQf BkjB8TckD1ESJ7xSWGwlWcWsU1Vrv7F3H7lE3XzkJu9o+WtnEIq72bJrho8ttuf16aB9 GOnMLNTV+Nz6+kWNvLfkPhVm9ecCGcVR8XtRCcid1x/oN16NM/P+osbDjmKnM+7LJmvX l9gayjLWKzu58/9kLOFCM/2qncKCxpRDm/FUZT8eyjakP+5M7J6wykE1VVdbl3mJY3SA iHiKBMX6ATPD6yKgGSvoTVSYEOWvbQIt7Pi32I5K4iks98nn1JbpB4NTXvEPCvcnuIJC WJTA== 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=PVnF5b4dStwjeMhzhhJEHHh00+IFmrRuwCkPk4XBQpM=; b=icqY3JEO6k0zy/s9S6pB9Asa1aC/vXVDBZnOwr7CxVoNl7Xrs3rqAEKKNTz3XtFvzb ZQsMhp8fINI1GSKQvV7Ozm42vZ+fnok3j7pXSun/9xu1LILx1SEOGt9CiCxK+gxpKheg hO0hDRmoAcsgLlaI69S5BhP7VJV27xIsIgpEzMTF9Zt1fpHm7yThEU2iPnSy5bRoBB+9 YGb7Y8QlSZcUU1VT0rdhpogM1Am2lXPZ+7nFe5H8YyHKyyexLspKjYmrCaa762V7iyAf p+dFbCq6NqiPX4EUXiiw/EzK+LL7apgR14SdhFkcipDl2t/TP93GiUifP9TmwisZC2Qh E9Iw== 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 f22si18534499pgb.594.2021.04.19.13.44.37; Mon, 19 Apr 2021 13:44:51 -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 S240639AbhDSSEL (ORCPT + 99 others); Mon, 19 Apr 2021 14:04:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:41396 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240024AbhDSSEJ (ORCPT ); Mon, 19 Apr 2021 14:04:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D338C61107; Mon, 19 Apr 2021 18:03:38 +0000 (UTC) Subject: [PATCH v3 19/26] xprtrdma: Add an rpcrdma_mr_completion_class From: Chuck Lever To: trondmy@hammerspace.com Cc: linux-nfs@vger.kernel.org, linux-rdma@vger.kernel.org Date: Mon, 19 Apr 2021 14:03:38 -0400 Message-ID: <161885541803.38598.16824895326283044191.stgit@manet.1015granger.net> In-Reply-To: <161885481568.38598.16682844600209775665.stgit@manet.1015granger.net> References: <161885481568.38598.16682844600209775665.stgit@manet.1015granger.net> User-Agent: StGit/0.23-29-ga622f1 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 I found it confusing that the MR_EVENT class displays the mr.id but the associated COMPLETION_EVENT class displays a cid (that happens to contain the mr.id!). To make it a little easier on humans who have to read and interpret these events, create an MR_COMPLETION class that displays the mr.id in the same way as the MR_EVENT class. Signed-off-by: Chuck Lever --- include/trace/events/rpcrdma.h | 48 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 44 insertions(+), 4 deletions(-) diff --git a/include/trace/events/rpcrdma.h b/include/trace/events/rpcrdma.h index 9462326b3535..3e6e4c69b533 100644 --- a/include/trace/events/rpcrdma.h +++ b/include/trace/events/rpcrdma.h @@ -60,6 +60,46 @@ DECLARE_EVENT_CLASS(rpcrdma_completion_class, ), \ TP_ARGS(wc, cid)) +DECLARE_EVENT_CLASS(rpcrdma_mr_completion_class, + TP_PROTO( + const struct ib_wc *wc, + const struct rpc_rdma_cid *cid + ), + + TP_ARGS(wc, cid), + + TP_STRUCT__entry( + __field(u32, cq_id) + __field(int, completion_id) + __field(unsigned long, status) + __field(unsigned int, vendor_err) + ), + + TP_fast_assign( + __entry->cq_id = cid->ci_queue_id; + __entry->completion_id = cid->ci_completion_id; + __entry->status = wc->status; + if (wc->status) + __entry->vendor_err = wc->vendor_err; + else + __entry->vendor_err = 0; + ), + + TP_printk("cq.id=%u mr.id=%d status=%s (%lu/0x%x)", + __entry->cq_id, __entry->completion_id, + rdma_show_wc_status(__entry->status), + __entry->status, __entry->vendor_err + ) +); + +#define DEFINE_MR_COMPLETION_EVENT(name) \ + DEFINE_EVENT(rpcrdma_mr_completion_class, name, \ + TP_PROTO( \ + const struct ib_wc *wc, \ + const struct rpc_rdma_cid *cid \ + ), \ + TP_ARGS(wc, cid)) + DECLARE_EVENT_CLASS(rpcrdma_receive_completion_class, TP_PROTO( const struct ib_wc *wc, @@ -886,10 +926,10 @@ TRACE_EVENT(xprtrdma_post_linv_err, DEFINE_RECEIVE_COMPLETION_EVENT(xprtrdma_wc_receive); DEFINE_COMPLETION_EVENT(xprtrdma_wc_send); -DEFINE_COMPLETION_EVENT(xprtrdma_wc_fastreg); -DEFINE_COMPLETION_EVENT(xprtrdma_wc_li); -DEFINE_COMPLETION_EVENT(xprtrdma_wc_li_wake); -DEFINE_COMPLETION_EVENT(xprtrdma_wc_li_done); +DEFINE_MR_COMPLETION_EVENT(xprtrdma_wc_fastreg); +DEFINE_MR_COMPLETION_EVENT(xprtrdma_wc_li); +DEFINE_MR_COMPLETION_EVENT(xprtrdma_wc_li_wake); +DEFINE_MR_COMPLETION_EVENT(xprtrdma_wc_li_done); TRACE_EVENT(xprtrdma_frwr_alloc, TP_PROTO(