1*d164bf64SCai Huoqing /* SPDX-License-Identifier: GPL-2.0 or BSD-3-Clause */ 2cf4c2f8cSDennis Dalessandro /* 3cf4c2f8cSDennis Dalessandro * Copyright(c) 2016 Intel Corporation. 4cf4c2f8cSDennis Dalessandro */ 5cf4c2f8cSDennis Dalessandro #if !defined(__RVT_TRACE_QP_H) || defined(TRACE_HEADER_MULTI_READ) 6cf4c2f8cSDennis Dalessandro #define __RVT_TRACE_QP_H 7cf4c2f8cSDennis Dalessandro 8cf4c2f8cSDennis Dalessandro #include <linux/tracepoint.h> 9cf4c2f8cSDennis Dalessandro #include <linux/trace_seq.h> 10cf4c2f8cSDennis Dalessandro 11cf4c2f8cSDennis Dalessandro #include <rdma/ib_verbs.h> 12715ab1a8SMike Marciniszyn #include <rdma/rdmavt_qp.h> 13cf4c2f8cSDennis Dalessandro 14cf4c2f8cSDennis Dalessandro #undef TRACE_SYSTEM 15cf4c2f8cSDennis Dalessandro #define TRACE_SYSTEM rvt_qp 16cf4c2f8cSDennis Dalessandro 17cf4c2f8cSDennis Dalessandro DECLARE_EVENT_CLASS(rvt_qphash_template, 18cf4c2f8cSDennis Dalessandro TP_PROTO(struct rvt_qp *qp, u32 bucket), 19cf4c2f8cSDennis Dalessandro TP_ARGS(qp, bucket), 20cf4c2f8cSDennis Dalessandro TP_STRUCT__entry( 21cf4c2f8cSDennis Dalessandro RDI_DEV_ENTRY(ib_to_rvt(qp->ibqp.device)) 22cf4c2f8cSDennis Dalessandro __field(u32, qpn) 23cf4c2f8cSDennis Dalessandro __field(u32, bucket) 24cf4c2f8cSDennis Dalessandro ), 25cf4c2f8cSDennis Dalessandro TP_fast_assign( 2678c14b38SJoe Perches RDI_DEV_ASSIGN(ib_to_rvt(qp->ibqp.device)); 27cf4c2f8cSDennis Dalessandro __entry->qpn = qp->ibqp.qp_num; 28cf4c2f8cSDennis Dalessandro __entry->bucket = bucket; 29cf4c2f8cSDennis Dalessandro ), 30cf4c2f8cSDennis Dalessandro TP_printk( 31cf4c2f8cSDennis Dalessandro "[%s] qpn 0x%x bucket %u", 32cf4c2f8cSDennis Dalessandro __get_str(dev), 33cf4c2f8cSDennis Dalessandro __entry->qpn, 34cf4c2f8cSDennis Dalessandro __entry->bucket 35cf4c2f8cSDennis Dalessandro ) 36cf4c2f8cSDennis Dalessandro ); 37cf4c2f8cSDennis Dalessandro 38cf4c2f8cSDennis Dalessandro DEFINE_EVENT(rvt_qphash_template, rvt_qpinsert, 39cf4c2f8cSDennis Dalessandro TP_PROTO(struct rvt_qp *qp, u32 bucket), 40cf4c2f8cSDennis Dalessandro TP_ARGS(qp, bucket)); 41cf4c2f8cSDennis Dalessandro 42cf4c2f8cSDennis Dalessandro DEFINE_EVENT(rvt_qphash_template, rvt_qpremove, 43cf4c2f8cSDennis Dalessandro TP_PROTO(struct rvt_qp *qp, u32 bucket), 44cf4c2f8cSDennis Dalessandro TP_ARGS(qp, bucket)); 45cf4c2f8cSDennis Dalessandro 4657f6b663SKaike Wan DECLARE_EVENT_CLASS( 4757f6b663SKaike Wan rvt_rnrnak_template, 4857f6b663SKaike Wan TP_PROTO(struct rvt_qp *qp, u32 to), 4957f6b663SKaike Wan TP_ARGS(qp, to), 5057f6b663SKaike Wan TP_STRUCT__entry( 5157f6b663SKaike Wan RDI_DEV_ENTRY(ib_to_rvt(qp->ibqp.device)) 5257f6b663SKaike Wan __field(u32, qpn) 5357f6b663SKaike Wan __field(void *, hrtimer) 5457f6b663SKaike Wan __field(u32, s_flags) 5557f6b663SKaike Wan __field(u32, to) 5657f6b663SKaike Wan ), 5757f6b663SKaike Wan TP_fast_assign( 5878c14b38SJoe Perches RDI_DEV_ASSIGN(ib_to_rvt(qp->ibqp.device)); 5957f6b663SKaike Wan __entry->qpn = qp->ibqp.qp_num; 6057f6b663SKaike Wan __entry->hrtimer = &qp->s_rnr_timer; 6157f6b663SKaike Wan __entry->s_flags = qp->s_flags; 6257f6b663SKaike Wan __entry->to = to; 6357f6b663SKaike Wan ), 6457f6b663SKaike Wan TP_printk( 6557f6b663SKaike Wan "[%s] qpn 0x%x hrtimer 0x%p s_flags 0x%x timeout %u us", 6657f6b663SKaike Wan __get_str(dev), 6757f6b663SKaike Wan __entry->qpn, 6857f6b663SKaike Wan __entry->hrtimer, 6957f6b663SKaike Wan __entry->s_flags, 7057f6b663SKaike Wan __entry->to 7157f6b663SKaike Wan ) 7257f6b663SKaike Wan ); 7357f6b663SKaike Wan 7457f6b663SKaike Wan DEFINE_EVENT( 7557f6b663SKaike Wan rvt_rnrnak_template, rvt_rnrnak_add, 7657f6b663SKaike Wan TP_PROTO(struct rvt_qp *qp, u32 to), 7757f6b663SKaike Wan TP_ARGS(qp, to)); 7857f6b663SKaike Wan 7957f6b663SKaike Wan DEFINE_EVENT( 8057f6b663SKaike Wan rvt_rnrnak_template, rvt_rnrnak_timeout, 8157f6b663SKaike Wan TP_PROTO(struct rvt_qp *qp, u32 to), 8257f6b663SKaike Wan TP_ARGS(qp, to)); 8357f6b663SKaike Wan 8457f6b663SKaike Wan DEFINE_EVENT( 8557f6b663SKaike Wan rvt_rnrnak_template, rvt_rnrnak_stop, 8657f6b663SKaike Wan TP_PROTO(struct rvt_qp *qp, u32 to), 8757f6b663SKaike Wan TP_ARGS(qp, to)); 88cf4c2f8cSDennis Dalessandro 89cf4c2f8cSDennis Dalessandro #endif /* __RVT_TRACE_QP_H */ 90cf4c2f8cSDennis Dalessandro 91cf4c2f8cSDennis Dalessandro #undef TRACE_INCLUDE_PATH 92cf4c2f8cSDennis Dalessandro #undef TRACE_INCLUDE_FILE 93cf4c2f8cSDennis Dalessandro #define TRACE_INCLUDE_PATH . 94cf4c2f8cSDennis Dalessandro #define TRACE_INCLUDE_FILE trace_qp 95cf4c2f8cSDennis Dalessandro #include <trace/define_trace.h> 96cf4c2f8cSDennis Dalessandro 97