From patchwork Sat Jan 20 16:16:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever III X-Patchwork-Id: 10176385 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B6A4960386 for ; Sat, 20 Jan 2018 16:16:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A5BD8287C0 for ; Sat, 20 Jan 2018 16:16:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9985E28814; Sat, 20 Jan 2018 16:16:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A0EF6287C0 for ; Sat, 20 Jan 2018 16:16:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756103AbeATQQ3 (ORCPT ); Sat, 20 Jan 2018 11:16:29 -0500 Received: from mail-it0-f67.google.com ([209.85.214.67]:43885 "EHLO mail-it0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755643AbeATQQ2 (ORCPT ); Sat, 20 Jan 2018 11:16:28 -0500 Received: by mail-it0-f67.google.com with SMTP id u62so5422396ita.2; Sat, 20 Jan 2018 08:16:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:from:to:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=t/RXWlz3//ZqVGlefVZvjSI0Imfqj5Vh1f5DB/OVZkg=; b=G5VrVEtixmNI4i/lrAAkM2OppzOSxKwX/lKoeDVKVCQn9VdbEvboh2cfGy8IysN6KH SfNhuom19hfJB6jBri2eZ9VF8xN+o83GKekmTVySTPZJWMSZ8MMSL7ZG5P1dIXFu2grA 5Yp0UVT1m2Sd0AoxTp6+W/nFzjAuyJhLhI20oYqko5sMFV+u4euYz8GF/CpNNP6QAd+0 vfo084ZvrFffB6MutQHoYI2KHUDnOFvLDEsVtchfj7mhL2DsxPsnUnR+Uu80RDMa8cBJ EQaUi3mCeUnakQVEydpyF8/MhcjTl7dEYKKWvSiLtpUr9JIm6URx88oTCHEE/Ov/336h fcCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:from:to:cc:date:message-id :in-reply-to:references:user-agent:mime-version :content-transfer-encoding; bh=t/RXWlz3//ZqVGlefVZvjSI0Imfqj5Vh1f5DB/OVZkg=; b=qrzPQ5Icjio4YMJf0taH4XiiHwn3qZqsFHIL9zCYc+XFPQL/p3AcdGiJjwdcy6azL/ 67bfVx7vgV9UG5dtEBTUneJQ6+AJ9RANCZgPYjqh36fotxaSelq2Edlb8vOUXoVdvbXa Ka8NzpeoY1J4c7U4iC84Og/CVjLEcAtS2Jg6bG6jaxBUnxQcV7adqnwuHI1fB9U+IdqG wfLF4j57zTQL0WInDOAzCSR8s3t8wKtuGS9y6rc0Yh8U2xyxJjFVhC8Bnfh2foSJ/DGH DbkEj2lRbgy0XE0bX0Ph78r8FwN6iqyE//dxF4UHY6FKAnU+ZNTZDkeVqwGKFVZhalLh E49w== X-Gm-Message-State: AKwxytcoK9dzk3cyI7NDHG0GgsnMA+TDNnbpmlyctgyD3JXTMLuvGvzn MHQL+BRu+6ROJp8bIORT0ZFEAA== X-Google-Smtp-Source: AH8x226fDZhUNJxUHnYDfxSTpX+xfMcqSh/DgUm5ub+z1Jr9pJqraxDprUXe81kwqZbwhv5OyrocXg== X-Received: by 10.36.110.143 with SMTP id w137mr1899002itc.119.1516464987253; Sat, 20 Jan 2018 08:16:27 -0800 (PST) Received: from manet.1015granger.net (c-68-61-232-219.hsd1.mi.comcast.net. [68.61.232.219]) by smtp.gmail.com with ESMTPSA id t21sm6321040ioi.48.2018.01.20.08.16.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 20 Jan 2018 08:16:26 -0800 (PST) Subject: [PATCH v3 1/2] rdma/ib: Add trace point macros to display human-readable values From: Chuck Lever To: jgg@ziepe.ca, dledford@redhat.com, anna.schumaker@netapp.com, leon@kernel.org Cc: linux-rdma@vger.kernel.org, linux-nfs@vger.kernel.org Date: Sat, 20 Jan 2018 11:16:25 -0500 Message-ID: <20180120161625.6488.7416.stgit@manet.1015granger.net> In-Reply-To: <20180120161440.6488.4311.stgit@manet.1015granger.net> References: <20180120161440.6488.4311.stgit@manet.1015granger.net> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP These can be shared with all kernel ULPs, and more can easily be added as needed. Note: checkpatch.pl has some heartburn with the TRACE_DEFINE_ENUM macros and the LIST macros. These follow the same style as other header files under include/tracing/events , thus should be considered acceptable exceptions. Signed-off-by: Chuck Lever Acked-by: Jason Gunthorpe --- include/trace/events/rdma.h | 129 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 include/trace/events/rdma.h -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/include/trace/events/rdma.h b/include/trace/events/rdma.h new file mode 100644 index 0000000..aa19afc --- /dev/null +++ b/include/trace/events/rdma.h @@ -0,0 +1,129 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (c) 2017 Oracle. All rights reserved. + */ + +/* + * enum ib_event_type, from include/rdma/ib_verbs.h + */ + +#define IB_EVENT_LIST \ + ib_event(CQ_ERR) \ + ib_event(QP_FATAL) \ + ib_event(QP_REQ_ERR) \ + ib_event(QP_ACCESS_ERR) \ + ib_event(COMM_EST) \ + ib_event(SQ_DRAINED) \ + ib_event(PATH_MIG) \ + ib_event(PATH_MIG_ERR) \ + ib_event(DEVICE_FATAL) \ + ib_event(PORT_ACTIVE) \ + ib_event(PORT_ERR) \ + ib_event(LID_CHANGE) \ + ib_event(PKEY_CHANGE) \ + ib_event(SM_CHANGE) \ + ib_event(SRQ_ERR) \ + ib_event(SRQ_LIMIT_REACHED) \ + ib_event(QP_LAST_WQE_REACHED) \ + ib_event(CLIENT_REREGISTER) \ + ib_event(GID_CHANGE) \ + ib_event_end(WQ_FATAL) + +#undef ib_event +#undef ib_event_end + +#define ib_event(x) TRACE_DEFINE_ENUM(IB_EVENT_##x); +#define ib_event_end(x) TRACE_DEFINE_ENUM(IB_EVENT_##x); + +IB_EVENT_LIST + +#undef ib_event +#undef ib_event_end + +#define ib_event(x) { IB_EVENT_##x, #x }, +#define ib_event_end(x) { IB_EVENT_##x, #x } + +#define rdma_show_ib_event(x) \ + __print_symbolic(x, IB_EVENT_LIST) + +/* + * enum ib_wc_status type, from include/rdma/ib_verbs.h + */ +#define IB_WC_STATUS_LIST \ + ib_wc_status(SUCCESS) \ + ib_wc_status(LOC_LEN_ERR) \ + ib_wc_status(LOC_QP_OP_ERR) \ + ib_wc_status(LOC_EEC_OP_ERR) \ + ib_wc_status(LOC_PROT_ERR) \ + ib_wc_status(WR_FLUSH_ERR) \ + ib_wc_status(MW_BIND_ERR) \ + ib_wc_status(BAD_RESP_ERR) \ + ib_wc_status(LOC_ACCESS_ERR) \ + ib_wc_status(REM_INV_REQ_ERR) \ + ib_wc_status(REM_ACCESS_ERR) \ + ib_wc_status(REM_OP_ERR) \ + ib_wc_status(RETRY_EXC_ERR) \ + ib_wc_status(RNR_RETRY_EXC_ERR) \ + ib_wc_status(LOC_RDD_VIOL_ERR) \ + ib_wc_status(REM_INV_RD_REQ_ERR) \ + ib_wc_status(REM_ABORT_ERR) \ + ib_wc_status(INV_EECN_ERR) \ + ib_wc_status(INV_EEC_STATE_ERR) \ + ib_wc_status(FATAL_ERR) \ + ib_wc_status(RESP_TIMEOUT_ERR) \ + ib_wc_status_end(GENERAL_ERR) + +#undef ib_wc_status +#undef ib_wc_status_end + +#define ib_wc_status(x) TRACE_DEFINE_ENUM(IB_WC_##x); +#define ib_wc_status_end(x) TRACE_DEFINE_ENUM(IB_WC_##x); + +IB_WC_STATUS_LIST + +#undef ib_wc_status +#undef ib_wc_status_end + +#define ib_wc_status(x) { IB_WC_##x, #x }, +#define ib_wc_status_end(x) { IB_WC_##x, #x } + +#define rdma_show_wc_status(x) \ + __print_symbolic(x, IB_WC_STATUS_LIST) + +/* + * enum rdma_cm_event_type, from include/rdma/rdma_cm.h + */ +#define RDMA_CM_EVENT_LIST \ + rdma_cm_event(ADDR_RESOLVED) \ + rdma_cm_event(ADDR_ERROR) \ + rdma_cm_event(ROUTE_RESOLVED) \ + rdma_cm_event(ROUTE_ERROR) \ + rdma_cm_event(CONNECT_REQUEST) \ + rdma_cm_event(CONNECT_RESPONSE) \ + rdma_cm_event(CONNECT_ERROR) \ + rdma_cm_event(UNREACHABLE) \ + rdma_cm_event(REJECTED) \ + rdma_cm_event(ESTABLISHED) \ + rdma_cm_event(DISCONNECTED) \ + rdma_cm_event(DEVICE_REMOVAL) \ + rdma_cm_event(MULTICAST_JOIN) \ + rdma_cm_event(MULTICAST_ERROR) \ + rdma_cm_event(ADDR_CHANGE) \ + rdma_cm_event_end(TIMEWAIT_EXIT) + +#undef rdma_cm_event +#undef rdma_cm_event_end + +#define rdma_cm_event(x) TRACE_DEFINE_ENUM(RDMA_CM_EVENT_##x); +#define rdma_cm_event_end(x) TRACE_DEFINE_ENUM(RDMA_CM_EVENT_##x); + +RDMA_CM_EVENT_LIST + +#undef rdma_cm_event +#undef rdma_cm_event_end + +#define rdma_cm_event(x) { RDMA_CM_EVENT_##x, #x }, +#define rdma_cm_event_end(x) { RDMA_CM_EVENT_##x, #x } + +#define rdma_show_cm_event(x) \ + __print_symbolic(x, RDMA_CM_EVENT_LIST)