2018-01-20 11:16:34 -05:00
/* SPDX-License-Identifier: GPL-2.0 */
/*
2018-05-07 15:27:11 -04:00
* Copyright ( c ) 2017 , 2018 Oracle . All rights reserved .
*
* Trace point definitions for the " rpcrdma " subsystem .
2018-01-20 11:16:34 -05:00
*/
# undef TRACE_SYSTEM
# define TRACE_SYSTEM rpcrdma
# if !defined(_TRACE_RPCRDMA_H) || defined(TRACE_HEADER_MULTI_READ)
# define _TRACE_RPCRDMA_H
2018-12-19 11:00:06 -05:00
# include <linux/scatterlist.h>
2020-05-19 09:30:32 -04:00
# include <linux/sunrpc/rpc_rdma_cid.h>
2018-01-20 11:16:34 -05:00
# include <linux/tracepoint.h>
2020-08-17 09:53:11 -04:00
# include <rdma/ib_cm.h>
2018-01-20 11:16:34 -05:00
# include <trace/events/rdma.h>
2017-12-20 16:30:48 -05:00
/**
* * Event classes
* */
2020-05-19 09:30:32 -04:00
DECLARE_EVENT_CLASS ( rpcrdma_completion_class ,
TP_PROTO (
const struct ib_wc * wc ,
const struct rpc_rdma_cid * cid
) ,
TP_ARGS ( wc , cid ) ,
TP_STRUCT__entry (
__field ( u32 , cq_id )
__field ( int , completion_id )
__field ( unsigned long , status )
__field ( unsigned int , vendor_err )
) ,
TP_fast_assign (
__entry - > cq_id = cid - > ci_queue_id ;
__entry - > completion_id = cid - > ci_completion_id ;
__entry - > status = wc - > status ;
if ( wc - > status )
__entry - > vendor_err = wc - > vendor_err ;
else
__entry - > vendor_err = 0 ;
) ,
TP_printk ( " cq.id=%u cid=%d status=%s (%lu/0x%x) " ,
__entry - > cq_id , __entry - > completion_id ,
rdma_show_wc_status ( __entry - > status ) ,
__entry - > status , __entry - > vendor_err
)
) ;
# define DEFINE_COMPLETION_EVENT(name) \
DEFINE_EVENT ( rpcrdma_completion_class , name , \
TP_PROTO ( \
const struct ib_wc * wc , \
const struct rpc_rdma_cid * cid \
) , \
TP_ARGS ( wc , cid ) )
2021-04-19 14:03:38 -04:00
DECLARE_EVENT_CLASS ( rpcrdma_mr_completion_class ,
TP_PROTO (
const struct ib_wc * wc ,
const struct rpc_rdma_cid * cid
) ,
TP_ARGS ( wc , cid ) ,
TP_STRUCT__entry (
__field ( u32 , cq_id )
__field ( int , completion_id )
__field ( unsigned long , status )
__field ( unsigned int , vendor_err )
) ,
TP_fast_assign (
__entry - > cq_id = cid - > ci_queue_id ;
__entry - > completion_id = cid - > ci_completion_id ;
__entry - > status = wc - > status ;
if ( wc - > status )
__entry - > vendor_err = wc - > vendor_err ;
else
__entry - > vendor_err = 0 ;
) ,
TP_printk ( " cq.id=%u mr.id=%d status=%s (%lu/0x%x) " ,
__entry - > cq_id , __entry - > completion_id ,
rdma_show_wc_status ( __entry - > status ) ,
__entry - > status , __entry - > vendor_err
)
) ;
# define DEFINE_MR_COMPLETION_EVENT(name) \
DEFINE_EVENT ( rpcrdma_mr_completion_class , name , \
TP_PROTO ( \
const struct ib_wc * wc , \
const struct rpc_rdma_cid * cid \
) , \
TP_ARGS ( wc , cid ) )
2021-02-04 11:59:32 -05:00
DECLARE_EVENT_CLASS ( rpcrdma_receive_completion_class ,
TP_PROTO (
const struct ib_wc * wc ,
const struct rpc_rdma_cid * cid
) ,
TP_ARGS ( wc , cid ) ,
TP_STRUCT__entry (
__field ( u32 , cq_id )
__field ( int , completion_id )
__field ( u32 , received )
__field ( unsigned long , status )
__field ( unsigned int , vendor_err )
) ,
TP_fast_assign (
__entry - > cq_id = cid - > ci_queue_id ;
__entry - > completion_id = cid - > ci_completion_id ;
__entry - > status = wc - > status ;
if ( wc - > status ) {
__entry - > received = 0 ;
__entry - > vendor_err = wc - > vendor_err ;
} else {
__entry - > received = wc - > byte_len ;
__entry - > vendor_err = 0 ;
}
) ,
TP_printk ( " cq.id=%u cid=%d status=%s (%lu/0x%x) received=%u " ,
__entry - > cq_id , __entry - > completion_id ,
rdma_show_wc_status ( __entry - > status ) ,
__entry - > status , __entry - > vendor_err ,
__entry - > received
)
) ;
# define DEFINE_RECEIVE_COMPLETION_EVENT(name) \
DEFINE_EVENT ( rpcrdma_receive_completion_class , name , \
TP_PROTO ( \
const struct ib_wc * wc , \
const struct rpc_rdma_cid * cid \
) , \
TP_ARGS ( wc , cid ) )
2020-11-09 14:39:42 -05:00
DECLARE_EVENT_CLASS ( xprtrdma_reply_class ,
2017-12-20 16:30:48 -05:00
TP_PROTO (
const struct rpcrdma_rep * rep
) ,
TP_ARGS ( rep ) ,
TP_STRUCT__entry (
__field ( u32 , xid )
__field ( u32 , version )
__field ( u32 , proc )
2020-11-09 14:39:42 -05:00
__string ( addr , rpcrdma_addrstr ( rep - > rr_rxprt ) )
__string ( port , rpcrdma_portstr ( rep - > rr_rxprt ) )
2017-12-20 16:30:48 -05:00
) ,
TP_fast_assign (
__entry - > xid = be32_to_cpu ( rep - > rr_xid ) ;
__entry - > version = be32_to_cpu ( rep - > rr_vers ) ;
__entry - > proc = be32_to_cpu ( rep - > rr_proc ) ;
2020-11-09 14:39:42 -05:00
__assign_str ( addr , rpcrdma_addrstr ( rep - > rr_rxprt ) ) ;
__assign_str ( port , rpcrdma_portstr ( rep - > rr_rxprt ) ) ;
2017-12-20 16:30:48 -05:00
) ,
2020-11-09 14:39:42 -05:00
TP_printk ( " peer=[%s]:%s xid=0x%08x version=%u proc=%u " ,
__get_str ( addr ) , __get_str ( port ) ,
__entry - > xid , __entry - > version , __entry - > proc
2017-12-20 16:30:48 -05:00
)
) ;
# define DEFINE_REPLY_EVENT(name) \
2020-11-09 14:39:42 -05:00
DEFINE_EVENT ( xprtrdma_reply_class , \
xprtrdma_reply_ # # name # # _err , \
2017-12-20 16:30:48 -05:00
TP_PROTO ( \
const struct rpcrdma_rep * rep \
) , \
TP_ARGS ( rep ) )
2017-12-20 16:31:21 -05:00
DECLARE_EVENT_CLASS ( xprtrdma_rxprt ,
TP_PROTO (
const struct rpcrdma_xprt * r_xprt
) ,
TP_ARGS ( r_xprt ) ,
TP_STRUCT__entry (
__string ( addr , rpcrdma_addrstr ( r_xprt ) )
__string ( port , rpcrdma_portstr ( r_xprt ) )
) ,
TP_fast_assign (
__assign_str ( addr , rpcrdma_addrstr ( r_xprt ) ) ;
__assign_str ( port , rpcrdma_portstr ( r_xprt ) ) ;
) ,
2021-04-19 14:03:44 -04:00
TP_printk ( " peer=[%s]:%s " ,
__get_str ( addr ) , __get_str ( port )
2017-12-20 16:31:21 -05:00
)
) ;
# define DEFINE_RXPRT_EVENT(name) \
DEFINE_EVENT ( xprtrdma_rxprt , name , \
TP_PROTO ( \
const struct rpcrdma_xprt * r_xprt \
) , \
TP_ARGS ( r_xprt ) )
2019-10-23 10:01:58 -04:00
DECLARE_EVENT_CLASS ( xprtrdma_connect_class ,
TP_PROTO (
const struct rpcrdma_xprt * r_xprt ,
int rc
) ,
TP_ARGS ( r_xprt , rc ) ,
TP_STRUCT__entry (
__field ( int , rc )
__field ( int , connect_status )
__string ( addr , rpcrdma_addrstr ( r_xprt ) )
__string ( port , rpcrdma_portstr ( r_xprt ) )
) ,
TP_fast_assign (
__entry - > rc = rc ;
2020-02-21 17:01:05 -05:00
__entry - > connect_status = r_xprt - > rx_ep - > re_connect_status ;
2019-10-23 10:01:58 -04:00
__assign_str ( addr , rpcrdma_addrstr ( r_xprt ) ) ;
__assign_str ( port , rpcrdma_portstr ( r_xprt ) ) ;
) ,
2021-04-19 14:03:44 -04:00
TP_printk ( " peer=[%s]:%s rc=%d connection status=%d " ,
__get_str ( addr ) , __get_str ( port ) ,
2019-10-23 10:01:58 -04:00
__entry - > rc , __entry - > connect_status
)
) ;
# define DEFINE_CONN_EVENT(name) \
DEFINE_EVENT ( xprtrdma_connect_class , xprtrdma_ # # name , \
TP_PROTO ( \
const struct rpcrdma_xprt * r_xprt , \
int rc \
) , \
TP_ARGS ( r_xprt , rc ) )
2017-12-20 16:30:56 -05:00
DECLARE_EVENT_CLASS ( xprtrdma_rdch_event ,
TP_PROTO (
const struct rpc_task * task ,
unsigned int pos ,
struct rpcrdma_mr * mr ,
int nsegs
) ,
TP_ARGS ( task , pos , mr , nsegs ) ,
TP_STRUCT__entry (
__field ( unsigned int , task_id )
__field ( unsigned int , client_id )
__field ( unsigned int , pos )
__field ( int , nents )
__field ( u32 , handle )
__field ( u32 , length )
__field ( u64 , offset )
__field ( int , nsegs )
) ,
TP_fast_assign (
__entry - > task_id = task - > tk_pid ;
__entry - > client_id = task - > tk_client - > cl_clid ;
__entry - > pos = pos ;
__entry - > nents = mr - > mr_nents ;
__entry - > handle = mr - > mr_handle ;
__entry - > length = mr - > mr_length ;
__entry - > offset = mr - > mr_offset ;
__entry - > nsegs = nsegs ;
) ,
2018-12-19 10:59:49 -05:00
TP_printk ( " task:%u@%u pos=%u %u@0x%016llx:0x%08x (%s) " ,
__entry - > task_id , __entry - > client_id ,
2017-12-20 16:30:56 -05:00
__entry - > pos , __entry - > length ,
( unsigned long long ) __entry - > offset , __entry - > handle ,
__entry - > nents < __entry - > nsegs ? " more " : " last "
)
) ;
# define DEFINE_RDCH_EVENT(name) \
2018-12-19 10:59:49 -05:00
DEFINE_EVENT ( xprtrdma_rdch_event , xprtrdma_chunk_ # # name , \
2017-12-20 16:30:56 -05:00
TP_PROTO ( \
const struct rpc_task * task , \
unsigned int pos , \
struct rpcrdma_mr * mr , \
int nsegs \
) , \
TP_ARGS ( task , pos , mr , nsegs ) )
DECLARE_EVENT_CLASS ( xprtrdma_wrch_event ,
TP_PROTO (
const struct rpc_task * task ,
struct rpcrdma_mr * mr ,
int nsegs
) ,
TP_ARGS ( task , mr , nsegs ) ,
TP_STRUCT__entry (
__field ( unsigned int , task_id )
__field ( unsigned int , client_id )
__field ( int , nents )
__field ( u32 , handle )
__field ( u32 , length )
__field ( u64 , offset )
__field ( int , nsegs )
) ,
TP_fast_assign (
__entry - > task_id = task - > tk_pid ;
__entry - > client_id = task - > tk_client - > cl_clid ;
__entry - > nents = mr - > mr_nents ;
__entry - > handle = mr - > mr_handle ;
__entry - > length = mr - > mr_length ;
__entry - > offset = mr - > mr_offset ;
__entry - > nsegs = nsegs ;
) ,
2018-12-19 10:59:49 -05:00
TP_printk ( " task:%u@%u %u@0x%016llx:0x%08x (%s) " ,
__entry - > task_id , __entry - > client_id ,
2017-12-20 16:30:56 -05:00
__entry - > length , ( unsigned long long ) __entry - > offset ,
__entry - > handle ,
__entry - > nents < __entry - > nsegs ? " more " : " last "
)
) ;
# define DEFINE_WRCH_EVENT(name) \
2018-12-19 10:59:49 -05:00
DEFINE_EVENT ( xprtrdma_wrch_event , xprtrdma_chunk_ # # name , \
2017-12-20 16:30:56 -05:00
TP_PROTO ( \
const struct rpc_task * task , \
struct rpcrdma_mr * mr , \
int nsegs \
) , \
TP_ARGS ( task , mr , nsegs ) )
2018-12-19 10:59:49 -05:00
TRACE_DEFINE_ENUM ( DMA_BIDIRECTIONAL ) ;
TRACE_DEFINE_ENUM ( DMA_TO_DEVICE ) ;
TRACE_DEFINE_ENUM ( DMA_FROM_DEVICE ) ;
TRACE_DEFINE_ENUM ( DMA_NONE ) ;
# define xprtrdma_show_direction(x) \
__print_symbolic ( x , \
{ DMA_BIDIRECTIONAL , " BIDIR " } , \
{ DMA_TO_DEVICE , " TO_DEVICE " } , \
{ DMA_FROM_DEVICE , " FROM_DEVICE " } , \
{ DMA_NONE , " NONE " } )
2020-11-09 14:40:03 -05:00
DECLARE_EVENT_CLASS ( xprtrdma_mr_class ,
2017-12-20 16:30:56 -05:00
TP_PROTO (
2020-11-09 14:40:03 -05:00
const struct rpcrdma_mr * mr
2017-12-20 16:30:56 -05:00
) ,
2020-11-09 14:40:03 -05:00
TP_ARGS ( mr ) ,
2017-12-20 16:30:56 -05:00
TP_STRUCT__entry (
2020-11-09 14:40:03 -05:00
__field ( unsigned int , task_id )
__field ( unsigned int , client_id )
2020-02-12 11:12:35 -05:00
__field ( u32 , mr_id )
2020-11-09 14:40:03 -05:00
__field ( int , nents )
__field ( u32 , handle )
__field ( u32 , length )
__field ( u64 , offset )
__field ( u32 , dir )
2017-12-20 16:30:56 -05:00
) ,
TP_fast_assign (
2020-11-09 14:40:03 -05:00
const struct rpcrdma_req * req = mr - > mr_req ;
const struct rpc_task * task = req - > rl_slot . rq_task ;
__entry - > task_id = task - > tk_pid ;
__entry - > client_id = task - > tk_client - > cl_clid ;
2021-04-19 14:04:21 -04:00
__entry - > mr_id = mr - > mr_ibmr - > res . id ;
2020-11-09 14:40:03 -05:00
__entry - > nents = mr - > mr_nents ;
__entry - > handle = mr - > mr_handle ;
__entry - > length = mr - > mr_length ;
__entry - > offset = mr - > mr_offset ;
__entry - > dir = mr - > mr_dir ;
2017-12-20 16:30:56 -05:00
) ,
2020-11-09 14:40:03 -05:00
TP_printk ( " task:%u@%u mr.id=%u nents=%d %u@0x%016llx:0x%08x (%s) " ,
__entry - > task_id , __entry - > client_id ,
__entry - > mr_id , __entry - > nents , __entry - > length ,
( unsigned long long ) __entry - > offset , __entry - > handle ,
xprtrdma_show_direction ( __entry - > dir )
2017-12-20 16:30:56 -05:00
)
) ;
2020-11-09 14:40:03 -05:00
# define DEFINE_MR_EVENT(name) \
DEFINE_EVENT ( xprtrdma_mr_class , \
xprtrdma_mr_ # # name , \
2017-12-20 16:30:56 -05:00
TP_PROTO ( \
2020-11-09 14:40:03 -05:00
const struct rpcrdma_mr * mr \
2017-12-20 16:30:56 -05:00
) , \
2020-11-09 14:40:03 -05:00
TP_ARGS ( mr ) )
2018-12-19 10:59:49 -05:00
2020-11-09 14:40:03 -05:00
DECLARE_EVENT_CLASS ( xprtrdma_anonymous_mr_class ,
2017-12-20 16:31:12 -05:00
TP_PROTO (
const struct rpcrdma_mr * mr
) ,
TP_ARGS ( mr ) ,
TP_STRUCT__entry (
2020-02-12 11:12:35 -05:00
__field ( u32 , mr_id )
__field ( int , nents )
2017-12-20 16:31:12 -05:00
__field ( u32 , handle )
__field ( u32 , length )
__field ( u64 , offset )
2018-12-19 10:59:49 -05:00
__field ( u32 , dir )
2017-12-20 16:31:12 -05:00
) ,
TP_fast_assign (
2021-04-19 14:04:21 -04:00
__entry - > mr_id = mr - > mr_ibmr - > res . id ;
2020-02-12 11:12:35 -05:00
__entry - > nents = mr - > mr_nents ;
2017-12-20 16:31:12 -05:00
__entry - > handle = mr - > mr_handle ;
__entry - > length = mr - > mr_length ;
__entry - > offset = mr - > mr_offset ;
2018-12-19 10:59:49 -05:00
__entry - > dir = mr - > mr_dir ;
2017-12-20 16:31:12 -05:00
) ,
2020-02-12 11:12:35 -05:00
TP_printk ( " mr.id=%u nents=%d %u@0x%016llx:0x%08x (%s) " ,
__entry - > mr_id , __entry - > nents , __entry - > length ,
2018-12-19 10:59:49 -05:00
( unsigned long long ) __entry - > offset , __entry - > handle ,
xprtrdma_show_direction ( __entry - > dir )
2017-12-20 16:31:12 -05:00
)
) ;
2020-11-09 14:40:03 -05:00
# define DEFINE_ANON_MR_EVENT(name) \
DEFINE_EVENT ( xprtrdma_anonymous_mr_class , \
xprtrdma_mr_ # # name , \
TP_PROTO ( \
const struct rpcrdma_mr * mr \
) , \
2017-12-20 16:31:12 -05:00
TP_ARGS ( mr ) )
2020-11-09 14:39:53 -05:00
DECLARE_EVENT_CLASS ( xprtrdma_callback_class ,
2017-12-20 16:31:37 -05:00
TP_PROTO (
2020-11-09 14:39:53 -05:00
const struct rpcrdma_xprt * r_xprt ,
2017-12-20 16:31:37 -05:00
const struct rpc_rqst * rqst
) ,
2020-11-09 14:39:53 -05:00
TP_ARGS ( r_xprt , rqst ) ,
2017-12-20 16:31:37 -05:00
TP_STRUCT__entry (
__field ( u32 , xid )
2020-11-09 14:39:53 -05:00
__string ( addr , rpcrdma_addrstr ( r_xprt ) )
__string ( port , rpcrdma_portstr ( r_xprt ) )
2017-12-20 16:31:37 -05:00
) ,
TP_fast_assign (
__entry - > xid = be32_to_cpu ( rqst - > rq_xid ) ;
2020-11-09 14:39:53 -05:00
__assign_str ( addr , rpcrdma_addrstr ( r_xprt ) ) ;
__assign_str ( port , rpcrdma_portstr ( r_xprt ) ) ;
2017-12-20 16:31:37 -05:00
) ,
2020-11-09 14:39:53 -05:00
TP_printk ( " peer=[%s]:%s xid=0x%08x " ,
__get_str ( addr ) , __get_str ( port ) , __entry - > xid
2017-12-20 16:31:37 -05:00
)
) ;
2020-11-09 14:39:53 -05:00
# define DEFINE_CALLBACK_EVENT(name) \
DEFINE_EVENT ( xprtrdma_callback_class , \
xprtrdma_cb_ # # name , \
2017-12-20 16:31:37 -05:00
TP_PROTO ( \
2020-11-09 14:39:53 -05:00
const struct rpcrdma_xprt * r_xprt , \
2017-12-20 16:31:37 -05:00
const struct rpc_rqst * rqst \
) , \
2020-11-09 14:39:53 -05:00
TP_ARGS ( r_xprt , rqst ) )
2017-12-20 16:31:37 -05:00
2017-12-20 16:31:29 -05:00
/**
* * Connection events
* */
2019-10-23 10:02:09 -04:00
TRACE_EVENT ( xprtrdma_inline_thresh ,
TP_PROTO (
2020-02-21 17:01:00 -05:00
const struct rpcrdma_ep * ep
2019-10-23 10:02:09 -04:00
) ,
2020-02-21 17:01:00 -05:00
TP_ARGS ( ep ) ,
2019-10-23 10:02:09 -04:00
TP_STRUCT__entry (
__field ( unsigned int , inline_send )
__field ( unsigned int , inline_recv )
__field ( unsigned int , max_send )
__field ( unsigned int , max_recv )
2020-02-21 17:01:00 -05:00
__array ( unsigned char , srcaddr , sizeof ( struct sockaddr_in6 ) )
__array ( unsigned char , dstaddr , sizeof ( struct sockaddr_in6 ) )
2019-10-23 10:02:09 -04:00
) ,
TP_fast_assign (
2020-02-21 17:01:00 -05:00
const struct rdma_cm_id * id = ep - > re_id ;
2019-10-23 10:02:09 -04:00
2020-02-21 17:00:54 -05:00
__entry - > inline_send = ep - > re_inline_send ;
__entry - > inline_recv = ep - > re_inline_recv ;
__entry - > max_send = ep - > re_max_inline_send ;
__entry - > max_recv = ep - > re_max_inline_recv ;
2020-02-21 17:01:00 -05:00
memcpy ( __entry - > srcaddr , & id - > route . addr . src_addr ,
sizeof ( struct sockaddr_in6 ) ) ;
memcpy ( __entry - > dstaddr , & id - > route . addr . dst_addr ,
sizeof ( struct sockaddr_in6 ) ) ;
2019-10-23 10:02:09 -04:00
) ,
2020-02-21 17:01:00 -05:00
TP_printk ( " %pISpc -> %pISpc neg send/recv=%u/%u, calc send/recv=%u/%u " ,
__entry - > srcaddr , __entry - > dstaddr ,
2019-10-23 10:02:09 -04:00
__entry - > inline_send , __entry - > inline_recv ,
__entry - > max_send , __entry - > max_recv
)
) ;
2019-10-23 10:01:58 -04:00
DEFINE_CONN_EVENT ( connect ) ;
DEFINE_CONN_EVENT ( disconnect ) ;
DEFINE_RXPRT_EVENT ( xprtrdma_op_inject_dsc ) ;
TRACE_EVENT ( xprtrdma_op_connect ,
2017-12-20 16:31:29 -05:00
TP_PROTO (
const struct rpcrdma_xprt * r_xprt ,
2019-10-23 10:01:58 -04:00
unsigned long delay
2017-12-20 16:31:29 -05:00
) ,
2019-10-23 10:01:58 -04:00
TP_ARGS ( r_xprt , delay ) ,
2017-12-20 16:31:29 -05:00
TP_STRUCT__entry (
2019-10-23 10:01:58 -04:00
__field ( unsigned long , delay )
2017-12-20 16:31:29 -05:00
__string ( addr , rpcrdma_addrstr ( r_xprt ) )
__string ( port , rpcrdma_portstr ( r_xprt ) )
) ,
TP_fast_assign (
2019-10-23 10:01:58 -04:00
__entry - > delay = delay ;
2017-12-20 16:31:29 -05:00
__assign_str ( addr , rpcrdma_addrstr ( r_xprt ) ) ;
__assign_str ( port , rpcrdma_portstr ( r_xprt ) ) ;
) ,
2021-04-19 14:03:44 -04:00
TP_printk ( " peer=[%s]:%s delay=%lu " ,
__get_str ( addr ) , __get_str ( port ) , __entry - > delay
2017-12-20 16:31:29 -05:00
)
) ;
2019-06-19 10:33:42 -04:00
TRACE_EVENT ( xprtrdma_op_set_cto ,
TP_PROTO (
const struct rpcrdma_xprt * r_xprt ,
unsigned long connect ,
unsigned long reconnect
) ,
TP_ARGS ( r_xprt , connect , reconnect ) ,
TP_STRUCT__entry (
__field ( unsigned long , connect )
__field ( unsigned long , reconnect )
__string ( addr , rpcrdma_addrstr ( r_xprt ) )
__string ( port , rpcrdma_portstr ( r_xprt ) )
) ,
TP_fast_assign (
__entry - > connect = connect ;
__entry - > reconnect = reconnect ;
__assign_str ( addr , rpcrdma_addrstr ( r_xprt ) ) ;
__assign_str ( port , rpcrdma_portstr ( r_xprt ) ) ;
) ,
2021-04-19 14:03:44 -04:00
TP_printk ( " peer=[%s]:%s connect=%lu reconnect=%lu " ,
__get_str ( addr ) , __get_str ( port ) ,
2019-06-19 10:33:42 -04:00
__entry - > connect / HZ , __entry - > reconnect / HZ
)
) ;
2017-12-20 16:30:40 -05:00
/**
* * Call events
* */
2017-12-20 16:31:21 -05:00
TRACE_EVENT ( xprtrdma_createmrs ,
TP_PROTO (
const struct rpcrdma_xprt * r_xprt ,
unsigned int count
) ,
TP_ARGS ( r_xprt , count ) ,
TP_STRUCT__entry (
2019-08-19 18:47:10 -04:00
__string ( addr , rpcrdma_addrstr ( r_xprt ) )
__string ( port , rpcrdma_portstr ( r_xprt ) )
2017-12-20 16:31:21 -05:00
__field ( unsigned int , count )
) ,
TP_fast_assign (
__entry - > count = count ;
2019-08-19 18:47:10 -04:00
__assign_str ( addr , rpcrdma_addrstr ( r_xprt ) ) ;
__assign_str ( port , rpcrdma_portstr ( r_xprt ) ) ;
2017-12-20 16:31:21 -05:00
) ,
2021-04-19 14:03:44 -04:00
TP_printk ( " peer=[%s]:%s created %u MRs " ,
__get_str ( addr ) , __get_str ( port ) , __entry - > count
2019-08-19 18:47:10 -04:00
)
) ;
2020-11-09 14:39:58 -05:00
TRACE_EVENT ( xprtrdma_nomrs_err ,
2019-08-19 18:45:37 -04:00
TP_PROTO (
2020-11-09 14:39:58 -05:00
const struct rpcrdma_xprt * r_xprt ,
2019-08-19 18:45:37 -04:00
const struct rpcrdma_req * req
) ,
2020-11-09 14:39:58 -05:00
TP_ARGS ( r_xprt , req ) ,
2019-08-19 18:45:37 -04:00
TP_STRUCT__entry (
__field ( unsigned int , task_id )
__field ( unsigned int , client_id )
2020-11-09 14:39:58 -05:00
__string ( addr , rpcrdma_addrstr ( r_xprt ) )
__string ( port , rpcrdma_portstr ( r_xprt ) )
2019-08-19 18:45:37 -04:00
) ,
TP_fast_assign (
const struct rpc_rqst * rqst = & req - > rl_slot ;
__entry - > task_id = rqst - > rq_task - > tk_pid ;
__entry - > client_id = rqst - > rq_task - > tk_client - > cl_clid ;
2020-11-09 14:39:58 -05:00
__assign_str ( addr , rpcrdma_addrstr ( r_xprt ) ) ;
__assign_str ( port , rpcrdma_portstr ( r_xprt ) ) ;
2019-08-19 18:45:37 -04:00
) ,
2020-11-09 14:39:58 -05:00
TP_printk ( " peer=[%s]:%s task:%u@%u " ,
__get_str ( addr ) , __get_str ( port ) ,
__entry - > task_id , __entry - > client_id
2019-08-19 18:45:37 -04:00
)
) ;
2017-12-20 16:31:21 -05:00
2018-12-19 10:59:49 -05:00
DEFINE_RDCH_EVENT ( read ) ;
DEFINE_WRCH_EVENT ( write ) ;
DEFINE_WRCH_EVENT ( reply ) ;
2017-12-20 16:30:56 -05:00
2017-12-20 16:30:40 -05:00
TRACE_DEFINE_ENUM ( rpcrdma_noch ) ;
2019-10-17 14:31:53 -04:00
TRACE_DEFINE_ENUM ( rpcrdma_noch_pullup ) ;
TRACE_DEFINE_ENUM ( rpcrdma_noch_mapped ) ;
2017-12-20 16:30:40 -05:00
TRACE_DEFINE_ENUM ( rpcrdma_readch ) ;
TRACE_DEFINE_ENUM ( rpcrdma_areadch ) ;
TRACE_DEFINE_ENUM ( rpcrdma_writech ) ;
TRACE_DEFINE_ENUM ( rpcrdma_replych ) ;
# define xprtrdma_show_chunktype(x) \
__print_symbolic ( x , \
{ rpcrdma_noch , " inline " } , \
2019-10-17 14:31:53 -04:00
{ rpcrdma_noch_pullup , " pullup " } , \
{ rpcrdma_noch_mapped , " mapped " } , \
2017-12-20 16:30:40 -05:00
{ rpcrdma_readch , " read list " } , \
{ rpcrdma_areadch , " *read list " } , \
{ rpcrdma_writech , " write list " } , \
{ rpcrdma_replych , " reply chunk " } )
TRACE_EVENT ( xprtrdma_marshal ,
TP_PROTO (
2019-06-19 10:32:43 -04:00
const struct rpcrdma_req * req ,
2017-12-20 16:30:40 -05:00
unsigned int rtype ,
unsigned int wtype
) ,
2019-06-19 10:32:43 -04:00
TP_ARGS ( req , rtype , wtype ) ,
2017-12-20 16:30:40 -05:00
TP_STRUCT__entry (
__field ( unsigned int , task_id )
__field ( unsigned int , client_id )
__field ( u32 , xid )
__field ( unsigned int , hdrlen )
__field ( unsigned int , headlen )
__field ( unsigned int , pagelen )
__field ( unsigned int , taillen )
__field ( unsigned int , rtype )
__field ( unsigned int , wtype )
) ,
TP_fast_assign (
2019-06-19 10:32:43 -04:00
const struct rpc_rqst * rqst = & req - > rl_slot ;
2017-12-20 16:30:40 -05:00
__entry - > task_id = rqst - > rq_task - > tk_pid ;
__entry - > client_id = rqst - > rq_task - > tk_client - > cl_clid ;
__entry - > xid = be32_to_cpu ( rqst - > rq_xid ) ;
2019-06-19 10:32:43 -04:00
__entry - > hdrlen = req - > rl_hdrbuf . len ;
2017-12-20 16:30:40 -05:00
__entry - > headlen = rqst - > rq_snd_buf . head [ 0 ] . iov_len ;
__entry - > pagelen = rqst - > rq_snd_buf . page_len ;
__entry - > taillen = rqst - > rq_snd_buf . tail [ 0 ] . iov_len ;
__entry - > rtype = rtype ;
__entry - > wtype = wtype ;
) ,
TP_printk ( " task:%u@%u xid=0x%08x: hdr=%u xdr=%u/%u/%u %s/%s " ,
__entry - > task_id , __entry - > client_id , __entry - > xid ,
__entry - > hdrlen ,
__entry - > headlen , __entry - > pagelen , __entry - > taillen ,
xprtrdma_show_chunktype ( __entry - > rtype ) ,
xprtrdma_show_chunktype ( __entry - > wtype )
)
) ;
2019-04-24 09:39:48 -04:00
TRACE_EVENT ( xprtrdma_marshal_failed ,
TP_PROTO ( const struct rpc_rqst * rqst ,
int ret
) ,
TP_ARGS ( rqst , ret ) ,
TP_STRUCT__entry (
__field ( unsigned int , task_id )
__field ( unsigned int , client_id )
__field ( u32 , xid )
__field ( int , ret )
) ,
TP_fast_assign (
__entry - > task_id = rqst - > rq_task - > tk_pid ;
__entry - > client_id = rqst - > rq_task - > tk_client - > cl_clid ;
__entry - > xid = be32_to_cpu ( rqst - > rq_xid ) ;
__entry - > ret = ret ;
) ,
TP_printk ( " task:%u@%u xid=0x%08x: ret=%d " ,
__entry - > task_id , __entry - > client_id , __entry - > xid ,
__entry - > ret
)
) ;
2019-06-19 10:32:48 -04:00
TRACE_EVENT ( xprtrdma_prepsend_failed ,
TP_PROTO ( const struct rpc_rqst * rqst ,
int ret
) ,
TP_ARGS ( rqst , ret ) ,
TP_STRUCT__entry (
__field ( unsigned int , task_id )
__field ( unsigned int , client_id )
__field ( u32 , xid )
__field ( int , ret )
) ,
TP_fast_assign (
__entry - > task_id = rqst - > rq_task - > tk_pid ;
__entry - > client_id = rqst - > rq_task - > tk_client - > cl_clid ;
__entry - > xid = be32_to_cpu ( rqst - > rq_xid ) ;
__entry - > ret = ret ;
) ,
TP_printk ( " task:%u@%u xid=0x%08x: ret=%d " ,
__entry - > task_id , __entry - > client_id , __entry - > xid ,
__entry - > ret
)
) ;
2017-12-20 16:30:40 -05:00
TRACE_EVENT ( xprtrdma_post_send ,
TP_PROTO (
2020-04-19 20:03:05 -04:00
const struct rpcrdma_req * req
2017-12-20 16:30:40 -05:00
) ,
2020-04-19 20:03:05 -04:00
TP_ARGS ( req ) ,
2017-12-20 16:30:40 -05:00
TP_STRUCT__entry (
2020-11-09 14:39:26 -05:00
__field ( u32 , cq_id )
__field ( int , completion_id )
2019-02-11 11:25:04 -05:00
__field ( unsigned int , task_id )
__field ( unsigned int , client_id )
2017-12-20 16:30:40 -05:00
__field ( int , num_sge )
2018-10-01 14:26:51 -04:00
__field ( int , signaled )
2017-12-20 16:30:40 -05:00
) ,
TP_fast_assign (
2019-02-11 11:25:04 -05:00
const struct rpc_rqst * rqst = & req - > rl_slot ;
2020-11-09 14:39:26 -05:00
const struct rpcrdma_sendctx * sc = req - > rl_sendctx ;
2019-02-11 11:25:04 -05:00
2020-11-09 14:39:26 -05:00
__entry - > cq_id = sc - > sc_cid . ci_queue_id ;
__entry - > completion_id = sc - > sc_cid . ci_completion_id ;
2019-02-11 11:25:04 -05:00
__entry - > task_id = rqst - > rq_task - > tk_pid ;
2019-06-19 10:32:32 -04:00
__entry - > client_id = rqst - > rq_task - > tk_client ?
rqst - > rq_task - > tk_client - > cl_clid : - 1 ;
2019-10-17 14:31:35 -04:00
__entry - > num_sge = req - > rl_wr . num_sge ;
__entry - > signaled = req - > rl_wr . send_flags & IB_SEND_SIGNALED ;
2017-12-20 16:30:40 -05:00
) ,
2020-11-09 14:39:26 -05:00
TP_printk ( " task:%u@%u cq.id=%u cid=%d (%d SGE%s) %s " ,
2019-02-11 11:25:04 -05:00
__entry - > task_id , __entry - > client_id ,
2020-11-09 14:39:26 -05:00
__entry - > cq_id , __entry - > completion_id ,
__entry - > num_sge , ( __entry - > num_sge = = 1 ? " " : " s " ) ,
2020-04-19 20:03:05 -04:00
( __entry - > signaled ? " signaled " : " " )
2017-12-20 16:30:40 -05:00
)
) ;
2021-08-02 14:44:36 -04:00
TRACE_EVENT ( xprtrdma_post_send_err ,
TP_PROTO (
const struct rpcrdma_xprt * r_xprt ,
const struct rpcrdma_req * req ,
int rc
) ,
TP_ARGS ( r_xprt , req , rc ) ,
TP_STRUCT__entry (
__field ( u32 , cq_id )
__field ( unsigned int , task_id )
__field ( unsigned int , client_id )
__field ( int , rc )
) ,
TP_fast_assign (
const struct rpc_rqst * rqst = & req - > rl_slot ;
const struct rpcrdma_ep * ep = r_xprt - > rx_ep ;
__entry - > cq_id = ep ? ep - > re_attr . recv_cq - > res . id : 0 ;
__entry - > task_id = rqst - > rq_task - > tk_pid ;
__entry - > client_id = rqst - > rq_task - > tk_client ?
rqst - > rq_task - > tk_client - > cl_clid : - 1 ;
__entry - > rc = rc ;
) ,
TP_printk ( " task:%u@%u cq.id=%u rc=%d " ,
__entry - > task_id , __entry - > client_id ,
__entry - > cq_id , __entry - > rc
)
) ;
2017-12-20 16:30:48 -05:00
TRACE_EVENT ( xprtrdma_post_recv ,
TP_PROTO (
2019-08-19 18:41:44 -04:00
const struct rpcrdma_rep * rep
2017-12-20 16:30:48 -05:00
) ,
2019-08-19 18:41:44 -04:00
TP_ARGS ( rep ) ,
2017-12-20 16:30:48 -05:00
TP_STRUCT__entry (
2020-11-09 14:39:21 -05:00
__field ( u32 , cq_id )
__field ( int , completion_id )
2017-12-20 16:30:48 -05:00
) ,
TP_fast_assign (
2020-11-09 14:39:21 -05:00
__entry - > cq_id = rep - > rr_cid . ci_queue_id ;
__entry - > completion_id = rep - > rr_cid . ci_completion_id ;
2017-12-20 16:30:48 -05:00
) ,
2020-11-09 14:39:21 -05:00
TP_printk ( " cq.id=%d cid=%d " ,
__entry - > cq_id , __entry - > completion_id
2017-12-20 16:30:48 -05:00
)
) ;
2018-05-04 15:35:20 -04:00
TRACE_EVENT ( xprtrdma_post_recvs ,
TP_PROTO (
const struct rpcrdma_xprt * r_xprt ,
2021-08-02 14:44:30 -04:00
unsigned int count
2017-12-20 16:30:48 -05:00
) ,
2021-08-02 14:44:30 -04:00
TP_ARGS ( r_xprt , count ) ,
2017-12-20 16:30:48 -05:00
TP_STRUCT__entry (
2021-04-19 14:03:44 -04:00
__field ( u32 , cq_id )
2018-05-04 15:35:20 -04:00
__field ( unsigned int , count )
__field ( int , posted )
__string ( addr , rpcrdma_addrstr ( r_xprt ) )
__string ( port , rpcrdma_portstr ( r_xprt ) )
2017-12-20 16:30:48 -05:00
) ,
TP_fast_assign (
2021-04-19 14:03:44 -04:00
const struct rpcrdma_ep * ep = r_xprt - > rx_ep ;
__entry - > cq_id = ep - > re_attr . recv_cq - > res . id ;
2018-05-04 15:35:20 -04:00
__entry - > count = count ;
2021-04-19 14:03:44 -04:00
__entry - > posted = ep - > re_receive_count ;
2018-05-04 15:35:20 -04:00
__assign_str ( addr , rpcrdma_addrstr ( r_xprt ) ) ;
__assign_str ( port , rpcrdma_portstr ( r_xprt ) ) ;
2017-12-20 16:30:48 -05:00
) ,
2021-08-02 14:44:30 -04:00
TP_printk ( " peer=[%s]:%s cq.id=%d %u new recvs, %d active " ,
__get_str ( addr ) , __get_str ( port ) , __entry - > cq_id ,
__entry - > count , __entry - > posted
)
) ;
TRACE_EVENT ( xprtrdma_post_recvs_err ,
TP_PROTO (
const struct rpcrdma_xprt * r_xprt ,
int status
) ,
TP_ARGS ( r_xprt , status ) ,
TP_STRUCT__entry (
__field ( u32 , cq_id )
__field ( int , status )
__string ( addr , rpcrdma_addrstr ( r_xprt ) )
__string ( port , rpcrdma_portstr ( r_xprt ) )
) ,
TP_fast_assign (
const struct rpcrdma_ep * ep = r_xprt - > rx_ep ;
__entry - > cq_id = ep - > re_attr . recv_cq - > res . id ;
__entry - > status = status ;
__assign_str ( addr , rpcrdma_addrstr ( r_xprt ) ) ;
__assign_str ( port , rpcrdma_portstr ( r_xprt ) ) ;
) ,
TP_printk ( " peer=[%s]:%s cq.id=%d rc=%d " ,
2021-04-19 14:03:44 -04:00
__get_str ( addr ) , __get_str ( port ) , __entry - > cq_id ,
2021-08-02 14:44:30 -04:00
__entry - > status
2017-12-20 16:30:48 -05:00
)
) ;
2020-11-09 14:39:37 -05:00
TRACE_EVENT ( xprtrdma_post_linv_err ,
2019-10-09 13:07:21 -04:00
TP_PROTO (
const struct rpcrdma_req * req ,
int status
) ,
TP_ARGS ( req , status ) ,
TP_STRUCT__entry (
2020-11-09 14:39:37 -05:00
__field ( unsigned int , task_id )
__field ( unsigned int , client_id )
2019-10-09 13:07:21 -04:00
__field ( int , status )
) ,
TP_fast_assign (
2020-11-09 14:39:37 -05:00
const struct rpc_task * task = req - > rl_slot . rq_task ;
__entry - > task_id = task - > tk_pid ;
__entry - > client_id = task - > tk_client - > cl_clid ;
2019-10-09 13:07:21 -04:00
__entry - > status = status ;
) ,
2020-11-09 14:39:37 -05:00
TP_printk ( " task:%u@%u status=%d " ,
__entry - > task_id , __entry - > client_id , __entry - > status
2019-10-09 13:07:21 -04:00
)
) ;
2017-12-20 16:30:40 -05:00
/**
* * Completion events
* */
2021-02-04 11:59:32 -05:00
DEFINE_RECEIVE_COMPLETION_EVENT ( xprtrdma_wc_receive ) ;
2020-11-09 14:39:26 -05:00
DEFINE_COMPLETION_EVENT ( xprtrdma_wc_send ) ;
2021-04-19 14:03:38 -04:00
DEFINE_MR_COMPLETION_EVENT ( xprtrdma_wc_fastreg ) ;
DEFINE_MR_COMPLETION_EVENT ( xprtrdma_wc_li ) ;
DEFINE_MR_COMPLETION_EVENT ( xprtrdma_wc_li_wake ) ;
DEFINE_MR_COMPLETION_EVENT ( xprtrdma_wc_li_done ) ;
2017-12-20 16:31:12 -05:00
2018-12-19 11:00:06 -05:00
TRACE_EVENT ( xprtrdma_frwr_alloc ,
TP_PROTO (
const struct rpcrdma_mr * mr ,
int rc
) ,
TP_ARGS ( mr , rc ) ,
TP_STRUCT__entry (
2020-02-12 11:12:35 -05:00
__field ( u32 , mr_id )
2018-12-19 11:00:06 -05:00
__field ( int , rc )
) ,
TP_fast_assign (
2021-04-19 14:04:21 -04:00
__entry - > mr_id = mr - > mr_ibmr - > res . id ;
2020-02-12 11:12:35 -05:00
__entry - > rc = rc ;
2018-12-19 11:00:06 -05:00
) ,
2020-02-12 11:12:35 -05:00
TP_printk ( " mr.id=%u: rc=%d " ,
__entry - > mr_id , __entry - > rc
2018-12-19 11:00:06 -05:00
)
) ;
TRACE_EVENT ( xprtrdma_frwr_dereg ,
TP_PROTO (
const struct rpcrdma_mr * mr ,
int rc
) ,
TP_ARGS ( mr , rc ) ,
TP_STRUCT__entry (
2020-02-12 11:12:35 -05:00
__field ( u32 , mr_id )
__field ( int , nents )
2018-12-19 11:00:06 -05:00
__field ( u32 , handle )
__field ( u32 , length )
__field ( u64 , offset )
__field ( u32 , dir )
__field ( int , rc )
) ,
TP_fast_assign (
2021-04-19 14:04:21 -04:00
__entry - > mr_id = mr - > mr_ibmr - > res . id ;
2020-02-12 11:12:35 -05:00
__entry - > nents = mr - > mr_nents ;
2018-12-19 11:00:06 -05:00
__entry - > handle = mr - > mr_handle ;
__entry - > length = mr - > mr_length ;
__entry - > offset = mr - > mr_offset ;
__entry - > dir = mr - > mr_dir ;
__entry - > rc = rc ;
) ,
2020-02-12 11:12:35 -05:00
TP_printk ( " mr.id=%u nents=%d %u@0x%016llx:0x%08x (%s): rc=%d " ,
__entry - > mr_id , __entry - > nents , __entry - > length ,
2018-12-19 11:00:06 -05:00
( unsigned long long ) __entry - > offset , __entry - > handle ,
xprtrdma_show_direction ( __entry - > dir ) ,
__entry - > rc
)
) ;
TRACE_EVENT ( xprtrdma_frwr_sgerr ,
TP_PROTO (
const struct rpcrdma_mr * mr ,
int sg_nents
) ,
TP_ARGS ( mr , sg_nents ) ,
TP_STRUCT__entry (
2020-02-12 11:12:35 -05:00
__field ( u32 , mr_id )
2018-12-19 11:00:06 -05:00
__field ( u64 , addr )
__field ( u32 , dir )
__field ( int , nents )
) ,
TP_fast_assign (
2021-04-19 14:04:21 -04:00
__entry - > mr_id = mr - > mr_ibmr - > res . id ;
2018-12-19 11:00:06 -05:00
__entry - > addr = mr - > mr_sg - > dma_address ;
__entry - > dir = mr - > mr_dir ;
__entry - > nents = sg_nents ;
) ,
2020-02-12 11:12:35 -05:00
TP_printk ( " mr.id=%u DMA addr=0x%llx (%s) sg_nents=%d " ,
__entry - > mr_id , __entry - > addr ,
2018-12-19 11:00:06 -05:00
xprtrdma_show_direction ( __entry - > dir ) ,
__entry - > nents
)
) ;
TRACE_EVENT ( xprtrdma_frwr_maperr ,
TP_PROTO (
const struct rpcrdma_mr * mr ,
int num_mapped
) ,
TP_ARGS ( mr , num_mapped ) ,
TP_STRUCT__entry (
2020-02-12 11:12:35 -05:00
__field ( u32 , mr_id )
2018-12-19 11:00:06 -05:00
__field ( u64 , addr )
__field ( u32 , dir )
__field ( int , num_mapped )
__field ( int , nents )
) ,
TP_fast_assign (
2021-04-19 14:04:21 -04:00
__entry - > mr_id = mr - > mr_ibmr - > res . id ;
2018-12-19 11:00:06 -05:00
__entry - > addr = mr - > mr_sg - > dma_address ;
__entry - > dir = mr - > mr_dir ;
__entry - > num_mapped = num_mapped ;
__entry - > nents = mr - > mr_nents ;
) ,
2020-02-12 11:12:35 -05:00
TP_printk ( " mr.id=%u DMA addr=0x%llx (%s) nents=%d of %d " ,
__entry - > mr_id , __entry - > addr ,
2018-12-19 11:00:06 -05:00
xprtrdma_show_direction ( __entry - > dir ) ,
__entry - > num_mapped , __entry - > nents
)
) ;
2021-04-19 14:03:31 -04:00
DEFINE_MR_EVENT ( fastreg ) ;
2018-10-01 14:25:30 -04:00
DEFINE_MR_EVENT ( localinv ) ;
2021-04-19 14:03:31 -04:00
DEFINE_MR_EVENT ( reminv ) ;
2018-10-01 14:25:30 -04:00
DEFINE_MR_EVENT ( map ) ;
2020-11-09 14:40:03 -05:00
DEFINE_ANON_MR_EVENT ( unmap ) ;
2017-12-20 16:30:56 -05:00
2018-12-19 11:00:06 -05:00
TRACE_EVENT ( xprtrdma_dma_maperr ,
TP_PROTO (
u64 addr
) ,
TP_ARGS ( addr ) ,
TP_STRUCT__entry (
__field ( u64 , addr )
) ,
TP_fast_assign (
__entry - > addr = addr ;
) ,
TP_printk ( " dma addr=0x%llx \n " , __entry - > addr )
) ;
2017-12-20 16:30:48 -05:00
/**
* * Reply events
* */
TRACE_EVENT ( xprtrdma_reply ,
TP_PROTO (
const struct rpc_task * task ,
const struct rpcrdma_rep * rep ,
unsigned int credits
) ,
2020-11-09 14:39:47 -05:00
TP_ARGS ( task , rep , credits ) ,
2017-12-20 16:30:48 -05:00
TP_STRUCT__entry (
__field ( unsigned int , task_id )
__field ( unsigned int , client_id )
__field ( u32 , xid )
__field ( unsigned int , credits )
) ,
TP_fast_assign (
__entry - > task_id = task - > tk_pid ;
__entry - > client_id = task - > tk_client - > cl_clid ;
__entry - > xid = be32_to_cpu ( rep - > rr_xid ) ;
__entry - > credits = credits ;
) ,
2020-11-09 14:39:47 -05:00
TP_printk ( " task:%u@%u xid=0x%08x credits=%u " ,
2017-12-20 16:30:48 -05:00
__entry - > task_id , __entry - > client_id , __entry - > xid ,
2020-11-09 14:39:47 -05:00
__entry - > credits
2017-12-20 16:30:48 -05:00
)
) ;
2020-11-09 14:39:42 -05:00
DEFINE_REPLY_EVENT ( vers ) ;
DEFINE_REPLY_EVENT ( rqst ) ;
DEFINE_REPLY_EVENT ( short ) ;
DEFINE_REPLY_EVENT ( hdr ) ;
2017-12-20 16:30:48 -05:00
2020-11-09 14:39:15 -05:00
TRACE_EVENT ( xprtrdma_err_vers ,
2017-12-20 16:30:48 -05:00
TP_PROTO (
2020-11-09 14:39:15 -05:00
const struct rpc_rqst * rqst ,
__be32 * min ,
__be32 * max
2017-12-20 16:30:48 -05:00
) ,
2020-11-09 14:39:15 -05:00
TP_ARGS ( rqst , min , max ) ,
2017-12-20 16:30:48 -05:00
TP_STRUCT__entry (
__field ( unsigned int , task_id )
__field ( unsigned int , client_id )
__field ( u32 , xid )
2020-11-09 14:39:15 -05:00
__field ( u32 , min )
__field ( u32 , max )
2017-12-20 16:30:48 -05:00
) ,
TP_fast_assign (
2020-11-09 14:39:15 -05:00
__entry - > task_id = rqst - > rq_task - > tk_pid ;
__entry - > client_id = rqst - > rq_task - > tk_client - > cl_clid ;
__entry - > xid = be32_to_cpu ( rqst - > rq_xid ) ;
__entry - > min = be32_to_cpup ( min ) ;
__entry - > max = be32_to_cpup ( max ) ;
2017-12-20 16:30:48 -05:00
) ,
2020-11-09 14:39:15 -05:00
TP_printk ( " task:%u@%u xid=0x%08x versions=[%u, %u] " ,
2017-12-20 16:30:48 -05:00
__entry - > task_id , __entry - > client_id , __entry - > xid ,
2020-11-09 14:39:15 -05:00
__entry - > min , __entry - > max
)
) ;
TRACE_EVENT ( xprtrdma_err_chunk ,
TP_PROTO (
const struct rpc_rqst * rqst
) ,
TP_ARGS ( rqst ) ,
TP_STRUCT__entry (
__field ( unsigned int , task_id )
__field ( unsigned int , client_id )
__field ( u32 , xid )
) ,
TP_fast_assign (
__entry - > task_id = rqst - > rq_task - > tk_pid ;
__entry - > client_id = rqst - > rq_task - > tk_client - > cl_clid ;
__entry - > xid = be32_to_cpu ( rqst - > rq_xid ) ;
) ,
TP_printk ( " task:%u@%u xid=0x%08x " ,
__entry - > task_id , __entry - > client_id , __entry - > xid
2017-12-20 16:30:48 -05:00
)
) ;
2020-11-09 14:39:15 -05:00
TRACE_EVENT ( xprtrdma_err_unrecognized ,
TP_PROTO (
const struct rpc_rqst * rqst ,
__be32 * procedure
) ,
TP_ARGS ( rqst , procedure ) ,
TP_STRUCT__entry (
__field ( unsigned int , task_id )
__field ( unsigned int , client_id )
__field ( u32 , xid )
__field ( u32 , procedure )
) ,
TP_fast_assign (
__entry - > task_id = rqst - > rq_task - > tk_pid ;
__entry - > client_id = rqst - > rq_task - > tk_client - > cl_clid ;
__entry - > procedure = be32_to_cpup ( procedure ) ;
) ,
TP_printk ( " task:%u@%u xid=0x%08x procedure=%u " ,
__entry - > task_id , __entry - > client_id , __entry - > xid ,
__entry - > procedure
)
) ;
2017-12-20 16:30:48 -05:00
2017-12-20 16:31:04 -05:00
TRACE_EVENT ( xprtrdma_fixup ,
TP_PROTO (
const struct rpc_rqst * rqst ,
2019-10-23 10:02:03 -04:00
unsigned long fixup
2017-12-20 16:31:04 -05:00
) ,
2019-10-23 10:02:03 -04:00
TP_ARGS ( rqst , fixup ) ,
2017-12-20 16:31:04 -05:00
TP_STRUCT__entry (
__field ( unsigned int , task_id )
__field ( unsigned int , client_id )
2019-10-23 10:02:03 -04:00
__field ( unsigned long , fixup )
__field ( size_t , headlen )
__field ( unsigned int , pagelen )
__field ( size_t , taillen )
2017-12-20 16:31:04 -05:00
) ,
TP_fast_assign (
__entry - > task_id = rqst - > rq_task - > tk_pid ;
__entry - > client_id = rqst - > rq_task - > tk_client - > cl_clid ;
2019-10-23 10:02:03 -04:00
__entry - > fixup = fixup ;
__entry - > headlen = rqst - > rq_rcv_buf . head [ 0 ] . iov_len ;
__entry - > pagelen = rqst - > rq_rcv_buf . page_len ;
__entry - > taillen = rqst - > rq_rcv_buf . tail [ 0 ] . iov_len ;
2017-12-20 16:31:04 -05:00
) ,
2019-10-23 10:02:03 -04:00
TP_printk ( " task:%u@%u fixup=%lu xdr=%zu/%u/%zu " ,
__entry - > task_id , __entry - > client_id , __entry - > fixup ,
__entry - > headlen , __entry - > pagelen , __entry - > taillen
2017-12-20 16:31:04 -05:00
)
) ;
TRACE_EVENT ( xprtrdma_decode_seg ,
TP_PROTO (
u32 handle ,
u32 length ,
u64 offset
) ,
TP_ARGS ( handle , length , offset ) ,
TP_STRUCT__entry (
__field ( u32 , handle )
__field ( u32 , length )
__field ( u64 , offset )
) ,
TP_fast_assign (
__entry - > handle = handle ;
__entry - > length = length ;
__entry - > offset = offset ;
) ,
TP_printk ( " %u@0x%016llx:0x%08x " ,
__entry - > length , ( unsigned long long ) __entry - > offset ,
__entry - > handle
)
) ;
2020-11-09 14:40:08 -05:00
TRACE_EVENT ( xprtrdma_mrs_zap ,
TP_PROTO (
const struct rpc_task * task
) ,
TP_ARGS ( task ) ,
TP_STRUCT__entry (
__field ( unsigned int , task_id )
__field ( unsigned int , client_id )
) ,
TP_fast_assign (
__entry - > task_id = task - > tk_pid ;
__entry - > client_id = task - > tk_client - > cl_clid ;
) ,
TP_printk ( " task:%u@%u " ,
__entry - > task_id , __entry - > client_id
)
) ;
2017-12-20 16:31:37 -05:00
/**
* * Callback events
* */
TRACE_EVENT ( xprtrdma_cb_setup ,
TP_PROTO (
const struct rpcrdma_xprt * r_xprt ,
unsigned int reqs
) ,
TP_ARGS ( r_xprt , reqs ) ,
TP_STRUCT__entry (
__field ( unsigned int , reqs )
__string ( addr , rpcrdma_addrstr ( r_xprt ) )
__string ( port , rpcrdma_portstr ( r_xprt ) )
) ,
TP_fast_assign (
__entry - > reqs = reqs ;
__assign_str ( addr , rpcrdma_addrstr ( r_xprt ) ) ;
__assign_str ( port , rpcrdma_portstr ( r_xprt ) ) ;
) ,
2021-04-19 14:03:44 -04:00
TP_printk ( " peer=[%s]:%s %u reqs " ,
__get_str ( addr ) , __get_str ( port ) , __entry - > reqs
2017-12-20 16:31:37 -05:00
)
) ;
2020-11-09 14:39:53 -05:00
DEFINE_CALLBACK_EVENT ( call ) ;
DEFINE_CALLBACK_EVENT ( reply ) ;
2018-12-07 11:11:44 -05:00
2018-05-07 15:27:11 -04:00
/**
* * Server - side RPC / RDMA events
* */
2020-04-30 15:25:01 -04:00
DECLARE_EVENT_CLASS ( svcrdma_accept_class ,
TP_PROTO (
const struct svcxprt_rdma * rdma ,
long status
) ,
TP_ARGS ( rdma , status ) ,
TP_STRUCT__entry (
__field ( long , status )
__string ( addr , rdma - > sc_xprt . xpt_remotebuf )
) ,
TP_fast_assign (
__entry - > status = status ;
__assign_str ( addr , rdma - > sc_xprt . xpt_remotebuf ) ;
) ,
TP_printk ( " addr=%s status=%ld " ,
__get_str ( addr ) , __entry - > status
)
) ;
# define DEFINE_ACCEPT_EVENT(name) \
DEFINE_EVENT ( svcrdma_accept_class , svcrdma_ # # name # # _err , \
TP_PROTO ( \
const struct svcxprt_rdma * rdma , \
long status \
) , \
TP_ARGS ( rdma , status ) )
DEFINE_ACCEPT_EVENT ( pd ) ;
DEFINE_ACCEPT_EVENT ( qp ) ;
DEFINE_ACCEPT_EVENT ( fabric ) ;
DEFINE_ACCEPT_EVENT ( initdepth ) ;
DEFINE_ACCEPT_EVENT ( accept ) ;
2018-05-07 15:27:11 -04:00
TRACE_DEFINE_ENUM ( RDMA_MSG ) ;
TRACE_DEFINE_ENUM ( RDMA_NOMSG ) ;
TRACE_DEFINE_ENUM ( RDMA_MSGP ) ;
TRACE_DEFINE_ENUM ( RDMA_DONE ) ;
TRACE_DEFINE_ENUM ( RDMA_ERROR ) ;
# define show_rpcrdma_proc(x) \
__print_symbolic ( x , \
{ RDMA_MSG , " RDMA_MSG " } , \
{ RDMA_NOMSG , " RDMA_NOMSG " } , \
{ RDMA_MSGP , " RDMA_MSGP " } , \
{ RDMA_DONE , " RDMA_DONE " } , \
{ RDMA_ERROR , " RDMA_ERROR " } )
TRACE_EVENT ( svcrdma_decode_rqst ,
TP_PROTO (
2020-04-29 17:16:31 -04:00
const struct svc_rdma_recv_ctxt * ctxt ,
2018-05-07 15:27:11 -04:00
__be32 * p ,
unsigned int hdrlen
) ,
2020-04-29 17:16:31 -04:00
TP_ARGS ( ctxt , p , hdrlen ) ,
2018-05-07 15:27:11 -04:00
TP_STRUCT__entry (
2020-04-29 17:16:31 -04:00
__field ( u32 , cq_id )
__field ( int , completion_id )
2018-05-07 15:27:11 -04:00
__field ( u32 , xid )
__field ( u32 , vers )
__field ( u32 , proc )
__field ( u32 , credits )
__field ( unsigned int , hdrlen )
) ,
TP_fast_assign (
2020-04-29 17:16:31 -04:00
__entry - > cq_id = ctxt - > rc_cid . ci_queue_id ;
__entry - > completion_id = ctxt - > rc_cid . ci_completion_id ;
2018-05-07 15:27:11 -04:00
__entry - > xid = be32_to_cpup ( p + + ) ;
__entry - > vers = be32_to_cpup ( p + + ) ;
__entry - > credits = be32_to_cpup ( p + + ) ;
__entry - > proc = be32_to_cpup ( p ) ;
__entry - > hdrlen = hdrlen ;
) ,
2020-04-29 17:16:31 -04:00
TP_printk ( " cq.id=%u cid=%d xid=0x%08x vers=%u credits=%u proc=%s hdrlen=%u " ,
__entry - > cq_id , __entry - > completion_id ,
2018-05-07 15:27:11 -04:00
__entry - > xid , __entry - > vers , __entry - > credits ,
show_rpcrdma_proc ( __entry - > proc ) , __entry - > hdrlen )
) ;
2020-03-23 16:33:16 -04:00
TRACE_EVENT ( svcrdma_decode_short_err ,
2018-05-07 15:27:11 -04:00
TP_PROTO (
2020-04-29 17:16:31 -04:00
const struct svc_rdma_recv_ctxt * ctxt ,
2018-05-07 15:27:11 -04:00
unsigned int hdrlen
) ,
2020-04-29 17:16:31 -04:00
TP_ARGS ( ctxt , hdrlen ) ,
2018-05-07 15:27:11 -04:00
TP_STRUCT__entry (
2020-04-29 17:16:31 -04:00
__field ( u32 , cq_id )
__field ( int , completion_id )
2018-05-07 15:27:11 -04:00
__field ( unsigned int , hdrlen )
) ,
TP_fast_assign (
2020-04-29 17:16:31 -04:00
__entry - > cq_id = ctxt - > rc_cid . ci_queue_id ;
__entry - > completion_id = ctxt - > rc_cid . ci_completion_id ;
2018-05-07 15:27:11 -04:00
__entry - > hdrlen = hdrlen ;
) ,
2020-04-29 17:16:31 -04:00
TP_printk ( " cq.id=%u cid=%d hdrlen=%u " ,
__entry - > cq_id , __entry - > completion_id ,
__entry - > hdrlen )
2018-05-07 15:27:11 -04:00
) ;
DECLARE_EVENT_CLASS ( svcrdma_badreq_event ,
TP_PROTO (
2020-04-29 17:16:31 -04:00
const struct svc_rdma_recv_ctxt * ctxt ,
2018-05-07 15:27:11 -04:00
__be32 * p
) ,
2020-04-29 17:16:31 -04:00
TP_ARGS ( ctxt , p ) ,
2018-05-07 15:27:11 -04:00
TP_STRUCT__entry (
2020-04-29 17:16:31 -04:00
__field ( u32 , cq_id )
__field ( int , completion_id )
2018-05-07 15:27:11 -04:00
__field ( u32 , xid )
__field ( u32 , vers )
__field ( u32 , proc )
__field ( u32 , credits )
) ,
TP_fast_assign (
2020-04-29 17:16:31 -04:00
__entry - > cq_id = ctxt - > rc_cid . ci_queue_id ;
__entry - > completion_id = ctxt - > rc_cid . ci_completion_id ;
2018-05-07 15:27:11 -04:00
__entry - > xid = be32_to_cpup ( p + + ) ;
__entry - > vers = be32_to_cpup ( p + + ) ;
__entry - > credits = be32_to_cpup ( p + + ) ;
__entry - > proc = be32_to_cpup ( p ) ;
) ,
2020-04-29 17:16:31 -04:00
TP_printk ( " cq.id=%u cid=%d xid=0x%08x vers=%u credits=%u proc=%u " ,
__entry - > cq_id , __entry - > completion_id ,
2018-05-07 15:27:11 -04:00
__entry - > xid , __entry - > vers , __entry - > credits , __entry - > proc )
) ;
# define DEFINE_BADREQ_EVENT(name) \
2020-03-23 16:33:16 -04:00
DEFINE_EVENT ( svcrdma_badreq_event , \
svcrdma_decode_ # # name # # _err , \
2018-05-07 15:27:11 -04:00
TP_PROTO ( \
2020-04-29 17:16:31 -04:00
const struct svc_rdma_recv_ctxt * ctxt , \
2018-05-07 15:27:11 -04:00
__be32 * p \
) , \
2020-04-29 17:16:31 -04:00
TP_ARGS ( ctxt , p ) )
2018-05-07 15:27:11 -04:00
DEFINE_BADREQ_EVENT ( badvers ) ;
DEFINE_BADREQ_EVENT ( drop ) ;
DEFINE_BADREQ_EVENT ( badproc ) ;
DEFINE_BADREQ_EVENT ( parse ) ;
2020-06-17 11:50:34 -04:00
TRACE_EVENT ( svcrdma_encode_wseg ,
TP_PROTO (
const struct svc_rdma_send_ctxt * ctxt ,
u32 segno ,
u32 handle ,
u32 length ,
u64 offset
) ,
TP_ARGS ( ctxt , segno , handle , length , offset ) ,
TP_STRUCT__entry (
__field ( u32 , cq_id )
__field ( int , completion_id )
__field ( u32 , segno )
__field ( u32 , handle )
__field ( u32 , length )
__field ( u64 , offset )
) ,
TP_fast_assign (
__entry - > cq_id = ctxt - > sc_cid . ci_queue_id ;
__entry - > completion_id = ctxt - > sc_cid . ci_completion_id ;
__entry - > segno = segno ;
__entry - > handle = handle ;
__entry - > length = length ;
__entry - > offset = offset ;
) ,
TP_printk ( " cq_id=%u cid=%d segno=%u %u@0x%016llx:0x%08x " ,
__entry - > cq_id , __entry - > completion_id ,
__entry - > segno , __entry - > length ,
( unsigned long long ) __entry - > offset , __entry - > handle
)
) ;
2020-06-22 10:15:41 -04:00
TRACE_EVENT ( svcrdma_decode_rseg ,
TP_PROTO (
const struct rpc_rdma_cid * cid ,
const struct svc_rdma_chunk * chunk ,
const struct svc_rdma_segment * segment
) ,
TP_ARGS ( cid , chunk , segment ) ,
TP_STRUCT__entry (
__field ( u32 , cq_id )
__field ( int , completion_id )
__field ( u32 , segno )
__field ( u32 , position )
__field ( u32 , handle )
__field ( u32 , length )
__field ( u64 , offset )
) ,
TP_fast_assign (
__entry - > cq_id = cid - > ci_queue_id ;
__entry - > completion_id = cid - > ci_completion_id ;
__entry - > segno = chunk - > ch_segcount ;
__entry - > position = chunk - > ch_position ;
__entry - > handle = segment - > rs_handle ;
__entry - > length = segment - > rs_length ;
__entry - > offset = segment - > rs_offset ;
) ,
TP_printk ( " cq_id=%u cid=%d segno=%u position=%u %u@0x%016llx:0x%08x " ,
__entry - > cq_id , __entry - > completion_id ,
__entry - > segno , __entry - > position , __entry - > length ,
( unsigned long long ) __entry - > offset , __entry - > handle
)
) ;
TRACE_EVENT ( svcrdma_decode_wseg ,
TP_PROTO (
const struct rpc_rdma_cid * cid ,
const struct svc_rdma_chunk * chunk ,
u32 segno
) ,
TP_ARGS ( cid , chunk , segno ) ,
TP_STRUCT__entry (
__field ( u32 , cq_id )
__field ( int , completion_id )
__field ( u32 , segno )
__field ( u32 , handle )
__field ( u32 , length )
__field ( u64 , offset )
) ,
TP_fast_assign (
const struct svc_rdma_segment * segment =
& chunk - > ch_segments [ segno ] ;
__entry - > cq_id = cid - > ci_queue_id ;
__entry - > completion_id = cid - > ci_completion_id ;
__entry - > segno = segno ;
__entry - > handle = segment - > rs_handle ;
__entry - > length = segment - > rs_length ;
__entry - > offset = segment - > rs_offset ;
) ,
TP_printk ( " cq_id=%u cid=%d segno=%u %u@0x%016llx:0x%08x " ,
__entry - > cq_id , __entry - > completion_id ,
__entry - > segno , __entry - > length ,
( unsigned long long ) __entry - > offset , __entry - > handle
)
) ;
2018-05-07 15:27:11 -04:00
DECLARE_EVENT_CLASS ( svcrdma_error_event ,
TP_PROTO (
__be32 xid
) ,
TP_ARGS ( xid ) ,
TP_STRUCT__entry (
__field ( u32 , xid )
) ,
TP_fast_assign (
__entry - > xid = be32_to_cpu ( xid ) ;
) ,
TP_printk ( " xid=0x%08x " ,
__entry - > xid
)
) ;
# define DEFINE_ERROR_EVENT(name) \
DEFINE_EVENT ( svcrdma_error_event , svcrdma_err_ # # name , \
TP_PROTO ( \
__be32 xid \
) , \
TP_ARGS ( xid ) )
DEFINE_ERROR_EVENT ( vers ) ;
DEFINE_ERROR_EVENT ( chunk ) ;
2018-05-07 15:27:16 -04:00
/**
* * Server - side RDMA API events
* */
2019-10-04 09:58:20 -04:00
DECLARE_EVENT_CLASS ( svcrdma_dma_map_class ,
2018-05-07 15:27:16 -04:00
TP_PROTO (
const struct svcxprt_rdma * rdma ,
2019-10-04 09:58:20 -04:00
u64 dma_addr ,
u32 length
2018-05-07 15:27:16 -04:00
) ,
2019-10-04 09:58:20 -04:00
TP_ARGS ( rdma , dma_addr , length ) ,
2018-05-07 15:27:16 -04:00
TP_STRUCT__entry (
2019-10-04 09:58:20 -04:00
__field ( u64 , dma_addr )
__field ( u32 , length )
2018-05-07 15:27:16 -04:00
__string ( device , rdma - > sc_cm_id - > device - > name )
__string ( addr , rdma - > sc_xprt . xpt_remotebuf )
) ,
TP_fast_assign (
2019-10-04 09:58:20 -04:00
__entry - > dma_addr = dma_addr ;
__entry - > length = length ;
2018-05-07 15:27:16 -04:00
__assign_str ( device , rdma - > sc_cm_id - > device - > name ) ;
__assign_str ( addr , rdma - > sc_xprt . xpt_remotebuf ) ;
) ,
2019-10-04 09:58:20 -04:00
TP_printk ( " addr=%s device=%s dma_addr=%llu length=%u " ,
__get_str ( addr ) , __get_str ( device ) ,
__entry - > dma_addr , __entry - > length
2018-05-07 15:27:16 -04:00
)
) ;
2019-10-04 09:58:20 -04:00
# define DEFINE_SVC_DMA_EVENT(name) \
DEFINE_EVENT ( svcrdma_dma_map_class , svcrdma_ # # name , \
TP_PROTO ( \
const struct svcxprt_rdma * rdma , \
u64 dma_addr , \
u32 length \
) , \
TP_ARGS ( rdma , dma_addr , length ) )
DEFINE_SVC_DMA_EVENT ( dma_map_page ) ;
2020-03-09 13:29:27 -04:00
DEFINE_SVC_DMA_EVENT ( dma_map_err ) ;
2019-10-04 09:58:20 -04:00
DEFINE_SVC_DMA_EVENT ( dma_unmap_page ) ;
2020-03-20 14:02:49 -04:00
TRACE_EVENT ( svcrdma_dma_map_rw_err ,
2018-05-07 15:27:16 -04:00
TP_PROTO (
const struct svcxprt_rdma * rdma ,
2020-03-20 14:02:49 -04:00
unsigned int nents ,
2018-05-07 15:27:16 -04:00
int status
) ,
2020-03-20 14:02:49 -04:00
TP_ARGS ( rdma , nents , status ) ,
2018-05-07 15:27:16 -04:00
TP_STRUCT__entry (
__field ( int , status )
2020-03-20 14:02:49 -04:00
__field ( unsigned int , nents )
2018-05-07 15:27:16 -04:00
__string ( device , rdma - > sc_cm_id - > device - > name )
__string ( addr , rdma - > sc_xprt . xpt_remotebuf )
) ,
TP_fast_assign (
__entry - > status = status ;
2020-03-20 14:02:49 -04:00
__entry - > nents = nents ;
2018-05-07 15:27:16 -04:00
__assign_str ( device , rdma - > sc_cm_id - > device - > name ) ;
__assign_str ( addr , rdma - > sc_xprt . xpt_remotebuf ) ;
) ,
2020-03-20 14:02:49 -04:00
TP_printk ( " addr=%s device=%s nents=%u status=%d " ,
__get_str ( addr ) , __get_str ( device ) , __entry - > nents ,
__entry - > status
2018-05-07 15:27:16 -04:00
)
) ;
2020-03-20 14:23:13 -04:00
TRACE_EVENT ( svcrdma_no_rwctx_err ,
TP_PROTO (
const struct svcxprt_rdma * rdma ,
unsigned int num_sges
) ,
TP_ARGS ( rdma , num_sges ) ,
TP_STRUCT__entry (
__field ( unsigned int , num_sges )
__string ( device , rdma - > sc_cm_id - > device - > name )
__string ( addr , rdma - > sc_xprt . xpt_remotebuf )
) ,
TP_fast_assign (
__entry - > num_sges = num_sges ;
__assign_str ( device , rdma - > sc_cm_id - > device - > name ) ;
__assign_str ( addr , rdma - > sc_xprt . xpt_remotebuf ) ;
) ,
TP_printk ( " addr=%s device=%s num_sges=%d " ,
__get_str ( addr ) , __get_str ( device ) , __entry - > num_sges
)
) ;
2020-03-20 14:33:05 -04:00
TRACE_EVENT ( svcrdma_page_overrun_err ,
TP_PROTO (
const struct svcxprt_rdma * rdma ,
const struct svc_rqst * rqst ,
unsigned int pageno
) ,
TP_ARGS ( rdma , rqst , pageno ) ,
TP_STRUCT__entry (
__field ( unsigned int , pageno )
__field ( u32 , xid )
__string ( device , rdma - > sc_cm_id - > device - > name )
__string ( addr , rdma - > sc_xprt . xpt_remotebuf )
) ,
TP_fast_assign (
__entry - > pageno = pageno ;
__entry - > xid = __be32_to_cpu ( rqst - > rq_xid ) ;
__assign_str ( device , rdma - > sc_cm_id - > device - > name ) ;
__assign_str ( addr , rdma - > sc_xprt . xpt_remotebuf ) ;
) ,
TP_printk ( " addr=%s device=%s xid=0x%08x pageno=%u " , __get_str ( addr ) ,
__get_str ( device ) , __entry - > xid , __entry - > pageno
)
) ;
2020-03-20 14:36:44 -04:00
TRACE_EVENT ( svcrdma_small_wrch_err ,
TP_PROTO (
const struct svcxprt_rdma * rdma ,
unsigned int remaining ,
unsigned int seg_no ,
unsigned int num_segs
) ,
TP_ARGS ( rdma , remaining , seg_no , num_segs ) ,
TP_STRUCT__entry (
__field ( unsigned int , remaining )
__field ( unsigned int , seg_no )
__field ( unsigned int , num_segs )
__string ( device , rdma - > sc_cm_id - > device - > name )
__string ( addr , rdma - > sc_xprt . xpt_remotebuf )
) ,
TP_fast_assign (
__entry - > remaining = remaining ;
__entry - > seg_no = seg_no ;
__entry - > num_segs = num_segs ;
__assign_str ( device , rdma - > sc_cm_id - > device - > name ) ;
__assign_str ( addr , rdma - > sc_xprt . xpt_remotebuf ) ;
) ,
TP_printk ( " addr=%s device=%s remaining=%u seg_no=%u num_segs=%u " ,
__get_str ( addr ) , __get_str ( device ) , __entry - > remaining ,
__entry - > seg_no , __entry - > num_segs
)
) ;
2020-03-03 13:28:14 -05:00
TRACE_EVENT ( svcrdma_send_pullup ,
TP_PROTO (
2020-03-13 10:42:11 -04:00
const struct svc_rdma_send_ctxt * ctxt ,
unsigned int msglen
2020-03-03 13:28:14 -05:00
) ,
2020-03-13 10:42:11 -04:00
TP_ARGS ( ctxt , msglen ) ,
2020-03-03 13:28:14 -05:00
TP_STRUCT__entry (
2020-03-13 10:42:11 -04:00
__field ( u32 , cq_id )
__field ( int , completion_id )
__field ( unsigned int , hdrlen )
__field ( unsigned int , msglen )
2020-03-03 13:28:14 -05:00
) ,
TP_fast_assign (
2020-03-13 10:42:11 -04:00
__entry - > cq_id = ctxt - > sc_cid . ci_queue_id ;
__entry - > completion_id = ctxt - > sc_cid . ci_completion_id ;
__entry - > hdrlen = ctxt - > sc_hdrbuf . len ,
__entry - > msglen = msglen ;
2020-03-03 13:28:14 -05:00
) ,
2020-03-13 10:42:11 -04:00
TP_printk ( " cq_id=%u cid=%d hdr=%u msg=%u (total %u) " ,
__entry - > cq_id , __entry - > completion_id ,
__entry - > hdrlen , __entry - > msglen ,
__entry - > hdrlen + __entry - > msglen )
2020-03-03 13:28:14 -05:00
) ;
2020-04-30 14:17:40 -04:00
TRACE_EVENT ( svcrdma_send_err ,
2018-05-07 15:27:16 -04:00
TP_PROTO (
const struct svc_rqst * rqst ,
int status
) ,
TP_ARGS ( rqst , status ) ,
TP_STRUCT__entry (
__field ( int , status )
__field ( u32 , xid )
__string ( addr , rqst - > rq_xprt - > xpt_remotebuf )
) ,
TP_fast_assign (
__entry - > status = status ;
__entry - > xid = __be32_to_cpu ( rqst - > rq_xid ) ;
__assign_str ( addr , rqst - > rq_xprt - > xpt_remotebuf ) ;
) ,
2020-04-30 14:17:40 -04:00
TP_printk ( " addr=%s xid=0x%08x status=%d " , __get_str ( addr ) ,
2018-05-07 15:27:16 -04:00
__entry - > xid , __entry - > status
)
) ;
TRACE_EVENT ( svcrdma_post_send ,
TP_PROTO (
2020-04-29 11:05:33 -04:00
const struct svc_rdma_send_ctxt * ctxt
2018-05-07 15:27:16 -04:00
) ,
2020-04-29 11:05:33 -04:00
TP_ARGS ( ctxt ) ,
2018-05-07 15:27:16 -04:00
TP_STRUCT__entry (
2020-04-29 11:05:33 -04:00
__field ( u32 , cq_id )
__field ( int , completion_id )
2018-05-07 15:27:16 -04:00
__field ( unsigned int , num_sge )
__field ( u32 , inv_rkey )
) ,
TP_fast_assign (
2020-04-29 11:05:33 -04:00
const struct ib_send_wr * wr = & ctxt - > sc_send_wr ;
__entry - > cq_id = ctxt - > sc_cid . ci_queue_id ;
__entry - > completion_id = ctxt - > sc_cid . ci_completion_id ;
2018-05-07 15:27:16 -04:00
__entry - > num_sge = wr - > num_sge ;
__entry - > inv_rkey = ( wr - > opcode = = IB_WR_SEND_WITH_INV ) ?
wr - > ex . invalidate_rkey : 0 ;
) ,
2020-04-29 11:05:33 -04:00
TP_printk ( " cq_id=%u cid=%d num_sge=%u inv_rkey=0x%08x " ,
__entry - > cq_id , __entry - > completion_id ,
__entry - > num_sge , __entry - > inv_rkey
2018-05-07 15:27:16 -04:00
)
) ;
2020-04-30 13:47:07 -04:00
DEFINE_COMPLETION_EVENT ( svcrdma_wc_send ) ;
2018-05-07 15:27:16 -04:00
TRACE_EVENT ( svcrdma_post_recv ,
TP_PROTO (
2020-04-29 16:22:26 -04:00
const struct svc_rdma_recv_ctxt * ctxt
2018-05-07 15:27:16 -04:00
) ,
2020-04-29 16:22:26 -04:00
TP_ARGS ( ctxt ) ,
2018-05-07 15:27:16 -04:00
TP_STRUCT__entry (
2020-04-29 16:22:26 -04:00
__field ( u32 , cq_id )
__field ( int , completion_id )
2018-05-07 15:27:16 -04:00
) ,
TP_fast_assign (
2020-04-29 16:22:26 -04:00
__entry - > cq_id = ctxt - > rc_cid . ci_queue_id ;
__entry - > completion_id = ctxt - > rc_cid . ci_completion_id ;
2018-05-07 15:27:16 -04:00
) ,
2020-04-29 16:22:26 -04:00
TP_printk ( " cq.id=%d cid=%d " ,
__entry - > cq_id , __entry - > completion_id
2018-05-07 15:27:16 -04:00
)
) ;
2021-02-04 11:59:32 -05:00
DEFINE_RECEIVE_COMPLETION_EVENT ( svcrdma_wc_receive ) ;
2020-04-29 16:22:26 -04:00
TRACE_EVENT ( svcrdma_rq_post_err ,
2018-05-07 15:27:16 -04:00
TP_PROTO (
2020-04-29 16:22:26 -04:00
const struct svcxprt_rdma * rdma ,
int status
2018-05-07 15:27:16 -04:00
) ,
2020-04-29 16:22:26 -04:00
TP_ARGS ( rdma , status ) ,
2018-05-07 15:27:16 -04:00
TP_STRUCT__entry (
2020-04-29 16:22:26 -04:00
__field ( int , status )
__string ( addr , rdma - > sc_xprt . xpt_remotebuf )
2018-05-07 15:27:16 -04:00
) ,
TP_fast_assign (
2020-04-29 16:22:26 -04:00
__entry - > status = status ;
__assign_str ( addr , rdma - > sc_xprt . xpt_remotebuf ) ;
2018-05-07 15:27:16 -04:00
) ,
2020-04-29 16:22:26 -04:00
TP_printk ( " addr=%s status=%d " ,
__get_str ( addr ) , __entry - > status
2018-05-07 15:27:16 -04:00
)
) ;
2020-06-11 13:28:28 -04:00
DECLARE_EVENT_CLASS ( svcrdma_post_chunk_class ,
2018-05-07 15:27:16 -04:00
TP_PROTO (
2020-04-29 17:25:36 -04:00
const struct rpc_rdma_cid * cid ,
2020-03-30 14:27:37 -04:00
int sqecount
2018-05-07 15:27:16 -04:00
) ,
2020-04-29 17:25:36 -04:00
TP_ARGS ( cid , sqecount ) ,
2018-05-07 15:27:16 -04:00
TP_STRUCT__entry (
2020-04-29 17:25:36 -04:00
__field ( u32 , cq_id )
__field ( int , completion_id )
2018-05-07 15:27:16 -04:00
__field ( int , sqecount )
) ,
TP_fast_assign (
2020-04-29 17:25:36 -04:00
__entry - > cq_id = cid - > ci_queue_id ;
__entry - > completion_id = cid - > ci_completion_id ;
2018-05-07 15:27:16 -04:00
__entry - > sqecount = sqecount ;
) ,
2020-04-29 17:25:36 -04:00
TP_printk ( " cq.id=%u cid=%d sqecount=%d " ,
__entry - > cq_id , __entry - > completion_id ,
__entry - > sqecount
2018-05-07 15:27:16 -04:00
)
) ;
2020-06-11 13:28:28 -04:00
# define DEFINE_POST_CHUNK_EVENT(name) \
DEFINE_EVENT ( svcrdma_post_chunk_class , \
svcrdma_post_ # # name # # _chunk , \
TP_PROTO ( \
const struct rpc_rdma_cid * cid , \
int sqecount \
) , \
TP_ARGS ( cid , sqecount ) )
DEFINE_POST_CHUNK_EVENT ( read ) ;
DEFINE_POST_CHUNK_EVENT ( write ) ;
DEFINE_POST_CHUNK_EVENT ( reply ) ;
2020-04-29 17:25:36 -04:00
DEFINE_COMPLETION_EVENT ( svcrdma_wc_read ) ;
DEFINE_COMPLETION_EVENT ( svcrdma_wc_write ) ;
2018-05-07 15:27:16 -04:00
TRACE_EVENT ( svcrdma_qp_error ,
TP_PROTO (
const struct ib_event * event ,
const struct sockaddr * sap
) ,
TP_ARGS ( event , sap ) ,
TP_STRUCT__entry (
__field ( unsigned int , event )
__string ( device , event - > device - > name )
__array ( __u8 , addr , INET6_ADDRSTRLEN + 10 )
) ,
TP_fast_assign (
__entry - > event = event - > event ;
__assign_str ( device , event - > device - > name ) ;
snprintf ( __entry - > addr , sizeof ( __entry - > addr ) - 1 ,
" %pISpc " , sap ) ;
) ,
TP_printk ( " addr=%s dev=%s event=%s (%u) " ,
__entry - > addr , __get_str ( device ) ,
rdma_show_ib_event ( __entry - > event ) , __entry - > event
)
) ;
DECLARE_EVENT_CLASS ( svcrdma_sendqueue_event ,
TP_PROTO (
const struct svcxprt_rdma * rdma
) ,
TP_ARGS ( rdma ) ,
TP_STRUCT__entry (
__field ( int , avail )
__field ( int , depth )
__string ( addr , rdma - > sc_xprt . xpt_remotebuf )
) ,
TP_fast_assign (
__entry - > avail = atomic_read ( & rdma - > sc_sq_avail ) ;
__entry - > depth = rdma - > sc_sq_depth ;
__assign_str ( addr , rdma - > sc_xprt . xpt_remotebuf ) ;
) ,
TP_printk ( " addr=%s sc_sq_avail=%d/%d " ,
__get_str ( addr ) , __entry - > avail , __entry - > depth
)
) ;
# define DEFINE_SQ_EVENT(name) \
DEFINE_EVENT ( svcrdma_sendqueue_event , svcrdma_sq_ # # name , \
TP_PROTO ( \
const struct svcxprt_rdma * rdma \
) , \
TP_ARGS ( rdma ) )
DEFINE_SQ_EVENT ( full ) ;
DEFINE_SQ_EVENT ( retry ) ;
2020-03-30 14:27:37 -04:00
TRACE_EVENT ( svcrdma_sq_post_err ,
TP_PROTO (
const struct svcxprt_rdma * rdma ,
int status
) ,
TP_ARGS ( rdma , status ) ,
TP_STRUCT__entry (
__field ( int , avail )
__field ( int , depth )
__field ( int , status )
__string ( addr , rdma - > sc_xprt . xpt_remotebuf )
) ,
TP_fast_assign (
__entry - > avail = atomic_read ( & rdma - > sc_sq_avail ) ;
__entry - > depth = rdma - > sc_sq_depth ;
__entry - > status = status ;
__assign_str ( addr , rdma - > sc_xprt . xpt_remotebuf ) ;
) ,
TP_printk ( " addr=%s sc_sq_avail=%d/%d status=%d " ,
__get_str ( addr ) , __entry - > avail , __entry - > depth ,
__entry - > status
)
) ;
2018-01-20 11:16:34 -05:00
# endif /* _TRACE_RPCRDMA_H */
# include <trace/define_trace.h>