14d60cad5SIra Weiny /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */ 24d60cad5SIra Weiny 34d60cad5SIra Weiny /* 44d60cad5SIra Weiny * Copyright (c) 2018 Intel Corporation. All rights reserved. 54d60cad5SIra Weiny */ 64d60cad5SIra Weiny 74d60cad5SIra Weiny #undef TRACE_SYSTEM 84d60cad5SIra Weiny #define TRACE_SYSTEM ib_mad 94d60cad5SIra Weiny 104d60cad5SIra Weiny #if !defined(_TRACE_IB_MAD_H) || defined(TRACE_HEADER_MULTI_READ) 114d60cad5SIra Weiny #define _TRACE_IB_MAD_H 124d60cad5SIra Weiny 134d60cad5SIra Weiny #include <linux/tracepoint.h> 144d60cad5SIra Weiny #include <rdma/ib_mad.h> 154d60cad5SIra Weiny 164d60cad5SIra Weiny #ifdef CONFIG_TRACEPOINTS 174d60cad5SIra Weiny struct trace_event_raw_ib_mad_send_template; 184d60cad5SIra Weiny static void create_mad_addr_info(struct ib_mad_send_wr_private *mad_send_wr, 194d60cad5SIra Weiny struct ib_mad_qp_info *qp_info, 204d60cad5SIra Weiny struct trace_event_raw_ib_mad_send_template *entry); 214d60cad5SIra Weiny #endif 224d60cad5SIra Weiny 234d60cad5SIra Weiny DECLARE_EVENT_CLASS(ib_mad_send_template, 244d60cad5SIra Weiny TP_PROTO(struct ib_mad_send_wr_private *wr, 254d60cad5SIra Weiny struct ib_mad_qp_info *qp_info), 264d60cad5SIra Weiny TP_ARGS(wr, qp_info), 274d60cad5SIra Weiny 284d60cad5SIra Weiny TP_STRUCT__entry( 294d60cad5SIra Weiny __field(u8, base_version) 304d60cad5SIra Weiny __field(u8, mgmt_class) 314d60cad5SIra Weiny __field(u8, class_version) 324d60cad5SIra Weiny __field(u8, port_num) 334d60cad5SIra Weiny __field(u32, qp_num) 344d60cad5SIra Weiny __field(u8, method) 354d60cad5SIra Weiny __field(u8, sl) 364d60cad5SIra Weiny __field(u16, attr_id) 374d60cad5SIra Weiny __field(u32, attr_mod) 384d60cad5SIra Weiny __field(u64, wrtid) 394d60cad5SIra Weiny __field(u64, tid) 404d60cad5SIra Weiny __field(u16, status) 414d60cad5SIra Weiny __field(u16, class_specific) 424d60cad5SIra Weiny __field(u32, length) 434d60cad5SIra Weiny __field(u32, dlid) 444d60cad5SIra Weiny __field(u32, rqpn) 454d60cad5SIra Weiny __field(u32, rqkey) 464d60cad5SIra Weiny __field(u32, dev_index) 474d60cad5SIra Weiny __field(void *, agent_priv) 484d60cad5SIra Weiny __field(unsigned long, timeout) 494d60cad5SIra Weiny __field(int, retries_left) 504d60cad5SIra Weiny __field(int, max_retries) 514d60cad5SIra Weiny __field(int, retry) 524d60cad5SIra Weiny ), 534d60cad5SIra Weiny 544d60cad5SIra Weiny TP_fast_assign( 554d60cad5SIra Weiny __entry->dev_index = wr->mad_agent_priv->agent.device->index; 564d60cad5SIra Weiny __entry->port_num = wr->mad_agent_priv->agent.port_num; 574d60cad5SIra Weiny __entry->qp_num = wr->mad_agent_priv->qp_info->qp->qp_num; 584d60cad5SIra Weiny __entry->agent_priv = wr->mad_agent_priv; 594d60cad5SIra Weiny __entry->wrtid = wr->tid; 604d60cad5SIra Weiny __entry->max_retries = wr->max_retries; 614d60cad5SIra Weiny __entry->retries_left = wr->retries_left; 624d60cad5SIra Weiny __entry->retry = wr->retry; 634d60cad5SIra Weiny __entry->timeout = wr->timeout; 644d60cad5SIra Weiny __entry->length = wr->send_buf.hdr_len + 654d60cad5SIra Weiny wr->send_buf.data_len; 664d60cad5SIra Weiny __entry->base_version = 674d60cad5SIra Weiny ((struct ib_mad_hdr *)wr->send_buf.mad)->base_version; 684d60cad5SIra Weiny __entry->mgmt_class = 694d60cad5SIra Weiny ((struct ib_mad_hdr *)wr->send_buf.mad)->mgmt_class; 704d60cad5SIra Weiny __entry->class_version = 714d60cad5SIra Weiny ((struct ib_mad_hdr *)wr->send_buf.mad)->class_version; 724d60cad5SIra Weiny __entry->method = 734d60cad5SIra Weiny ((struct ib_mad_hdr *)wr->send_buf.mad)->method; 744d60cad5SIra Weiny __entry->status = 754d60cad5SIra Weiny ((struct ib_mad_hdr *)wr->send_buf.mad)->status; 764d60cad5SIra Weiny __entry->class_specific = 774d60cad5SIra Weiny ((struct ib_mad_hdr *)wr->send_buf.mad)->class_specific; 784d60cad5SIra Weiny __entry->tid = ((struct ib_mad_hdr *)wr->send_buf.mad)->tid; 794d60cad5SIra Weiny __entry->attr_id = 804d60cad5SIra Weiny ((struct ib_mad_hdr *)wr->send_buf.mad)->attr_id; 814d60cad5SIra Weiny __entry->attr_mod = 824d60cad5SIra Weiny ((struct ib_mad_hdr *)wr->send_buf.mad)->attr_mod; 834d60cad5SIra Weiny create_mad_addr_info(wr, qp_info, __entry); 844d60cad5SIra Weiny ), 854d60cad5SIra Weiny 864d60cad5SIra Weiny TP_printk("%d:%d QP%d agent %p: " \ 874d60cad5SIra Weiny "wrtid 0x%llx; %d/%d retries(%d); timeout %lu length %d : " \ 884d60cad5SIra Weiny "hdr : base_ver 0x%x class 0x%x class_ver 0x%x " \ 894d60cad5SIra Weiny "method 0x%x status 0x%x class_specific 0x%x tid 0x%llx " \ 904d60cad5SIra Weiny "attr_id 0x%x attr_mod 0x%x => dlid 0x%08x sl %d "\ 91*5c20311dSLeonid Ravich "rpqn 0x%x rqpkey 0x%x", 924d60cad5SIra Weiny __entry->dev_index, __entry->port_num, __entry->qp_num, 934d60cad5SIra Weiny __entry->agent_priv, be64_to_cpu(__entry->wrtid), 944d60cad5SIra Weiny __entry->retries_left, __entry->max_retries, 954d60cad5SIra Weiny __entry->retry, __entry->timeout, __entry->length, 964d60cad5SIra Weiny __entry->base_version, __entry->mgmt_class, 974d60cad5SIra Weiny __entry->class_version, 984d60cad5SIra Weiny __entry->method, be16_to_cpu(__entry->status), 994d60cad5SIra Weiny be16_to_cpu(__entry->class_specific), 1004d60cad5SIra Weiny be64_to_cpu(__entry->tid), be16_to_cpu(__entry->attr_id), 1014d60cad5SIra Weiny be32_to_cpu(__entry->attr_mod), 102*5c20311dSLeonid Ravich be32_to_cpu(__entry->dlid), __entry->sl, 1034d60cad5SIra Weiny __entry->rqpn, __entry->rqkey 1044d60cad5SIra Weiny ) 1054d60cad5SIra Weiny ); 1064d60cad5SIra Weiny 1074d60cad5SIra Weiny DEFINE_EVENT(ib_mad_send_template, ib_mad_error_handler, 1084d60cad5SIra Weiny TP_PROTO(struct ib_mad_send_wr_private *wr, 1094d60cad5SIra Weiny struct ib_mad_qp_info *qp_info), 1104d60cad5SIra Weiny TP_ARGS(wr, qp_info)); 1114d60cad5SIra Weiny DEFINE_EVENT(ib_mad_send_template, ib_mad_ib_send_mad, 1124d60cad5SIra Weiny TP_PROTO(struct ib_mad_send_wr_private *wr, 1134d60cad5SIra Weiny struct ib_mad_qp_info *qp_info), 1144d60cad5SIra Weiny TP_ARGS(wr, qp_info)); 1154d60cad5SIra Weiny DEFINE_EVENT(ib_mad_send_template, ib_mad_send_done_resend, 1164d60cad5SIra Weiny TP_PROTO(struct ib_mad_send_wr_private *wr, 1174d60cad5SIra Weiny struct ib_mad_qp_info *qp_info), 1184d60cad5SIra Weiny TP_ARGS(wr, qp_info)); 1194d60cad5SIra Weiny 1204d60cad5SIra Weiny TRACE_EVENT(ib_mad_send_done_handler, 1214d60cad5SIra Weiny TP_PROTO(struct ib_mad_send_wr_private *wr, struct ib_wc *wc), 1224d60cad5SIra Weiny TP_ARGS(wr, wc), 1234d60cad5SIra Weiny 1244d60cad5SIra Weiny TP_STRUCT__entry( 1254d60cad5SIra Weiny __field(u8, port_num) 1264d60cad5SIra Weiny __field(u8, base_version) 1274d60cad5SIra Weiny __field(u8, mgmt_class) 1284d60cad5SIra Weiny __field(u8, class_version) 1294d60cad5SIra Weiny __field(u32, qp_num) 1304d60cad5SIra Weiny __field(u64, wrtid) 1314d60cad5SIra Weiny __field(u16, status) 1324d60cad5SIra Weiny __field(u16, wc_status) 1334d60cad5SIra Weiny __field(u32, length) 1344d60cad5SIra Weiny __field(void *, agent_priv) 1354d60cad5SIra Weiny __field(unsigned long, timeout) 1364d60cad5SIra Weiny __field(u32, dev_index) 1374d60cad5SIra Weiny __field(int, retries_left) 1384d60cad5SIra Weiny __field(int, max_retries) 1394d60cad5SIra Weiny __field(int, retry) 1404d60cad5SIra Weiny __field(u8, method) 1414d60cad5SIra Weiny ), 1424d60cad5SIra Weiny 1434d60cad5SIra Weiny TP_fast_assign( 1444d60cad5SIra Weiny __entry->dev_index = wr->mad_agent_priv->agent.device->index; 1454d60cad5SIra Weiny __entry->port_num = wr->mad_agent_priv->agent.port_num; 1464d60cad5SIra Weiny __entry->qp_num = wr->mad_agent_priv->qp_info->qp->qp_num; 1474d60cad5SIra Weiny __entry->agent_priv = wr->mad_agent_priv; 1484d60cad5SIra Weiny __entry->wrtid = wr->tid; 1494d60cad5SIra Weiny __entry->max_retries = wr->max_retries; 1504d60cad5SIra Weiny __entry->retries_left = wr->retries_left; 1514d60cad5SIra Weiny __entry->retry = wr->retry; 1524d60cad5SIra Weiny __entry->timeout = wr->timeout; 1534d60cad5SIra Weiny __entry->base_version = 1544d60cad5SIra Weiny ((struct ib_mad_hdr *)wr->send_buf.mad)->base_version; 1554d60cad5SIra Weiny __entry->mgmt_class = 1564d60cad5SIra Weiny ((struct ib_mad_hdr *)wr->send_buf.mad)->mgmt_class; 1574d60cad5SIra Weiny __entry->class_version = 1584d60cad5SIra Weiny ((struct ib_mad_hdr *)wr->send_buf.mad)->class_version; 1594d60cad5SIra Weiny __entry->method = 1604d60cad5SIra Weiny ((struct ib_mad_hdr *)wr->send_buf.mad)->method; 1614d60cad5SIra Weiny __entry->status = 1624d60cad5SIra Weiny ((struct ib_mad_hdr *)wr->send_buf.mad)->status; 1634d60cad5SIra Weiny __entry->wc_status = wc->status; 1644d60cad5SIra Weiny __entry->length = wc->byte_len; 1654d60cad5SIra Weiny ), 1664d60cad5SIra Weiny 1674d60cad5SIra Weiny TP_printk("%d:%d QP%d : SEND WC Status %d : agent %p: " \ 1684d60cad5SIra Weiny "wrtid 0x%llx %d/%d retries(%d) timeout %lu length %d: " \ 1694d60cad5SIra Weiny "hdr : base_ver 0x%x class 0x%x class_ver 0x%x " \ 1704d60cad5SIra Weiny "method 0x%x status 0x%x", 1714d60cad5SIra Weiny __entry->dev_index, __entry->port_num, __entry->qp_num, 1724d60cad5SIra Weiny __entry->wc_status, 1734d60cad5SIra Weiny __entry->agent_priv, be64_to_cpu(__entry->wrtid), 1744d60cad5SIra Weiny __entry->retries_left, __entry->max_retries, 1754d60cad5SIra Weiny __entry->retry, __entry->timeout, 1764d60cad5SIra Weiny __entry->length, 1774d60cad5SIra Weiny __entry->base_version, __entry->mgmt_class, 1784d60cad5SIra Weiny __entry->class_version, __entry->method, 1794d60cad5SIra Weiny be16_to_cpu(__entry->status) 1804d60cad5SIra Weiny ) 1814d60cad5SIra Weiny ); 1824d60cad5SIra Weiny 183821bf1deSIra Weiny TRACE_EVENT(ib_mad_recv_done_handler, 184821bf1deSIra Weiny TP_PROTO(struct ib_mad_qp_info *qp_info, struct ib_wc *wc, 185821bf1deSIra Weiny struct ib_mad_hdr *mad_hdr), 186821bf1deSIra Weiny TP_ARGS(qp_info, wc, mad_hdr), 187821bf1deSIra Weiny 188821bf1deSIra Weiny TP_STRUCT__entry( 189821bf1deSIra Weiny __field(u8, base_version) 190821bf1deSIra Weiny __field(u8, mgmt_class) 191821bf1deSIra Weiny __field(u8, class_version) 192821bf1deSIra Weiny __field(u8, port_num) 193821bf1deSIra Weiny __field(u32, qp_num) 194821bf1deSIra Weiny __field(u16, status) 195821bf1deSIra Weiny __field(u16, class_specific) 196821bf1deSIra Weiny __field(u32, length) 197821bf1deSIra Weiny __field(u64, tid) 198821bf1deSIra Weiny __field(u8, method) 199821bf1deSIra Weiny __field(u8, sl) 200821bf1deSIra Weiny __field(u16, attr_id) 201821bf1deSIra Weiny __field(u32, attr_mod) 202821bf1deSIra Weiny __field(u16, src_qp) 203821bf1deSIra Weiny __field(u16, wc_status) 204821bf1deSIra Weiny __field(u32, slid) 205821bf1deSIra Weiny __field(u32, dev_index) 206821bf1deSIra Weiny ), 207821bf1deSIra Weiny 208821bf1deSIra Weiny TP_fast_assign( 209821bf1deSIra Weiny __entry->dev_index = qp_info->port_priv->device->index; 210821bf1deSIra Weiny __entry->port_num = qp_info->port_priv->port_num; 211821bf1deSIra Weiny __entry->qp_num = qp_info->qp->qp_num; 212821bf1deSIra Weiny __entry->length = wc->byte_len; 213821bf1deSIra Weiny __entry->base_version = mad_hdr->base_version; 214821bf1deSIra Weiny __entry->mgmt_class = mad_hdr->mgmt_class; 215821bf1deSIra Weiny __entry->class_version = mad_hdr->class_version; 216821bf1deSIra Weiny __entry->method = mad_hdr->method; 217821bf1deSIra Weiny __entry->status = mad_hdr->status; 218821bf1deSIra Weiny __entry->class_specific = mad_hdr->class_specific; 219821bf1deSIra Weiny __entry->tid = mad_hdr->tid; 220821bf1deSIra Weiny __entry->attr_id = mad_hdr->attr_id; 221821bf1deSIra Weiny __entry->attr_mod = mad_hdr->attr_mod; 222821bf1deSIra Weiny __entry->slid = wc->slid; 223821bf1deSIra Weiny __entry->src_qp = wc->src_qp; 224821bf1deSIra Weiny __entry->sl = wc->sl; 225821bf1deSIra Weiny __entry->wc_status = wc->status; 226821bf1deSIra Weiny ), 227821bf1deSIra Weiny 228821bf1deSIra Weiny TP_printk("%d:%d QP%d : RECV WC Status %d : length %d : hdr : " \ 229821bf1deSIra Weiny "base_ver 0x%02x class 0x%02x class_ver 0x%02x " \ 230821bf1deSIra Weiny "method 0x%02x status 0x%04x class_specific 0x%04x " \ 231821bf1deSIra Weiny "tid 0x%016llx attr_id 0x%04x attr_mod 0x%08x " \ 232*5c20311dSLeonid Ravich "slid 0x%08x src QP%d, sl %d", 233821bf1deSIra Weiny __entry->dev_index, __entry->port_num, __entry->qp_num, 234821bf1deSIra Weiny __entry->wc_status, 235821bf1deSIra Weiny __entry->length, 236821bf1deSIra Weiny __entry->base_version, __entry->mgmt_class, 237821bf1deSIra Weiny __entry->class_version, __entry->method, 238821bf1deSIra Weiny be16_to_cpu(__entry->status), 239821bf1deSIra Weiny be16_to_cpu(__entry->class_specific), 240821bf1deSIra Weiny be64_to_cpu(__entry->tid), be16_to_cpu(__entry->attr_id), 241821bf1deSIra Weiny be32_to_cpu(__entry->attr_mod), 242*5c20311dSLeonid Ravich __entry->slid, __entry->src_qp, __entry->sl 243821bf1deSIra Weiny ) 244821bf1deSIra Weiny ); 245821bf1deSIra Weiny 2460e65bae2SIra Weiny DECLARE_EVENT_CLASS(ib_mad_agent_template, 2470e65bae2SIra Weiny TP_PROTO(struct ib_mad_agent_private *agent), 2480e65bae2SIra Weiny TP_ARGS(agent), 2490e65bae2SIra Weiny 2500e65bae2SIra Weiny TP_STRUCT__entry( 2510e65bae2SIra Weiny __field(u32, dev_index) 2520e65bae2SIra Weiny __field(u32, hi_tid) 2530e65bae2SIra Weiny __field(u8, port_num) 2540e65bae2SIra Weiny __field(u8, mgmt_class) 2550e65bae2SIra Weiny __field(u8, mgmt_class_version) 2560e65bae2SIra Weiny ), 2570e65bae2SIra Weiny 2580e65bae2SIra Weiny TP_fast_assign( 2590e65bae2SIra Weiny __entry->dev_index = agent->agent.device->index; 2600e65bae2SIra Weiny __entry->port_num = agent->agent.port_num; 2610e65bae2SIra Weiny __entry->hi_tid = agent->agent.hi_tid; 2620e65bae2SIra Weiny 2630e65bae2SIra Weiny if (agent->reg_req) { 2640e65bae2SIra Weiny __entry->mgmt_class = agent->reg_req->mgmt_class; 2650e65bae2SIra Weiny __entry->mgmt_class_version = 2660e65bae2SIra Weiny agent->reg_req->mgmt_class_version; 2670e65bae2SIra Weiny } else { 2680e65bae2SIra Weiny __entry->mgmt_class = 0; 2690e65bae2SIra Weiny __entry->mgmt_class_version = 0; 2700e65bae2SIra Weiny } 2710e65bae2SIra Weiny ), 2720e65bae2SIra Weiny 2730e65bae2SIra Weiny TP_printk("%d:%d mad agent : hi_tid 0x%08x class 0x%02x class_ver 0x%02x", 2740e65bae2SIra Weiny __entry->dev_index, __entry->port_num, 2750e65bae2SIra Weiny __entry->hi_tid, __entry->mgmt_class, 2760e65bae2SIra Weiny __entry->mgmt_class_version 2770e65bae2SIra Weiny ) 2780e65bae2SIra Weiny ); 2790e65bae2SIra Weiny DEFINE_EVENT(ib_mad_agent_template, ib_mad_recv_done_agent, 2800e65bae2SIra Weiny TP_PROTO(struct ib_mad_agent_private *agent), 2810e65bae2SIra Weiny TP_ARGS(agent)); 2820e65bae2SIra Weiny DEFINE_EVENT(ib_mad_agent_template, ib_mad_send_done_agent, 2830e65bae2SIra Weiny TP_PROTO(struct ib_mad_agent_private *agent), 2840e65bae2SIra Weiny TP_ARGS(agent)); 2850e65bae2SIra Weiny DEFINE_EVENT(ib_mad_agent_template, ib_mad_create_agent, 2860e65bae2SIra Weiny TP_PROTO(struct ib_mad_agent_private *agent), 2870e65bae2SIra Weiny TP_ARGS(agent)); 2880e65bae2SIra Weiny DEFINE_EVENT(ib_mad_agent_template, ib_mad_unregister_agent, 2890e65bae2SIra Weiny TP_PROTO(struct ib_mad_agent_private *agent), 2900e65bae2SIra Weiny TP_ARGS(agent)); 2910e65bae2SIra Weiny 2924d60cad5SIra Weiny 2932ccfbb70SIra Weiny 2942ccfbb70SIra Weiny DECLARE_EVENT_CLASS(ib_mad_opa_smi_template, 2952ccfbb70SIra Weiny TP_PROTO(struct opa_smp *smp), 2962ccfbb70SIra Weiny TP_ARGS(smp), 2972ccfbb70SIra Weiny 2982ccfbb70SIra Weiny TP_STRUCT__entry( 2992ccfbb70SIra Weiny __field(u64, mkey) 3002ccfbb70SIra Weiny __field(u32, dr_slid) 3012ccfbb70SIra Weiny __field(u32, dr_dlid) 3022ccfbb70SIra Weiny __field(u8, hop_ptr) 3032ccfbb70SIra Weiny __field(u8, hop_cnt) 3042ccfbb70SIra Weiny __array(u8, initial_path, OPA_SMP_MAX_PATH_HOPS) 3052ccfbb70SIra Weiny __array(u8, return_path, OPA_SMP_MAX_PATH_HOPS) 3062ccfbb70SIra Weiny ), 3072ccfbb70SIra Weiny 3082ccfbb70SIra Weiny TP_fast_assign( 3092ccfbb70SIra Weiny __entry->hop_ptr = smp->hop_ptr; 3102ccfbb70SIra Weiny __entry->hop_cnt = smp->hop_cnt; 3112ccfbb70SIra Weiny __entry->mkey = smp->mkey; 3122ccfbb70SIra Weiny __entry->dr_slid = smp->route.dr.dr_slid; 3132ccfbb70SIra Weiny __entry->dr_dlid = smp->route.dr.dr_dlid; 3142ccfbb70SIra Weiny memcpy(__entry->initial_path, smp->route.dr.initial_path, 3152ccfbb70SIra Weiny OPA_SMP_MAX_PATH_HOPS); 3162ccfbb70SIra Weiny memcpy(__entry->return_path, smp->route.dr.return_path, 3172ccfbb70SIra Weiny OPA_SMP_MAX_PATH_HOPS); 3182ccfbb70SIra Weiny ), 3192ccfbb70SIra Weiny 3202ccfbb70SIra Weiny TP_printk("OPA SMP: hop_ptr %d hop_cnt %d " \ 3212ccfbb70SIra Weiny "mkey 0x%016llx dr_slid 0x%08x dr_dlid 0x%08x " \ 3222ccfbb70SIra Weiny "initial_path %*ph return_path %*ph ", 3232ccfbb70SIra Weiny __entry->hop_ptr, __entry->hop_cnt, 3242ccfbb70SIra Weiny be64_to_cpu(__entry->mkey), be32_to_cpu(__entry->dr_slid), 3252ccfbb70SIra Weiny be32_to_cpu(__entry->dr_dlid), 3262ccfbb70SIra Weiny OPA_SMP_MAX_PATH_HOPS, __entry->initial_path, 3272ccfbb70SIra Weiny OPA_SMP_MAX_PATH_HOPS, __entry->return_path 3282ccfbb70SIra Weiny ) 3292ccfbb70SIra Weiny ); 3302ccfbb70SIra Weiny 3312ccfbb70SIra Weiny DEFINE_EVENT(ib_mad_opa_smi_template, ib_mad_handle_opa_smi, 3322ccfbb70SIra Weiny TP_PROTO(struct opa_smp *smp), 3332ccfbb70SIra Weiny TP_ARGS(smp)); 3342ccfbb70SIra Weiny DEFINE_EVENT(ib_mad_opa_smi_template, ib_mad_handle_out_opa_smi, 3352ccfbb70SIra Weiny TP_PROTO(struct opa_smp *smp), 3362ccfbb70SIra Weiny TP_ARGS(smp)); 3372ccfbb70SIra Weiny 3382ccfbb70SIra Weiny 3392ccfbb70SIra Weiny DECLARE_EVENT_CLASS(ib_mad_opa_ib_template, 3402ccfbb70SIra Weiny TP_PROTO(struct ib_smp *smp), 3412ccfbb70SIra Weiny TP_ARGS(smp), 3422ccfbb70SIra Weiny 3432ccfbb70SIra Weiny TP_STRUCT__entry( 3442ccfbb70SIra Weiny __field(u64, mkey) 3452ccfbb70SIra Weiny __field(u32, dr_slid) 3462ccfbb70SIra Weiny __field(u32, dr_dlid) 3472ccfbb70SIra Weiny __field(u8, hop_ptr) 3482ccfbb70SIra Weiny __field(u8, hop_cnt) 3492ccfbb70SIra Weiny __array(u8, initial_path, IB_SMP_MAX_PATH_HOPS) 3502ccfbb70SIra Weiny __array(u8, return_path, IB_SMP_MAX_PATH_HOPS) 3512ccfbb70SIra Weiny ), 3522ccfbb70SIra Weiny 3532ccfbb70SIra Weiny TP_fast_assign( 3542ccfbb70SIra Weiny __entry->hop_ptr = smp->hop_ptr; 3552ccfbb70SIra Weiny __entry->hop_cnt = smp->hop_cnt; 3562ccfbb70SIra Weiny __entry->mkey = smp->mkey; 3572ccfbb70SIra Weiny __entry->dr_slid = smp->dr_slid; 3582ccfbb70SIra Weiny __entry->dr_dlid = smp->dr_dlid; 3592ccfbb70SIra Weiny memcpy(__entry->initial_path, smp->initial_path, 3602ccfbb70SIra Weiny IB_SMP_MAX_PATH_HOPS); 3612ccfbb70SIra Weiny memcpy(__entry->return_path, smp->return_path, 3622ccfbb70SIra Weiny IB_SMP_MAX_PATH_HOPS); 3632ccfbb70SIra Weiny ), 3642ccfbb70SIra Weiny 3652ccfbb70SIra Weiny TP_printk("OPA SMP: hop_ptr %d hop_cnt %d " \ 3662ccfbb70SIra Weiny "mkey 0x%016llx dr_slid 0x%04x dr_dlid 0x%04x " \ 3672ccfbb70SIra Weiny "initial_path %*ph return_path %*ph ", 3682ccfbb70SIra Weiny __entry->hop_ptr, __entry->hop_cnt, 3692ccfbb70SIra Weiny be64_to_cpu(__entry->mkey), be16_to_cpu(__entry->dr_slid), 3702ccfbb70SIra Weiny be16_to_cpu(__entry->dr_dlid), 3712ccfbb70SIra Weiny IB_SMP_MAX_PATH_HOPS, __entry->initial_path, 3722ccfbb70SIra Weiny IB_SMP_MAX_PATH_HOPS, __entry->return_path 3732ccfbb70SIra Weiny ) 3742ccfbb70SIra Weiny ); 3752ccfbb70SIra Weiny 3762ccfbb70SIra Weiny DEFINE_EVENT(ib_mad_opa_ib_template, ib_mad_handle_ib_smi, 3772ccfbb70SIra Weiny TP_PROTO(struct ib_smp *smp), 3782ccfbb70SIra Weiny TP_ARGS(smp)); 3792ccfbb70SIra Weiny DEFINE_EVENT(ib_mad_opa_ib_template, ib_mad_handle_out_ib_smi, 3802ccfbb70SIra Weiny TP_PROTO(struct ib_smp *smp), 3812ccfbb70SIra Weiny TP_ARGS(smp)); 3822ccfbb70SIra Weiny 3834d60cad5SIra Weiny #endif /* _TRACE_IB_MAD_H */ 3844d60cad5SIra Weiny 3854d60cad5SIra Weiny #include <trace/define_trace.h> 386