Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
0002 
0003 /*
0004  * Copyright (c) 2018 Intel Corporation.  All rights reserved.
0005  *
0006  */
0007 
0008 #undef TRACE_SYSTEM
0009 #define TRACE_SYSTEM ib_umad
0010 
0011 #if !defined(_TRACE_IB_UMAD_H) || defined(TRACE_HEADER_MULTI_READ)
0012 #define _TRACE_IB_UMAD_H
0013 
0014 #include <linux/tracepoint.h>
0015 
0016 DECLARE_EVENT_CLASS(ib_umad_template,
0017     TP_PROTO(struct ib_umad_file *file, struct ib_user_mad_hdr *umad_hdr,
0018          struct ib_mad_hdr *mad_hdr),
0019     TP_ARGS(file, umad_hdr, mad_hdr),
0020 
0021     TP_STRUCT__entry(
0022         __field(u8, port_num)
0023         __field(u8, sl)
0024         __field(u8, path_bits)
0025         __field(u8, grh_present)
0026         __field(u32, id)
0027         __field(u32, status)
0028         __field(u32, timeout_ms)
0029         __field(u32, retires)
0030         __field(u32, length)
0031         __field(u32, qpn)
0032         __field(u32, qkey)
0033         __field(u8, gid_index)
0034         __field(u8, hop_limit)
0035         __field(u16, lid)
0036         __field(u16, attr_id)
0037         __field(u16, pkey_index)
0038         __field(u8, base_version)
0039         __field(u8, mgmt_class)
0040         __field(u8, class_version)
0041         __field(u8, method)
0042         __field(u32, flow_label)
0043         __field(u16, mad_status)
0044         __field(u16, class_specific)
0045         __field(u32, attr_mod)
0046         __field(u64, tid)
0047         __array(u8, gid, 16)
0048         __field(u32, dev_index)
0049         __field(u8,  traffic_class)
0050     ),
0051 
0052     TP_fast_assign(
0053         __entry->dev_index = file->port->ib_dev->index;
0054         __entry->port_num = file->port->port_num;
0055 
0056         __entry->id = umad_hdr->id;
0057         __entry->status = umad_hdr->status;
0058         __entry->timeout_ms = umad_hdr->timeout_ms;
0059         __entry->retires = umad_hdr->retries;
0060         __entry->length = umad_hdr->length;
0061         __entry->qpn = umad_hdr->qpn;
0062         __entry->qkey = umad_hdr->qkey;
0063         __entry->lid = umad_hdr->lid;
0064         __entry->sl = umad_hdr->sl;
0065         __entry->path_bits = umad_hdr->path_bits;
0066         __entry->grh_present = umad_hdr->grh_present;
0067         __entry->gid_index = umad_hdr->gid_index;
0068         __entry->hop_limit = umad_hdr->hop_limit;
0069         __entry->traffic_class = umad_hdr->traffic_class;
0070         memcpy(__entry->gid, umad_hdr->gid, sizeof(umad_hdr->gid));
0071         __entry->flow_label = umad_hdr->flow_label;
0072         __entry->pkey_index = umad_hdr->pkey_index;
0073 
0074         __entry->base_version = mad_hdr->base_version;
0075         __entry->mgmt_class = mad_hdr->mgmt_class;
0076         __entry->class_version = mad_hdr->class_version;
0077         __entry->method = mad_hdr->method;
0078         __entry->mad_status = mad_hdr->status;
0079         __entry->class_specific = mad_hdr->class_specific;
0080         __entry->tid = mad_hdr->tid;
0081         __entry->attr_id = mad_hdr->attr_id;
0082         __entry->attr_mod = mad_hdr->attr_mod;
0083     ),
0084 
0085     TP_printk("%d:%d umad_hdr: id 0x%08x status 0x%08x ms %u ret %u " \
0086           "len %u QP%u qkey 0x%08x lid 0x%04x sl %u path_bits 0x%x " \
0087           "grh 0x%x gidi %u hop_lim %u traf_cl %u gid %pI6c " \
0088           "flow 0x%08x pkeyi %u  MAD: base_ver 0x%x class 0x%x " \
0089           "class_ver 0x%x method 0x%x status 0x%04x " \
0090           "class_specific 0x%04x tid 0x%016llx attr_id 0x%04x " \
0091           "attr_mod 0x%08x ",
0092         __entry->dev_index, __entry->port_num,
0093         __entry->id, __entry->status, __entry->timeout_ms,
0094         __entry->retires, __entry->length, be32_to_cpu(__entry->qpn),
0095         be32_to_cpu(__entry->qkey), be16_to_cpu(__entry->lid),
0096         __entry->sl, __entry->path_bits, __entry->grh_present,
0097         __entry->gid_index, __entry->hop_limit,
0098         __entry->traffic_class, &__entry->gid,
0099         be32_to_cpu(__entry->flow_label), __entry->pkey_index,
0100         __entry->base_version, __entry->mgmt_class,
0101         __entry->class_version, __entry->method,
0102         be16_to_cpu(__entry->mad_status),
0103         be16_to_cpu(__entry->class_specific),
0104         be64_to_cpu(__entry->tid), be16_to_cpu(__entry->attr_id),
0105         be32_to_cpu(__entry->attr_mod)
0106     )
0107 );
0108 
0109 DEFINE_EVENT(ib_umad_template, ib_umad_write,
0110     TP_PROTO(struct ib_umad_file *file, struct ib_user_mad_hdr *umad_hdr,
0111          struct ib_mad_hdr *mad_hdr),
0112     TP_ARGS(file, umad_hdr, mad_hdr));
0113 
0114 DEFINE_EVENT(ib_umad_template, ib_umad_read_recv,
0115     TP_PROTO(struct ib_umad_file *file, struct ib_user_mad_hdr *umad_hdr,
0116          struct ib_mad_hdr *mad_hdr),
0117     TP_ARGS(file, umad_hdr, mad_hdr));
0118 
0119 DEFINE_EVENT(ib_umad_template, ib_umad_read_send,
0120     TP_PROTO(struct ib_umad_file *file, struct ib_user_mad_hdr *umad_hdr,
0121          struct ib_mad_hdr *mad_hdr),
0122     TP_ARGS(file, umad_hdr, mad_hdr));
0123 
0124 #endif /* _TRACE_IB_UMAD_H */
0125 
0126 #include <trace/define_trace.h>