Commit 8bd516bd authored by Mike Marciniszyn's avatar Mike Marciniszyn Committed by Jason Gunthorpe

IB/rdmavt: Add trace for map_mr_sg

Add trace to debug map_mr_sg handling.
Reviewed-by: default avatarKaike Wan <kaike.wan@intel.com>
Signed-off-by: default avatarMike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: default avatarDennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent 315aed11
...@@ -642,6 +642,7 @@ int rvt_map_mr_sg(struct ib_mr *ibmr, struct scatterlist *sg, ...@@ -642,6 +642,7 @@ int rvt_map_mr_sg(struct ib_mr *ibmr, struct scatterlist *sg,
mr->mr.iova = ibmr->iova; mr->mr.iova = ibmr->iova;
mr->mr.offset = ibmr->iova - (u64)mr->mr.map[0]->segs[0].vaddr; mr->mr.offset = ibmr->iova - (u64)mr->mr.map[0]->segs[0].vaddr;
mr->mr.length = (size_t)ibmr->length; mr->mr.length = (size_t)ibmr->length;
trace_rvt_map_mr_sg(ibmr, sg_nents, sg_offset);
return ret; return ret;
} }
......
...@@ -54,6 +54,8 @@ ...@@ -54,6 +54,8 @@
#include <rdma/rdma_vt.h> #include <rdma/rdma_vt.h>
#include <rdma/rdmavt_mr.h> #include <rdma/rdmavt_mr.h>
#include "mr.h"
#undef TRACE_SYSTEM #undef TRACE_SYSTEM
#define TRACE_SYSTEM rvt_mr #define TRACE_SYSTEM rvt_mr
DECLARE_EVENT_CLASS( DECLARE_EVENT_CLASS(
...@@ -179,6 +181,40 @@ DEFINE_EVENT( ...@@ -179,6 +181,40 @@ DEFINE_EVENT(
TP_PROTO(struct rvt_sge *sge, struct ib_sge *isge), TP_PROTO(struct rvt_sge *sge, struct ib_sge *isge),
TP_ARGS(sge, isge)); TP_ARGS(sge, isge));
TRACE_EVENT(
rvt_map_mr_sg,
TP_PROTO(struct ib_mr *ibmr, int sg_nents, unsigned int *sg_offset),
TP_ARGS(ibmr, sg_nents, sg_offset),
TP_STRUCT__entry(
RDI_DEV_ENTRY(ib_to_rvt(to_imr(ibmr)->mr.pd->device))
__field(u64, iova)
__field(u64, ibmr_iova)
__field(u64, user_base)
__field(u64, ibmr_length)
__field(int, sg_nents)
__field(uint, sg_offset)
),
TP_fast_assign(
RDI_DEV_ASSIGN(ib_to_rvt(to_imr(ibmr)->mr.pd->device))
__entry->ibmr_iova = ibmr->iova;
__entry->iova = to_imr(ibmr)->mr.iova;
__entry->user_base = to_imr(ibmr)->mr.user_base;
__entry->ibmr_length = to_imr(ibmr)->mr.length;
__entry->sg_nents = sg_nents;
__entry->sg_offset = sg_offset ? *sg_offset : 0;
),
TP_printk(
"[%s] ibmr_iova %llx iova %llx user_base %llx length %llx sg_nents %d sg_offset %u",
__get_str(dev),
__entry->ibmr_iova,
__entry->iova,
__entry->user_base,
__entry->ibmr_length,
__entry->sg_nents,
__entry->sg_offset
)
);
#endif /* __RVT_TRACE_MR_H */ #endif /* __RVT_TRACE_MR_H */
#undef TRACE_INCLUDE_PATH #undef TRACE_INCLUDE_PATH
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment