Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

RDMA/core: Move the rdma_show_ib_cm_event() macro

Refactor: Make it globally available in the utilities header.

Link: https://lore.kernel.org/r/159767239131.2968.9520990257041764685.stgit@klimt.1015granger.net
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>

authored by

Chuck Lever and committed by
Jason Gunthorpe
b3d03daa 8d9290a4

+41 -41
-40
drivers/infiniband/core/cma_trace.h
··· 17 17 #include <linux/tracepoint.h> 18 18 #include <trace/events/rdma.h> 19 19 20 - /* 21 - * enum ib_cm_event_type, from include/rdma/ib_cm.h 22 - */ 23 - #define IB_CM_EVENT_LIST \ 24 - ib_cm_event(REQ_ERROR) \ 25 - ib_cm_event(REQ_RECEIVED) \ 26 - ib_cm_event(REP_ERROR) \ 27 - ib_cm_event(REP_RECEIVED) \ 28 - ib_cm_event(RTU_RECEIVED) \ 29 - ib_cm_event(USER_ESTABLISHED) \ 30 - ib_cm_event(DREQ_ERROR) \ 31 - ib_cm_event(DREQ_RECEIVED) \ 32 - ib_cm_event(DREP_RECEIVED) \ 33 - ib_cm_event(TIMEWAIT_EXIT) \ 34 - ib_cm_event(MRA_RECEIVED) \ 35 - ib_cm_event(REJ_RECEIVED) \ 36 - ib_cm_event(LAP_ERROR) \ 37 - ib_cm_event(LAP_RECEIVED) \ 38 - ib_cm_event(APR_RECEIVED) \ 39 - ib_cm_event(SIDR_REQ_ERROR) \ 40 - ib_cm_event(SIDR_REQ_RECEIVED) \ 41 - ib_cm_event_end(SIDR_REP_RECEIVED) 42 - 43 - #undef ib_cm_event 44 - #undef ib_cm_event_end 45 - 46 - #define ib_cm_event(x) TRACE_DEFINE_ENUM(IB_CM_##x); 47 - #define ib_cm_event_end(x) TRACE_DEFINE_ENUM(IB_CM_##x); 48 - 49 - IB_CM_EVENT_LIST 50 - 51 - #undef ib_cm_event 52 - #undef ib_cm_event_end 53 - 54 - #define ib_cm_event(x) { IB_CM_##x, #x }, 55 - #define ib_cm_event_end(x) { IB_CM_##x, #x } 56 - 57 - #define rdma_show_ib_cm_event(x) \ 58 - __print_symbolic(x, IB_CM_EVENT_LIST) 59 - 60 20 61 21 DECLARE_EVENT_CLASS(cma_fsm_class, 62 22 TP_PROTO(
+40 -1
include/trace/events/rdma.h
··· 6 6 /* 7 7 * enum ib_event_type, from include/rdma/ib_verbs.h 8 8 */ 9 - 10 9 #define IB_EVENT_LIST \ 11 10 ib_event(CQ_ERR) \ 12 11 ib_event(QP_FATAL) \ ··· 88 89 89 90 #define rdma_show_wc_status(x) \ 90 91 __print_symbolic(x, IB_WC_STATUS_LIST) 92 + 93 + /* 94 + * enum ib_cm_event_type, from include/rdma/ib_cm.h 95 + */ 96 + #define IB_CM_EVENT_LIST \ 97 + ib_cm_event(REQ_ERROR) \ 98 + ib_cm_event(REQ_RECEIVED) \ 99 + ib_cm_event(REP_ERROR) \ 100 + ib_cm_event(REP_RECEIVED) \ 101 + ib_cm_event(RTU_RECEIVED) \ 102 + ib_cm_event(USER_ESTABLISHED) \ 103 + ib_cm_event(DREQ_ERROR) \ 104 + ib_cm_event(DREQ_RECEIVED) \ 105 + ib_cm_event(DREP_RECEIVED) \ 106 + ib_cm_event(TIMEWAIT_EXIT) \ 107 + ib_cm_event(MRA_RECEIVED) \ 108 + ib_cm_event(REJ_RECEIVED) \ 109 + ib_cm_event(LAP_ERROR) \ 110 + ib_cm_event(LAP_RECEIVED) \ 111 + ib_cm_event(APR_RECEIVED) \ 112 + ib_cm_event(SIDR_REQ_ERROR) \ 113 + ib_cm_event(SIDR_REQ_RECEIVED) \ 114 + ib_cm_event_end(SIDR_REP_RECEIVED) 115 + 116 + #undef ib_cm_event 117 + #undef ib_cm_event_end 118 + 119 + #define ib_cm_event(x) TRACE_DEFINE_ENUM(IB_CM_##x); 120 + #define ib_cm_event_end(x) TRACE_DEFINE_ENUM(IB_CM_##x); 121 + 122 + IB_CM_EVENT_LIST 123 + 124 + #undef ib_cm_event 125 + #undef ib_cm_event_end 126 + 127 + #define ib_cm_event(x) { IB_CM_##x, #x }, 128 + #define ib_cm_event_end(x) { IB_CM_##x, #x } 129 + 130 + #define rdma_show_ib_cm_event(x) \ 131 + __print_symbolic(x, IB_CM_EVENT_LIST) 91 132 92 133 /* 93 134 * enum rdma_cm_event_type, from include/rdma/rdma_cm.h
+1
include/trace/events/rpcrdma.h
··· 13 13 #include <linux/scatterlist.h> 14 14 #include <linux/sunrpc/rpc_rdma_cid.h> 15 15 #include <linux/tracepoint.h> 16 + #include <rdma/ib_cm.h> 16 17 #include <trace/events/rdma.h> 17 18 18 19 /**