1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright (c) 2017, 2018 Oracle. All rights reserved.
5 * Trace point definitions for the "rpcrdma" subsystem.
8 #define TRACE_SYSTEM rpcrdma
10 #if !defined(_TRACE_RPCRDMA_H) || defined(TRACE_HEADER_MULTI_READ)
11 #define _TRACE_RPCRDMA_H
13 #include <linux/scatterlist.h>
14 #include <linux/sunrpc/rpc_rdma_cid.h>
15 #include <linux/tracepoint.h>
16 #include <rdma/ib_cm.h>
18 #include <trace/misc/rdma.h>
19 #include <trace/misc/sunrpc.h>
25 DECLARE_EVENT_CLASS(rpcrdma_simple_cid_class
,
27 const struct rpc_rdma_cid
*cid
34 __field(int, completion_id
)
38 __entry
->cq_id
= cid
->ci_queue_id
;
39 __entry
->completion_id
= cid
->ci_completion_id
;
42 TP_printk("cq.id=%d cid=%d",
43 __entry
->cq_id
, __entry
->completion_id
47 #define DEFINE_SIMPLE_CID_EVENT(name) \
48 DEFINE_EVENT(rpcrdma_simple_cid_class, name, \
50 const struct rpc_rdma_cid *cid \
55 DECLARE_EVENT_CLASS(rpcrdma_completion_class
,
57 const struct ib_wc
*wc
,
58 const struct rpc_rdma_cid
*cid
65 __field(int, completion_id
)
66 __field(unsigned long, status
)
67 __field(unsigned int, vendor_err
)
71 __entry
->cq_id
= cid
->ci_queue_id
;
72 __entry
->completion_id
= cid
->ci_completion_id
;
73 __entry
->status
= wc
->status
;
75 __entry
->vendor_err
= wc
->vendor_err
;
77 __entry
->vendor_err
= 0;
80 TP_printk("cq.id=%u cid=%d status=%s (%lu/0x%x)",
81 __entry
->cq_id
, __entry
->completion_id
,
82 rdma_show_wc_status(__entry
->status
),
83 __entry
->status
, __entry
->vendor_err
87 #define DEFINE_COMPLETION_EVENT(name) \
88 DEFINE_EVENT(rpcrdma_completion_class, name, \
90 const struct ib_wc *wc, \
91 const struct rpc_rdma_cid *cid \
95 DECLARE_EVENT_CLASS(rpcrdma_send_flush_class
,
97 const struct ib_wc
*wc
,
98 const struct rpc_rdma_cid
*cid
105 __field(int, completion_id
)
106 __field(unsigned long, status
)
107 __field(unsigned int, vendor_err
)
111 __entry
->cq_id
= cid
->ci_queue_id
;
112 __entry
->completion_id
= cid
->ci_completion_id
;
113 __entry
->status
= wc
->status
;
114 __entry
->vendor_err
= wc
->vendor_err
;
117 TP_printk("cq.id=%u cid=%d status=%s (%lu/0x%x)",
118 __entry
->cq_id
, __entry
->completion_id
,
119 rdma_show_wc_status(__entry
->status
),
120 __entry
->status
, __entry
->vendor_err
124 #define DEFINE_SEND_FLUSH_EVENT(name) \
125 DEFINE_EVENT(rpcrdma_send_flush_class, name, \
127 const struct ib_wc *wc, \
128 const struct rpc_rdma_cid *cid \
132 DECLARE_EVENT_CLASS(rpcrdma_mr_completion_class
,
134 const struct ib_wc
*wc
,
135 const struct rpc_rdma_cid
*cid
142 __field(int, completion_id
)
143 __field(unsigned long, status
)
144 __field(unsigned int, vendor_err
)
148 __entry
->cq_id
= cid
->ci_queue_id
;
149 __entry
->completion_id
= cid
->ci_completion_id
;
150 __entry
->status
= wc
->status
;
152 __entry
->vendor_err
= wc
->vendor_err
;
154 __entry
->vendor_err
= 0;
157 TP_printk("cq.id=%u mr.id=%d status=%s (%lu/0x%x)",
158 __entry
->cq_id
, __entry
->completion_id
,
159 rdma_show_wc_status(__entry
->status
),
160 __entry
->status
, __entry
->vendor_err
164 #define DEFINE_MR_COMPLETION_EVENT(name) \
165 DEFINE_EVENT(rpcrdma_mr_completion_class, name, \
167 const struct ib_wc *wc, \
168 const struct rpc_rdma_cid *cid \
172 DECLARE_EVENT_CLASS(rpcrdma_receive_completion_class
,
174 const struct ib_wc
*wc
,
175 const struct rpc_rdma_cid
*cid
182 __field(int, completion_id
)
183 __field(u32
, received
)
184 __field(unsigned long, status
)
185 __field(unsigned int, vendor_err
)
189 __entry
->cq_id
= cid
->ci_queue_id
;
190 __entry
->completion_id
= cid
->ci_completion_id
;
191 __entry
->status
= wc
->status
;
193 __entry
->received
= 0;
194 __entry
->vendor_err
= wc
->vendor_err
;
196 __entry
->received
= wc
->byte_len
;
197 __entry
->vendor_err
= 0;
201 TP_printk("cq.id=%u cid=%d status=%s (%lu/0x%x) received=%u",
202 __entry
->cq_id
, __entry
->completion_id
,
203 rdma_show_wc_status(__entry
->status
),
204 __entry
->status
, __entry
->vendor_err
,
209 #define DEFINE_RECEIVE_COMPLETION_EVENT(name) \
210 DEFINE_EVENT(rpcrdma_receive_completion_class, name, \
212 const struct ib_wc *wc, \
213 const struct rpc_rdma_cid *cid \
217 DECLARE_EVENT_CLASS(rpcrdma_receive_success_class
,
219 const struct ib_wc
*wc
,
220 const struct rpc_rdma_cid
*cid
227 __field(int, completion_id
)
228 __field(u32
, received
)
232 __entry
->cq_id
= cid
->ci_queue_id
;
233 __entry
->completion_id
= cid
->ci_completion_id
;
234 __entry
->received
= wc
->byte_len
;
237 TP_printk("cq.id=%u cid=%d received=%u",
238 __entry
->cq_id
, __entry
->completion_id
,
243 #define DEFINE_RECEIVE_SUCCESS_EVENT(name) \
244 DEFINE_EVENT(rpcrdma_receive_success_class, name, \
246 const struct ib_wc *wc, \
247 const struct rpc_rdma_cid *cid \
251 DECLARE_EVENT_CLASS(rpcrdma_receive_flush_class
,
253 const struct ib_wc
*wc
,
254 const struct rpc_rdma_cid
*cid
261 __field(int, completion_id
)
262 __field(unsigned long, status
)
263 __field(unsigned int, vendor_err
)
267 __entry
->cq_id
= cid
->ci_queue_id
;
268 __entry
->completion_id
= cid
->ci_completion_id
;
269 __entry
->status
= wc
->status
;
270 __entry
->vendor_err
= wc
->vendor_err
;
273 TP_printk("cq.id=%u cid=%d status=%s (%lu/0x%x)",
274 __entry
->cq_id
, __entry
->completion_id
,
275 rdma_show_wc_status(__entry
->status
),
276 __entry
->status
, __entry
->vendor_err
280 #define DEFINE_RECEIVE_FLUSH_EVENT(name) \
281 DEFINE_EVENT(rpcrdma_receive_flush_class, name, \
283 const struct ib_wc *wc, \
284 const struct rpc_rdma_cid *cid \
288 DECLARE_EVENT_CLASS(xprtrdma_reply_class
,
290 const struct rpcrdma_rep
*rep
297 __field(u32
, version
)
299 __string(addr
, rpcrdma_addrstr(rep
->rr_rxprt
))
300 __string(port
, rpcrdma_portstr(rep
->rr_rxprt
))
304 __entry
->xid
= be32_to_cpu(rep
->rr_xid
);
305 __entry
->version
= be32_to_cpu(rep
->rr_vers
);
306 __entry
->proc
= be32_to_cpu(rep
->rr_proc
);
311 TP_printk("peer=[%s]:%s xid=0x%08x version=%u proc=%u",
312 __get_str(addr
), __get_str(port
),
313 __entry
->xid
, __entry
->version
, __entry
->proc
317 #define DEFINE_REPLY_EVENT(name) \
318 DEFINE_EVENT(xprtrdma_reply_class, \
319 xprtrdma_reply_##name##_err, \
321 const struct rpcrdma_rep *rep \
325 DECLARE_EVENT_CLASS(xprtrdma_rxprt
,
327 const struct rpcrdma_xprt
*r_xprt
333 __string(addr
, rpcrdma_addrstr(r_xprt
))
334 __string(port
, rpcrdma_portstr(r_xprt
))
342 TP_printk("peer=[%s]:%s",
343 __get_str(addr
), __get_str(port
)
347 #define DEFINE_RXPRT_EVENT(name) \
348 DEFINE_EVENT(xprtrdma_rxprt, name, \
350 const struct rpcrdma_xprt *r_xprt \
354 DECLARE_EVENT_CLASS(xprtrdma_connect_class
,
356 const struct rpcrdma_xprt
*r_xprt
,
364 __field(int, connect_status
)
365 __string(addr
, rpcrdma_addrstr(r_xprt
))
366 __string(port
, rpcrdma_portstr(r_xprt
))
371 __entry
->connect_status
= r_xprt
->rx_ep
->re_connect_status
;
376 TP_printk("peer=[%s]:%s rc=%d connection status=%d",
377 __get_str(addr
), __get_str(port
),
378 __entry
->rc
, __entry
->connect_status
382 #define DEFINE_CONN_EVENT(name) \
383 DEFINE_EVENT(xprtrdma_connect_class, xprtrdma_##name, \
385 const struct rpcrdma_xprt *r_xprt, \
390 DECLARE_EVENT_CLASS(xprtrdma_rdch_event
,
392 const struct rpc_task
*task
,
394 struct rpcrdma_mr
*mr
,
398 TP_ARGS(task
, pos
, mr
, nsegs
),
401 __field(unsigned int, task_id
)
402 __field(unsigned int, client_id
)
403 __field(unsigned int, pos
)
412 __entry
->task_id
= task
->tk_pid
;
413 __entry
->client_id
= task
->tk_client
->cl_clid
;
415 __entry
->nents
= mr
->mr_nents
;
416 __entry
->handle
= mr
->mr_handle
;
417 __entry
->length
= mr
->mr_length
;
418 __entry
->offset
= mr
->mr_offset
;
419 __entry
->nsegs
= nsegs
;
422 TP_printk(SUNRPC_TRACE_TASK_SPECIFIER
423 " pos=%u %u@0x%016llx:0x%08x (%s)",
424 __entry
->task_id
, __entry
->client_id
,
425 __entry
->pos
, __entry
->length
,
426 (unsigned long long)__entry
->offset
, __entry
->handle
,
427 __entry
->nents
< __entry
->nsegs
? "more" : "last"
431 #define DEFINE_RDCH_EVENT(name) \
432 DEFINE_EVENT(xprtrdma_rdch_event, xprtrdma_chunk_##name,\
434 const struct rpc_task *task, \
436 struct rpcrdma_mr *mr, \
439 TP_ARGS(task, pos, mr, nsegs))
441 DECLARE_EVENT_CLASS(xprtrdma_wrch_event
,
443 const struct rpc_task
*task
,
444 struct rpcrdma_mr
*mr
,
448 TP_ARGS(task
, mr
, nsegs
),
451 __field(unsigned int, task_id
)
452 __field(unsigned int, client_id
)
461 __entry
->task_id
= task
->tk_pid
;
462 __entry
->client_id
= task
->tk_client
->cl_clid
;
463 __entry
->nents
= mr
->mr_nents
;
464 __entry
->handle
= mr
->mr_handle
;
465 __entry
->length
= mr
->mr_length
;
466 __entry
->offset
= mr
->mr_offset
;
467 __entry
->nsegs
= nsegs
;
470 TP_printk(SUNRPC_TRACE_TASK_SPECIFIER
471 " %u@0x%016llx:0x%08x (%s)",
472 __entry
->task_id
, __entry
->client_id
,
473 __entry
->length
, (unsigned long long)__entry
->offset
,
475 __entry
->nents
< __entry
->nsegs
? "more" : "last"
479 #define DEFINE_WRCH_EVENT(name) \
480 DEFINE_EVENT(xprtrdma_wrch_event, xprtrdma_chunk_##name,\
482 const struct rpc_task *task, \
483 struct rpcrdma_mr *mr, \
486 TP_ARGS(task, mr, nsegs))
488 TRACE_DEFINE_ENUM(DMA_BIDIRECTIONAL
);
489 TRACE_DEFINE_ENUM(DMA_TO_DEVICE
);
490 TRACE_DEFINE_ENUM(DMA_FROM_DEVICE
);
491 TRACE_DEFINE_ENUM(DMA_NONE
);
493 #define xprtrdma_show_direction(x) \
494 __print_symbolic(x, \
495 { DMA_BIDIRECTIONAL, "BIDIR" }, \
496 { DMA_TO_DEVICE, "TO_DEVICE" }, \
497 { DMA_FROM_DEVICE, "FROM_DEVICE" }, \
498 { DMA_NONE, "NONE" })
500 DECLARE_EVENT_CLASS(xprtrdma_mr_class
,
502 const struct rpcrdma_mr
*mr
508 __field(unsigned int, task_id
)
509 __field(unsigned int, client_id
)
519 const struct rpcrdma_req
*req
= mr
->mr_req
;
522 const struct rpc_task
*task
= req
->rl_slot
.rq_task
;
524 __entry
->task_id
= task
->tk_pid
;
525 __entry
->client_id
= task
->tk_client
->cl_clid
;
527 __entry
->task_id
= 0;
528 __entry
->client_id
= -1;
530 __entry
->mr_id
= mr
->mr_ibmr
->res
.id
;
531 __entry
->nents
= mr
->mr_nents
;
532 __entry
->handle
= mr
->mr_handle
;
533 __entry
->length
= mr
->mr_length
;
534 __entry
->offset
= mr
->mr_offset
;
535 __entry
->dir
= mr
->mr_dir
;
538 TP_printk(SUNRPC_TRACE_TASK_SPECIFIER
539 " mr.id=%u nents=%d %u@0x%016llx:0x%08x (%s)",
540 __entry
->task_id
, __entry
->client_id
,
541 __entry
->mr_id
, __entry
->nents
, __entry
->length
,
542 (unsigned long long)__entry
->offset
, __entry
->handle
,
543 xprtrdma_show_direction(__entry
->dir
)
547 #define DEFINE_MR_EVENT(name) \
548 DEFINE_EVENT(xprtrdma_mr_class, \
549 xprtrdma_mr_##name, \
551 const struct rpcrdma_mr *mr \
555 DECLARE_EVENT_CLASS(xprtrdma_anonymous_mr_class
,
557 const struct rpcrdma_mr
*mr
572 __entry
->mr_id
= mr
->mr_ibmr
->res
.id
;
573 __entry
->nents
= mr
->mr_nents
;
574 __entry
->handle
= mr
->mr_handle
;
575 __entry
->length
= mr
->mr_length
;
576 __entry
->offset
= mr
->mr_offset
;
577 __entry
->dir
= mr
->mr_dir
;
580 TP_printk("mr.id=%u nents=%d %u@0x%016llx:0x%08x (%s)",
581 __entry
->mr_id
, __entry
->nents
, __entry
->length
,
582 (unsigned long long)__entry
->offset
, __entry
->handle
,
583 xprtrdma_show_direction(__entry
->dir
)
587 #define DEFINE_ANON_MR_EVENT(name) \
588 DEFINE_EVENT(xprtrdma_anonymous_mr_class, \
589 xprtrdma_mr_##name, \
591 const struct rpcrdma_mr *mr \
595 DECLARE_EVENT_CLASS(xprtrdma_callback_class
,
597 const struct rpcrdma_xprt
*r_xprt
,
598 const struct rpc_rqst
*rqst
601 TP_ARGS(r_xprt
, rqst
),
605 __string(addr
, rpcrdma_addrstr(r_xprt
))
606 __string(port
, rpcrdma_portstr(r_xprt
))
610 __entry
->xid
= be32_to_cpu(rqst
->rq_xid
);
615 TP_printk("peer=[%s]:%s xid=0x%08x",
616 __get_str(addr
), __get_str(port
), __entry
->xid
620 #define DEFINE_CALLBACK_EVENT(name) \
621 DEFINE_EVENT(xprtrdma_callback_class, \
622 xprtrdma_cb_##name, \
624 const struct rpcrdma_xprt *r_xprt, \
625 const struct rpc_rqst *rqst \
627 TP_ARGS(r_xprt, rqst))
633 TRACE_EVENT(xprtrdma_inline_thresh
,
635 const struct rpcrdma_ep
*ep
641 __field(unsigned int, inline_send
)
642 __field(unsigned int, inline_recv
)
643 __field(unsigned int, max_send
)
644 __field(unsigned int, max_recv
)
645 __array(unsigned char, srcaddr
, sizeof(struct sockaddr_in6
))
646 __array(unsigned char, dstaddr
, sizeof(struct sockaddr_in6
))
650 const struct rdma_cm_id
*id
= ep
->re_id
;
652 __entry
->inline_send
= ep
->re_inline_send
;
653 __entry
->inline_recv
= ep
->re_inline_recv
;
654 __entry
->max_send
= ep
->re_max_inline_send
;
655 __entry
->max_recv
= ep
->re_max_inline_recv
;
656 memcpy(__entry
->srcaddr
, &id
->route
.addr
.src_addr
,
657 sizeof(struct sockaddr_in6
));
658 memcpy(__entry
->dstaddr
, &id
->route
.addr
.dst_addr
,
659 sizeof(struct sockaddr_in6
));
662 TP_printk("%pISpc -> %pISpc neg send/recv=%u/%u, calc send/recv=%u/%u",
663 __entry
->srcaddr
, __entry
->dstaddr
,
664 __entry
->inline_send
, __entry
->inline_recv
,
665 __entry
->max_send
, __entry
->max_recv
669 DEFINE_CONN_EVENT(connect
);
670 DEFINE_CONN_EVENT(disconnect
);
672 TRACE_EVENT(xprtrdma_device_removal
,
674 const struct rdma_cm_id
*id
680 __string(name
, id
->device
->name
)
681 __array(unsigned char, addr
, sizeof(struct sockaddr_in6
))
686 memcpy(__entry
->addr
, &id
->route
.addr
.dst_addr
,
687 sizeof(struct sockaddr_in6
));
690 TP_printk("device %s to be removed, disconnecting %pISpc\n",
691 __get_str(name
), __entry
->addr
695 DEFINE_RXPRT_EVENT(xprtrdma_op_inject_dsc
);
697 TRACE_EVENT(xprtrdma_op_connect
,
699 const struct rpcrdma_xprt
*r_xprt
,
703 TP_ARGS(r_xprt
, delay
),
706 __field(unsigned long, delay
)
707 __string(addr
, rpcrdma_addrstr(r_xprt
))
708 __string(port
, rpcrdma_portstr(r_xprt
))
712 __entry
->delay
= delay
;
717 TP_printk("peer=[%s]:%s delay=%lu",
718 __get_str(addr
), __get_str(port
), __entry
->delay
723 TRACE_EVENT(xprtrdma_op_set_cto
,
725 const struct rpcrdma_xprt
*r_xprt
,
726 unsigned long connect
,
727 unsigned long reconnect
730 TP_ARGS(r_xprt
, connect
, reconnect
),
733 __field(unsigned long, connect
)
734 __field(unsigned long, reconnect
)
735 __string(addr
, rpcrdma_addrstr(r_xprt
))
736 __string(port
, rpcrdma_portstr(r_xprt
))
740 __entry
->connect
= connect
;
741 __entry
->reconnect
= reconnect
;
746 TP_printk("peer=[%s]:%s connect=%lu reconnect=%lu",
747 __get_str(addr
), __get_str(port
),
748 __entry
->connect
/ HZ
, __entry
->reconnect
/ HZ
756 TRACE_EVENT(xprtrdma_createmrs
,
758 const struct rpcrdma_xprt
*r_xprt
,
762 TP_ARGS(r_xprt
, count
),
765 __string(addr
, rpcrdma_addrstr(r_xprt
))
766 __string(port
, rpcrdma_portstr(r_xprt
))
767 __field(unsigned int, count
)
771 __entry
->count
= count
;
776 TP_printk("peer=[%s]:%s created %u MRs",
777 __get_str(addr
), __get_str(port
), __entry
->count
781 TRACE_EVENT(xprtrdma_nomrs_err
,
783 const struct rpcrdma_xprt
*r_xprt
,
784 const struct rpcrdma_req
*req
787 TP_ARGS(r_xprt
, req
),
790 __field(unsigned int, task_id
)
791 __field(unsigned int, client_id
)
792 __string(addr
, rpcrdma_addrstr(r_xprt
))
793 __string(port
, rpcrdma_portstr(r_xprt
))
797 const struct rpc_rqst
*rqst
= &req
->rl_slot
;
799 __entry
->task_id
= rqst
->rq_task
->tk_pid
;
800 __entry
->client_id
= rqst
->rq_task
->tk_client
->cl_clid
;
805 TP_printk(SUNRPC_TRACE_TASK_SPECIFIER
" peer=[%s]:%s",
806 __entry
->task_id
, __entry
->client_id
,
807 __get_str(addr
), __get_str(port
)
811 DEFINE_RDCH_EVENT(read
);
812 DEFINE_WRCH_EVENT(write
);
813 DEFINE_WRCH_EVENT(reply
);
814 DEFINE_WRCH_EVENT(wp
);
816 TRACE_DEFINE_ENUM(rpcrdma_noch
);
817 TRACE_DEFINE_ENUM(rpcrdma_noch_pullup
);
818 TRACE_DEFINE_ENUM(rpcrdma_noch_mapped
);
819 TRACE_DEFINE_ENUM(rpcrdma_readch
);
820 TRACE_DEFINE_ENUM(rpcrdma_areadch
);
821 TRACE_DEFINE_ENUM(rpcrdma_writech
);
822 TRACE_DEFINE_ENUM(rpcrdma_replych
);
824 #define xprtrdma_show_chunktype(x) \
825 __print_symbolic(x, \
826 { rpcrdma_noch, "inline" }, \
827 { rpcrdma_noch_pullup, "pullup" }, \
828 { rpcrdma_noch_mapped, "mapped" }, \
829 { rpcrdma_readch, "read list" }, \
830 { rpcrdma_areadch, "*read list" }, \
831 { rpcrdma_writech, "write list" }, \
832 { rpcrdma_replych, "reply chunk" })
834 TRACE_EVENT(xprtrdma_marshal
,
836 const struct rpcrdma_req
*req
,
841 TP_ARGS(req
, rtype
, wtype
),
844 __field(unsigned int, task_id
)
845 __field(unsigned int, client_id
)
847 __field(unsigned int, hdrlen
)
848 __field(unsigned int, headlen
)
849 __field(unsigned int, pagelen
)
850 __field(unsigned int, taillen
)
851 __field(unsigned int, rtype
)
852 __field(unsigned int, wtype
)
856 const struct rpc_rqst
*rqst
= &req
->rl_slot
;
858 __entry
->task_id
= rqst
->rq_task
->tk_pid
;
859 __entry
->client_id
= rqst
->rq_task
->tk_client
->cl_clid
;
860 __entry
->xid
= be32_to_cpu(rqst
->rq_xid
);
861 __entry
->hdrlen
= req
->rl_hdrbuf
.len
;
862 __entry
->headlen
= rqst
->rq_snd_buf
.head
[0].iov_len
;
863 __entry
->pagelen
= rqst
->rq_snd_buf
.page_len
;
864 __entry
->taillen
= rqst
->rq_snd_buf
.tail
[0].iov_len
;
865 __entry
->rtype
= rtype
;
866 __entry
->wtype
= wtype
;
869 TP_printk(SUNRPC_TRACE_TASK_SPECIFIER
870 " xid=0x%08x hdr=%u xdr=%u/%u/%u %s/%s",
871 __entry
->task_id
, __entry
->client_id
, __entry
->xid
,
873 __entry
->headlen
, __entry
->pagelen
, __entry
->taillen
,
874 xprtrdma_show_chunktype(__entry
->rtype
),
875 xprtrdma_show_chunktype(__entry
->wtype
)
879 TRACE_EVENT(xprtrdma_marshal_failed
,
880 TP_PROTO(const struct rpc_rqst
*rqst
,
887 __field(unsigned int, task_id
)
888 __field(unsigned int, client_id
)
894 __entry
->task_id
= rqst
->rq_task
->tk_pid
;
895 __entry
->client_id
= rqst
->rq_task
->tk_client
->cl_clid
;
896 __entry
->xid
= be32_to_cpu(rqst
->rq_xid
);
900 TP_printk(SUNRPC_TRACE_TASK_SPECIFIER
" xid=0x%08x ret=%d",
901 __entry
->task_id
, __entry
->client_id
, __entry
->xid
,
906 TRACE_EVENT(xprtrdma_prepsend_failed
,
907 TP_PROTO(const struct rpc_rqst
*rqst
,
914 __field(unsigned int, task_id
)
915 __field(unsigned int, client_id
)
921 __entry
->task_id
= rqst
->rq_task
->tk_pid
;
922 __entry
->client_id
= rqst
->rq_task
->tk_client
->cl_clid
;
923 __entry
->xid
= be32_to_cpu(rqst
->rq_xid
);
927 TP_printk(SUNRPC_TRACE_TASK_SPECIFIER
" xid=0x%08x ret=%d",
928 __entry
->task_id
, __entry
->client_id
, __entry
->xid
,
933 TRACE_EVENT(xprtrdma_post_send
,
935 const struct rpcrdma_req
*req
942 __field(int, completion_id
)
943 __field(unsigned int, task_id
)
944 __field(unsigned int, client_id
)
945 __field(int, num_sge
)
946 __field(int, signaled
)
950 const struct rpc_rqst
*rqst
= &req
->rl_slot
;
951 const struct rpcrdma_sendctx
*sc
= req
->rl_sendctx
;
953 __entry
->cq_id
= sc
->sc_cid
.ci_queue_id
;
954 __entry
->completion_id
= sc
->sc_cid
.ci_completion_id
;
955 __entry
->task_id
= rqst
->rq_task
->tk_pid
;
956 __entry
->client_id
= rqst
->rq_task
->tk_client
?
957 rqst
->rq_task
->tk_client
->cl_clid
: -1;
958 __entry
->num_sge
= req
->rl_wr
.num_sge
;
959 __entry
->signaled
= req
->rl_wr
.send_flags
& IB_SEND_SIGNALED
;
962 TP_printk(SUNRPC_TRACE_TASK_SPECIFIER
" cq.id=%u cid=%d (%d SGE%s) %s",
963 __entry
->task_id
, __entry
->client_id
,
964 __entry
->cq_id
, __entry
->completion_id
,
965 __entry
->num_sge
, (__entry
->num_sge
== 1 ? "" : "s"),
966 (__entry
->signaled
? "signaled" : "")
970 TRACE_EVENT(xprtrdma_post_send_err
,
972 const struct rpcrdma_xprt
*r_xprt
,
973 const struct rpcrdma_req
*req
,
977 TP_ARGS(r_xprt
, req
, rc
),
981 __field(unsigned int, task_id
)
982 __field(unsigned int, client_id
)
987 const struct rpc_rqst
*rqst
= &req
->rl_slot
;
988 const struct rpcrdma_ep
*ep
= r_xprt
->rx_ep
;
990 __entry
->cq_id
= ep
? ep
->re_attr
.recv_cq
->res
.id
: 0;
991 __entry
->task_id
= rqst
->rq_task
->tk_pid
;
992 __entry
->client_id
= rqst
->rq_task
->tk_client
?
993 rqst
->rq_task
->tk_client
->cl_clid
: -1;
997 TP_printk(SUNRPC_TRACE_TASK_SPECIFIER
" cq.id=%u rc=%d",
998 __entry
->task_id
, __entry
->client_id
,
999 __entry
->cq_id
, __entry
->rc
1003 DEFINE_SIMPLE_CID_EVENT(xprtrdma_post_recv
);
1005 TRACE_EVENT(xprtrdma_post_recvs
,
1007 const struct rpcrdma_xprt
*r_xprt
,
1011 TP_ARGS(r_xprt
, count
),
1015 __field(unsigned int, count
)
1016 __field(int, posted
)
1017 __string(addr
, rpcrdma_addrstr(r_xprt
))
1018 __string(port
, rpcrdma_portstr(r_xprt
))
1022 const struct rpcrdma_ep
*ep
= r_xprt
->rx_ep
;
1024 __entry
->cq_id
= ep
->re_attr
.recv_cq
->res
.id
;
1025 __entry
->count
= count
;
1026 __entry
->posted
= ep
->re_receive_count
;
1031 TP_printk("peer=[%s]:%s cq.id=%d %u new recvs, %d active",
1032 __get_str(addr
), __get_str(port
), __entry
->cq_id
,
1033 __entry
->count
, __entry
->posted
1037 TRACE_EVENT(xprtrdma_post_recvs_err
,
1039 const struct rpcrdma_xprt
*r_xprt
,
1043 TP_ARGS(r_xprt
, status
),
1047 __field(int, status
)
1048 __string(addr
, rpcrdma_addrstr(r_xprt
))
1049 __string(port
, rpcrdma_portstr(r_xprt
))
1053 const struct rpcrdma_ep
*ep
= r_xprt
->rx_ep
;
1055 __entry
->cq_id
= ep
->re_attr
.recv_cq
->res
.id
;
1056 __entry
->status
= status
;
1061 TP_printk("peer=[%s]:%s cq.id=%d rc=%d",
1062 __get_str(addr
), __get_str(port
), __entry
->cq_id
,
1067 TRACE_EVENT(xprtrdma_post_linv_err
,
1069 const struct rpcrdma_req
*req
,
1073 TP_ARGS(req
, status
),
1076 __field(unsigned int, task_id
)
1077 __field(unsigned int, client_id
)
1078 __field(int, status
)
1082 const struct rpc_task
*task
= req
->rl_slot
.rq_task
;
1084 __entry
->task_id
= task
->tk_pid
;
1085 __entry
->client_id
= task
->tk_client
->cl_clid
;
1086 __entry
->status
= status
;
1089 TP_printk(SUNRPC_TRACE_TASK_SPECIFIER
" status=%d",
1090 __entry
->task_id
, __entry
->client_id
, __entry
->status
1095 ** Completion events
1098 DEFINE_RECEIVE_COMPLETION_EVENT(xprtrdma_wc_receive
);
1100 DEFINE_COMPLETION_EVENT(xprtrdma_wc_send
);
1101 DEFINE_MR_COMPLETION_EVENT(xprtrdma_wc_fastreg
);
1102 DEFINE_MR_COMPLETION_EVENT(xprtrdma_wc_li
);
1103 DEFINE_MR_COMPLETION_EVENT(xprtrdma_wc_li_wake
);
1104 DEFINE_MR_COMPLETION_EVENT(xprtrdma_wc_li_done
);
1106 TRACE_EVENT(xprtrdma_frwr_alloc
,
1108 const struct rpcrdma_mr
*mr
,
1120 __entry
->mr_id
= mr
->mr_ibmr
->res
.id
;
1124 TP_printk("mr.id=%u: rc=%d",
1125 __entry
->mr_id
, __entry
->rc
1129 TRACE_EVENT(xprtrdma_frwr_dereg
,
1131 const struct rpcrdma_mr
*mr
,
1140 __field(u32
, handle
)
1141 __field(u32
, length
)
1142 __field(u64
, offset
)
1148 __entry
->mr_id
= mr
->mr_ibmr
->res
.id
;
1149 __entry
->nents
= mr
->mr_nents
;
1150 __entry
->handle
= mr
->mr_handle
;
1151 __entry
->length
= mr
->mr_length
;
1152 __entry
->offset
= mr
->mr_offset
;
1153 __entry
->dir
= mr
->mr_dir
;
1157 TP_printk("mr.id=%u nents=%d %u@0x%016llx:0x%08x (%s): rc=%d",
1158 __entry
->mr_id
, __entry
->nents
, __entry
->length
,
1159 (unsigned long long)__entry
->offset
, __entry
->handle
,
1160 xprtrdma_show_direction(__entry
->dir
),
1165 TRACE_EVENT(xprtrdma_frwr_sgerr
,
1167 const struct rpcrdma_mr
*mr
,
1171 TP_ARGS(mr
, sg_nents
),
1181 __entry
->mr_id
= mr
->mr_ibmr
->res
.id
;
1182 __entry
->addr
= mr
->mr_sg
->dma_address
;
1183 __entry
->dir
= mr
->mr_dir
;
1184 __entry
->nents
= sg_nents
;
1187 TP_printk("mr.id=%u DMA addr=0x%llx (%s) sg_nents=%d",
1188 __entry
->mr_id
, __entry
->addr
,
1189 xprtrdma_show_direction(__entry
->dir
),
1194 TRACE_EVENT(xprtrdma_frwr_maperr
,
1196 const struct rpcrdma_mr
*mr
,
1200 TP_ARGS(mr
, num_mapped
),
1206 __field(int, num_mapped
)
1211 __entry
->mr_id
= mr
->mr_ibmr
->res
.id
;
1212 __entry
->addr
= mr
->mr_sg
->dma_address
;
1213 __entry
->dir
= mr
->mr_dir
;
1214 __entry
->num_mapped
= num_mapped
;
1215 __entry
->nents
= mr
->mr_nents
;
1218 TP_printk("mr.id=%u DMA addr=0x%llx (%s) nents=%d of %d",
1219 __entry
->mr_id
, __entry
->addr
,
1220 xprtrdma_show_direction(__entry
->dir
),
1221 __entry
->num_mapped
, __entry
->nents
1225 DEFINE_MR_EVENT(fastreg
);
1226 DEFINE_MR_EVENT(localinv
);
1227 DEFINE_MR_EVENT(reminv
);
1228 DEFINE_MR_EVENT(map
);
1230 DEFINE_ANON_MR_EVENT(unmap
);
1232 TRACE_EVENT(xprtrdma_dma_maperr
,
1244 __entry
->addr
= addr
;
1247 TP_printk("dma addr=0x%llx\n", __entry
->addr
)
1254 TRACE_EVENT(xprtrdma_reply
,
1256 const struct rpc_task
*task
,
1257 const struct rpcrdma_rep
*rep
,
1258 unsigned int credits
1261 TP_ARGS(task
, rep
, credits
),
1264 __field(unsigned int, task_id
)
1265 __field(unsigned int, client_id
)
1267 __field(unsigned int, credits
)
1271 __entry
->task_id
= task
->tk_pid
;
1272 __entry
->client_id
= task
->tk_client
->cl_clid
;
1273 __entry
->xid
= be32_to_cpu(rep
->rr_xid
);
1274 __entry
->credits
= credits
;
1277 TP_printk(SUNRPC_TRACE_TASK_SPECIFIER
" xid=0x%08x credits=%u",
1278 __entry
->task_id
, __entry
->client_id
, __entry
->xid
,
1283 DEFINE_REPLY_EVENT(vers
);
1284 DEFINE_REPLY_EVENT(rqst
);
1285 DEFINE_REPLY_EVENT(short);
1286 DEFINE_REPLY_EVENT(hdr
);
1288 TRACE_EVENT(xprtrdma_err_vers
,
1290 const struct rpc_rqst
*rqst
,
1295 TP_ARGS(rqst
, min
, max
),
1298 __field(unsigned int, task_id
)
1299 __field(unsigned int, client_id
)
1306 __entry
->task_id
= rqst
->rq_task
->tk_pid
;
1307 __entry
->client_id
= rqst
->rq_task
->tk_client
->cl_clid
;
1308 __entry
->xid
= be32_to_cpu(rqst
->rq_xid
);
1309 __entry
->min
= be32_to_cpup(min
);
1310 __entry
->max
= be32_to_cpup(max
);
1313 TP_printk(SUNRPC_TRACE_TASK_SPECIFIER
" xid=0x%08x versions=[%u, %u]",
1314 __entry
->task_id
, __entry
->client_id
, __entry
->xid
,
1315 __entry
->min
, __entry
->max
1319 TRACE_EVENT(xprtrdma_err_chunk
,
1321 const struct rpc_rqst
*rqst
1327 __field(unsigned int, task_id
)
1328 __field(unsigned int, client_id
)
1333 __entry
->task_id
= rqst
->rq_task
->tk_pid
;
1334 __entry
->client_id
= rqst
->rq_task
->tk_client
->cl_clid
;
1335 __entry
->xid
= be32_to_cpu(rqst
->rq_xid
);
1338 TP_printk(SUNRPC_TRACE_TASK_SPECIFIER
" xid=0x%08x",
1339 __entry
->task_id
, __entry
->client_id
, __entry
->xid
1343 TRACE_EVENT(xprtrdma_err_unrecognized
,
1345 const struct rpc_rqst
*rqst
,
1349 TP_ARGS(rqst
, procedure
),
1352 __field(unsigned int, task_id
)
1353 __field(unsigned int, client_id
)
1355 __field(u32
, procedure
)
1359 __entry
->task_id
= rqst
->rq_task
->tk_pid
;
1360 __entry
->client_id
= rqst
->rq_task
->tk_client
->cl_clid
;
1361 __entry
->procedure
= be32_to_cpup(procedure
);
1364 TP_printk(SUNRPC_TRACE_TASK_SPECIFIER
" xid=0x%08x procedure=%u",
1365 __entry
->task_id
, __entry
->client_id
, __entry
->xid
,
1370 TRACE_EVENT(xprtrdma_fixup
,
1372 const struct rpc_rqst
*rqst
,
1376 TP_ARGS(rqst
, fixup
),
1379 __field(unsigned int, task_id
)
1380 __field(unsigned int, client_id
)
1381 __field(unsigned long, fixup
)
1382 __field(size_t, headlen
)
1383 __field(unsigned int, pagelen
)
1384 __field(size_t, taillen
)
1388 __entry
->task_id
= rqst
->rq_task
->tk_pid
;
1389 __entry
->client_id
= rqst
->rq_task
->tk_client
->cl_clid
;
1390 __entry
->fixup
= fixup
;
1391 __entry
->headlen
= rqst
->rq_rcv_buf
.head
[0].iov_len
;
1392 __entry
->pagelen
= rqst
->rq_rcv_buf
.page_len
;
1393 __entry
->taillen
= rqst
->rq_rcv_buf
.tail
[0].iov_len
;
1396 TP_printk(SUNRPC_TRACE_TASK_SPECIFIER
" fixup=%lu xdr=%zu/%u/%zu",
1397 __entry
->task_id
, __entry
->client_id
, __entry
->fixup
,
1398 __entry
->headlen
, __entry
->pagelen
, __entry
->taillen
1402 TRACE_EVENT(xprtrdma_decode_seg
,
1409 TP_ARGS(handle
, length
, offset
),
1412 __field(u32
, handle
)
1413 __field(u32
, length
)
1414 __field(u64
, offset
)
1418 __entry
->handle
= handle
;
1419 __entry
->length
= length
;
1420 __entry
->offset
= offset
;
1423 TP_printk("%u@0x%016llx:0x%08x",
1424 __entry
->length
, (unsigned long long)__entry
->offset
,
1429 TRACE_EVENT(xprtrdma_mrs_zap
,
1431 const struct rpc_task
*task
1437 __field(unsigned int, task_id
)
1438 __field(unsigned int, client_id
)
1442 __entry
->task_id
= task
->tk_pid
;
1443 __entry
->client_id
= task
->tk_client
->cl_clid
;
1446 TP_printk(SUNRPC_TRACE_TASK_SPECIFIER
,
1447 __entry
->task_id
, __entry
->client_id
1455 TRACE_EVENT(xprtrdma_cb_setup
,
1457 const struct rpcrdma_xprt
*r_xprt
,
1461 TP_ARGS(r_xprt
, reqs
),
1464 __field(unsigned int, reqs
)
1465 __string(addr
, rpcrdma_addrstr(r_xprt
))
1466 __string(port
, rpcrdma_portstr(r_xprt
))
1470 __entry
->reqs
= reqs
;
1475 TP_printk("peer=[%s]:%s %u reqs",
1476 __get_str(addr
), __get_str(port
), __entry
->reqs
1480 DEFINE_CALLBACK_EVENT(call
);
1481 DEFINE_CALLBACK_EVENT(reply
);
1484 ** Server-side RPC/RDMA events
1487 DECLARE_EVENT_CLASS(svcrdma_accept_class
,
1489 const struct svcxprt_rdma
*rdma
,
1493 TP_ARGS(rdma
, status
),
1496 __field(long, status
)
1497 __string(addr
, rdma
->sc_xprt
.xpt_remotebuf
)
1501 __entry
->status
= status
;
1505 TP_printk("addr=%s status=%ld",
1506 __get_str(addr
), __entry
->status
1510 #define DEFINE_ACCEPT_EVENT(name) \
1511 DEFINE_EVENT(svcrdma_accept_class, svcrdma_##name##_err, \
1513 const struct svcxprt_rdma *rdma, \
1516 TP_ARGS(rdma, status))
1518 DEFINE_ACCEPT_EVENT(pd
);
1519 DEFINE_ACCEPT_EVENT(qp
);
1520 DEFINE_ACCEPT_EVENT(fabric
);
1521 DEFINE_ACCEPT_EVENT(initdepth
);
1522 DEFINE_ACCEPT_EVENT(accept
);
1524 TRACE_DEFINE_ENUM(RDMA_MSG
);
1525 TRACE_DEFINE_ENUM(RDMA_NOMSG
);
1526 TRACE_DEFINE_ENUM(RDMA_MSGP
);
1527 TRACE_DEFINE_ENUM(RDMA_DONE
);
1528 TRACE_DEFINE_ENUM(RDMA_ERROR
);
1530 #define show_rpcrdma_proc(x) \
1531 __print_symbolic(x, \
1532 { RDMA_MSG, "RDMA_MSG" }, \
1533 { RDMA_NOMSG, "RDMA_NOMSG" }, \
1534 { RDMA_MSGP, "RDMA_MSGP" }, \
1535 { RDMA_DONE, "RDMA_DONE" }, \
1536 { RDMA_ERROR, "RDMA_ERROR" })
1538 TRACE_EVENT(svcrdma_decode_rqst
,
1540 const struct svc_rdma_recv_ctxt
*ctxt
,
1545 TP_ARGS(ctxt
, p
, hdrlen
),
1549 __field(int, completion_id
)
1553 __field(u32
, credits
)
1554 __field(unsigned int, hdrlen
)
1558 __entry
->cq_id
= ctxt
->rc_cid
.ci_queue_id
;
1559 __entry
->completion_id
= ctxt
->rc_cid
.ci_completion_id
;
1560 __entry
->xid
= be32_to_cpup(p
++);
1561 __entry
->vers
= be32_to_cpup(p
++);
1562 __entry
->credits
= be32_to_cpup(p
++);
1563 __entry
->proc
= be32_to_cpup(p
);
1564 __entry
->hdrlen
= hdrlen
;
1567 TP_printk("cq.id=%u cid=%d xid=0x%08x vers=%u credits=%u proc=%s hdrlen=%u",
1568 __entry
->cq_id
, __entry
->completion_id
,
1569 __entry
->xid
, __entry
->vers
, __entry
->credits
,
1570 show_rpcrdma_proc(__entry
->proc
), __entry
->hdrlen
)
1573 TRACE_EVENT(svcrdma_decode_short_err
,
1575 const struct svc_rdma_recv_ctxt
*ctxt
,
1579 TP_ARGS(ctxt
, hdrlen
),
1583 __field(int, completion_id
)
1584 __field(unsigned int, hdrlen
)
1588 __entry
->cq_id
= ctxt
->rc_cid
.ci_queue_id
;
1589 __entry
->completion_id
= ctxt
->rc_cid
.ci_completion_id
;
1590 __entry
->hdrlen
= hdrlen
;
1593 TP_printk("cq.id=%u cid=%d hdrlen=%u",
1594 __entry
->cq_id
, __entry
->completion_id
,
1598 DECLARE_EVENT_CLASS(svcrdma_badreq_event
,
1600 const struct svc_rdma_recv_ctxt
*ctxt
,
1608 __field(int, completion_id
)
1612 __field(u32
, credits
)
1616 __entry
->cq_id
= ctxt
->rc_cid
.ci_queue_id
;
1617 __entry
->completion_id
= ctxt
->rc_cid
.ci_completion_id
;
1618 __entry
->xid
= be32_to_cpup(p
++);
1619 __entry
->vers
= be32_to_cpup(p
++);
1620 __entry
->credits
= be32_to_cpup(p
++);
1621 __entry
->proc
= be32_to_cpup(p
);
1624 TP_printk("cq.id=%u cid=%d xid=0x%08x vers=%u credits=%u proc=%u",
1625 __entry
->cq_id
, __entry
->completion_id
,
1626 __entry
->xid
, __entry
->vers
, __entry
->credits
, __entry
->proc
)
1629 #define DEFINE_BADREQ_EVENT(name) \
1630 DEFINE_EVENT(svcrdma_badreq_event, \
1631 svcrdma_decode_##name##_err, \
1633 const struct svc_rdma_recv_ctxt *ctxt, \
1638 DEFINE_BADREQ_EVENT(badvers
);
1639 DEFINE_BADREQ_EVENT(drop
);
1640 DEFINE_BADREQ_EVENT(badproc
);
1641 DEFINE_BADREQ_EVENT(parse
);
1643 TRACE_EVENT(svcrdma_encode_wseg
,
1645 const struct svc_rdma_send_ctxt
*ctxt
,
1652 TP_ARGS(ctxt
, segno
, handle
, length
, offset
),
1656 __field(int, completion_id
)
1658 __field(u32
, handle
)
1659 __field(u32
, length
)
1660 __field(u64
, offset
)
1664 __entry
->cq_id
= ctxt
->sc_cid
.ci_queue_id
;
1665 __entry
->completion_id
= ctxt
->sc_cid
.ci_completion_id
;
1666 __entry
->segno
= segno
;
1667 __entry
->handle
= handle
;
1668 __entry
->length
= length
;
1669 __entry
->offset
= offset
;
1672 TP_printk("cq.id=%u cid=%d segno=%u %u@0x%016llx:0x%08x",
1673 __entry
->cq_id
, __entry
->completion_id
,
1674 __entry
->segno
, __entry
->length
,
1675 (unsigned long long)__entry
->offset
, __entry
->handle
1679 TRACE_EVENT(svcrdma_decode_rseg
,
1681 const struct rpc_rdma_cid
*cid
,
1682 const struct svc_rdma_chunk
*chunk
,
1683 const struct svc_rdma_segment
*segment
1686 TP_ARGS(cid
, chunk
, segment
),
1690 __field(int, completion_id
)
1692 __field(u32
, position
)
1693 __field(u32
, handle
)
1694 __field(u32
, length
)
1695 __field(u64
, offset
)
1699 __entry
->cq_id
= cid
->ci_queue_id
;
1700 __entry
->completion_id
= cid
->ci_completion_id
;
1701 __entry
->segno
= chunk
->ch_segcount
;
1702 __entry
->position
= chunk
->ch_position
;
1703 __entry
->handle
= segment
->rs_handle
;
1704 __entry
->length
= segment
->rs_length
;
1705 __entry
->offset
= segment
->rs_offset
;
1708 TP_printk("cq.id=%u cid=%d segno=%u position=%u %u@0x%016llx:0x%08x",
1709 __entry
->cq_id
, __entry
->completion_id
,
1710 __entry
->segno
, __entry
->position
, __entry
->length
,
1711 (unsigned long long)__entry
->offset
, __entry
->handle
1715 TRACE_EVENT(svcrdma_decode_wseg
,
1717 const struct rpc_rdma_cid
*cid
,
1718 const struct svc_rdma_chunk
*chunk
,
1722 TP_ARGS(cid
, chunk
, segno
),
1726 __field(int, completion_id
)
1728 __field(u32
, handle
)
1729 __field(u32
, length
)
1730 __field(u64
, offset
)
1734 const struct svc_rdma_segment
*segment
=
1735 &chunk
->ch_segments
[segno
];
1737 __entry
->cq_id
= cid
->ci_queue_id
;
1738 __entry
->completion_id
= cid
->ci_completion_id
;
1739 __entry
->segno
= segno
;
1740 __entry
->handle
= segment
->rs_handle
;
1741 __entry
->length
= segment
->rs_length
;
1742 __entry
->offset
= segment
->rs_offset
;
1745 TP_printk("cq.id=%u cid=%d segno=%u %u@0x%016llx:0x%08x",
1746 __entry
->cq_id
, __entry
->completion_id
,
1747 __entry
->segno
, __entry
->length
,
1748 (unsigned long long)__entry
->offset
, __entry
->handle
1752 DECLARE_EVENT_CLASS(svcrdma_error_event
,
1764 __entry
->xid
= be32_to_cpu(xid
);
1767 TP_printk("xid=0x%08x",
1772 #define DEFINE_ERROR_EVENT(name) \
1773 DEFINE_EVENT(svcrdma_error_event, svcrdma_err_##name, \
1779 DEFINE_ERROR_EVENT(vers
);
1780 DEFINE_ERROR_EVENT(chunk
);
1783 ** Server-side RDMA API events
1786 DECLARE_EVENT_CLASS(svcrdma_dma_map_class
,
1788 const struct rpc_rdma_cid
*cid
,
1793 TP_ARGS(cid
, dma_addr
, length
),
1797 __field(int, completion_id
)
1798 __field(u64
, dma_addr
)
1799 __field(u32
, length
)
1803 __entry
->cq_id
= cid
->ci_queue_id
;
1804 __entry
->completion_id
= cid
->ci_completion_id
;
1805 __entry
->dma_addr
= dma_addr
;
1806 __entry
->length
= length
;
1809 TP_printk("cq.id=%u cid=%d dma_addr=%llu length=%u",
1810 __entry
->cq_id
, __entry
->completion_id
,
1811 __entry
->dma_addr
, __entry
->length
1815 #define DEFINE_SVC_DMA_EVENT(name) \
1816 DEFINE_EVENT(svcrdma_dma_map_class, svcrdma_##name, \
1818 const struct rpc_rdma_cid *cid, \
1822 TP_ARGS(cid, dma_addr, length) \
1825 DEFINE_SVC_DMA_EVENT(dma_map_page
);
1826 DEFINE_SVC_DMA_EVENT(dma_map_err
);
1827 DEFINE_SVC_DMA_EVENT(dma_unmap_page
);
1829 TRACE_EVENT(svcrdma_dma_map_rw_err
,
1831 const struct svcxprt_rdma
*rdma
,
1838 TP_ARGS(rdma
, offset
, handle
, nents
, status
),
1842 __field(u32
, handle
)
1843 __field(u64
, offset
)
1844 __field(unsigned int, nents
)
1845 __field(int, status
)
1849 __entry
->cq_id
= rdma
->sc_sq_cq
->res
.id
;
1850 __entry
->handle
= handle
;
1851 __entry
->offset
= offset
;
1852 __entry
->nents
= nents
;
1853 __entry
->status
= status
;
1856 TP_printk("cq.id=%u 0x%016llx:0x%08x nents=%u status=%d",
1857 __entry
->cq_id
, (unsigned long long)__entry
->offset
,
1858 __entry
->handle
, __entry
->nents
, __entry
->status
1862 TRACE_EVENT(svcrdma_rwctx_empty
,
1864 const struct svcxprt_rdma
*rdma
,
1865 unsigned int num_sges
1868 TP_ARGS(rdma
, num_sges
),
1872 __field(unsigned int, num_sges
)
1876 __entry
->cq_id
= rdma
->sc_sq_cq
->res
.id
;
1877 __entry
->num_sges
= num_sges
;
1880 TP_printk("cq.id=%u num_sges=%d",
1881 __entry
->cq_id
, __entry
->num_sges
1885 TRACE_EVENT(svcrdma_page_overrun_err
,
1887 const struct rpc_rdma_cid
*cid
,
1891 TP_ARGS(cid
, pageno
),
1895 __field(int, completion_id
)
1896 __field(unsigned int, pageno
)
1900 __entry
->cq_id
= cid
->ci_queue_id
;
1901 __entry
->completion_id
= cid
->ci_completion_id
;
1902 __entry
->pageno
= pageno
;
1905 TP_printk("cq.id=%u cid=%d pageno=%u",
1906 __entry
->cq_id
, __entry
->completion_id
,
1911 TRACE_EVENT(svcrdma_small_wrch_err
,
1913 const struct rpc_rdma_cid
*cid
,
1914 unsigned int remaining
,
1915 unsigned int seg_no
,
1916 unsigned int num_segs
1919 TP_ARGS(cid
, remaining
, seg_no
, num_segs
),
1923 __field(int, completion_id
)
1924 __field(unsigned int, remaining
)
1925 __field(unsigned int, seg_no
)
1926 __field(unsigned int, num_segs
)
1930 __entry
->cq_id
= cid
->ci_queue_id
;
1931 __entry
->completion_id
= cid
->ci_completion_id
;
1932 __entry
->remaining
= remaining
;
1933 __entry
->seg_no
= seg_no
;
1934 __entry
->num_segs
= num_segs
;
1937 TP_printk("cq.id=%u cid=%d remaining=%u seg_no=%u num_segs=%u",
1938 __entry
->cq_id
, __entry
->completion_id
,
1939 __entry
->remaining
, __entry
->seg_no
, __entry
->num_segs
1943 TRACE_EVENT(svcrdma_send_pullup
,
1945 const struct svc_rdma_send_ctxt
*ctxt
,
1949 TP_ARGS(ctxt
, msglen
),
1953 __field(int, completion_id
)
1954 __field(unsigned int, hdrlen
)
1955 __field(unsigned int, msglen
)
1959 __entry
->cq_id
= ctxt
->sc_cid
.ci_queue_id
;
1960 __entry
->completion_id
= ctxt
->sc_cid
.ci_completion_id
;
1961 __entry
->hdrlen
= ctxt
->sc_hdrbuf
.len
,
1962 __entry
->msglen
= msglen
;
1965 TP_printk("cq.id=%u cid=%d hdr=%u msg=%u (total %u)",
1966 __entry
->cq_id
, __entry
->completion_id
,
1967 __entry
->hdrlen
, __entry
->msglen
,
1968 __entry
->hdrlen
+ __entry
->msglen
)
1971 TRACE_EVENT(svcrdma_send_err
,
1973 const struct svc_rqst
*rqst
,
1977 TP_ARGS(rqst
, status
),
1980 __field(int, status
)
1982 __string(addr
, rqst
->rq_xprt
->xpt_remotebuf
)
1986 __entry
->status
= status
;
1987 __entry
->xid
= __be32_to_cpu(rqst
->rq_xid
);
1991 TP_printk("addr=%s xid=0x%08x status=%d", __get_str(addr
),
1992 __entry
->xid
, __entry
->status
1996 TRACE_EVENT(svcrdma_post_send
,
1998 const struct svc_rdma_send_ctxt
*ctxt
2005 __field(int, completion_id
)
2006 __field(unsigned int, num_sge
)
2007 __field(u32
, inv_rkey
)
2011 const struct ib_send_wr
*wr
= &ctxt
->sc_send_wr
;
2013 __entry
->cq_id
= ctxt
->sc_cid
.ci_queue_id
;
2014 __entry
->completion_id
= ctxt
->sc_cid
.ci_completion_id
;
2015 __entry
->num_sge
= wr
->num_sge
;
2016 __entry
->inv_rkey
= (wr
->opcode
== IB_WR_SEND_WITH_INV
) ?
2017 wr
->ex
.invalidate_rkey
: 0;
2020 TP_printk("cq.id=%u cid=%d num_sge=%u inv_rkey=0x%08x",
2021 __entry
->cq_id
, __entry
->completion_id
,
2022 __entry
->num_sge
, __entry
->inv_rkey
2026 DEFINE_SIMPLE_CID_EVENT(svcrdma_wc_send
);
2027 DEFINE_SEND_FLUSH_EVENT(svcrdma_wc_send_flush
);
2028 DEFINE_SEND_FLUSH_EVENT(svcrdma_wc_send_err
);
2030 DEFINE_SIMPLE_CID_EVENT(svcrdma_post_recv
);
2032 DEFINE_RECEIVE_SUCCESS_EVENT(svcrdma_wc_recv
);
2033 DEFINE_RECEIVE_FLUSH_EVENT(svcrdma_wc_recv_flush
);
2034 DEFINE_RECEIVE_FLUSH_EVENT(svcrdma_wc_recv_err
);
2036 TRACE_EVENT(svcrdma_rq_post_err
,
2038 const struct svcxprt_rdma
*rdma
,
2042 TP_ARGS(rdma
, status
),
2045 __field(int, status
)
2046 __string(addr
, rdma
->sc_xprt
.xpt_remotebuf
)
2050 __entry
->status
= status
;
2054 TP_printk("addr=%s status=%d",
2055 __get_str(addr
), __entry
->status
2059 DECLARE_EVENT_CLASS(svcrdma_post_chunk_class
,
2061 const struct rpc_rdma_cid
*cid
,
2065 TP_ARGS(cid
, sqecount
),
2069 __field(int, completion_id
)
2070 __field(int, sqecount
)
2074 __entry
->cq_id
= cid
->ci_queue_id
;
2075 __entry
->completion_id
= cid
->ci_completion_id
;
2076 __entry
->sqecount
= sqecount
;
2079 TP_printk("cq.id=%u cid=%d sqecount=%d",
2080 __entry
->cq_id
, __entry
->completion_id
,
2085 #define DEFINE_POST_CHUNK_EVENT(name) \
2086 DEFINE_EVENT(svcrdma_post_chunk_class, \
2087 svcrdma_post_##name##_chunk, \
2089 const struct rpc_rdma_cid *cid, \
2092 TP_ARGS(cid, sqecount))
2094 DEFINE_POST_CHUNK_EVENT(read
);
2095 DEFINE_POST_CHUNK_EVENT(write
);
2096 DEFINE_POST_CHUNK_EVENT(reply
);
2098 DEFINE_EVENT(svcrdma_post_chunk_class
, svcrdma_cc_release
,
2100 const struct rpc_rdma_cid
*cid
,
2103 TP_ARGS(cid
, sqecount
)
2106 TRACE_EVENT(svcrdma_wc_read
,
2108 const struct ib_wc
*wc
,
2109 const struct rpc_rdma_cid
*cid
,
2110 unsigned int totalbytes
,
2111 const ktime_t posttime
2114 TP_ARGS(wc
, cid
, totalbytes
, posttime
),
2118 __field(int, completion_id
)
2119 __field(s64
, read_latency
)
2120 __field(unsigned int, totalbytes
)
2124 __entry
->cq_id
= cid
->ci_queue_id
;
2125 __entry
->completion_id
= cid
->ci_completion_id
;
2126 __entry
->totalbytes
= totalbytes
;
2127 __entry
->read_latency
= ktime_us_delta(ktime_get(), posttime
);
2130 TP_printk("cq.id=%u cid=%d totalbytes=%u latency-us=%lld",
2131 __entry
->cq_id
, __entry
->completion_id
,
2132 __entry
->totalbytes
, __entry
->read_latency
2136 DEFINE_SEND_FLUSH_EVENT(svcrdma_wc_read_flush
);
2137 DEFINE_SEND_FLUSH_EVENT(svcrdma_wc_read_err
);
2138 DEFINE_SIMPLE_CID_EVENT(svcrdma_read_finished
);
2140 DEFINE_SIMPLE_CID_EVENT(svcrdma_wc_write
);
2141 DEFINE_SEND_FLUSH_EVENT(svcrdma_wc_write_flush
);
2142 DEFINE_SEND_FLUSH_EVENT(svcrdma_wc_write_err
);
2144 DEFINE_SIMPLE_CID_EVENT(svcrdma_wc_reply
);
2145 DEFINE_SEND_FLUSH_EVENT(svcrdma_wc_reply_flush
);
2146 DEFINE_SEND_FLUSH_EVENT(svcrdma_wc_reply_err
);
2148 TRACE_EVENT(svcrdma_qp_error
,
2150 const struct ib_event
*event
,
2151 const struct sockaddr
*sap
2154 TP_ARGS(event
, sap
),
2157 __field(unsigned int, event
)
2158 __string(device
, event
->device
->name
)
2159 __array(__u8
, addr
, INET6_ADDRSTRLEN
+ 10)
2163 __entry
->event
= event
->event
;
2164 __assign_str(device
);
2165 snprintf(__entry
->addr
, sizeof(__entry
->addr
) - 1,
2169 TP_printk("addr=%s dev=%s event=%s (%u)",
2170 __entry
->addr
, __get_str(device
),
2171 rdma_show_ib_event(__entry
->event
), __entry
->event
2175 TRACE_EVENT(svcrdma_device_removal
,
2177 const struct rdma_cm_id
*id
2183 __string(name
, id
->device
->name
)
2184 __array(unsigned char, addr
, sizeof(struct sockaddr_in6
))
2189 memcpy(__entry
->addr
, &id
->route
.addr
.dst_addr
,
2190 sizeof(struct sockaddr_in6
));
2193 TP_printk("device %s to be removed, disconnecting %pISpc\n",
2194 __get_str(name
), __entry
->addr
2198 DECLARE_EVENT_CLASS(svcrdma_sendqueue_class
,
2200 const struct svcxprt_rdma
*rdma
,
2201 const struct rpc_rdma_cid
*cid
2208 __field(int, completion_id
)
2214 __entry
->cq_id
= cid
->ci_queue_id
;
2215 __entry
->completion_id
= cid
->ci_completion_id
;
2216 __entry
->avail
= atomic_read(&rdma
->sc_sq_avail
);
2217 __entry
->depth
= rdma
->sc_sq_depth
;
2220 TP_printk("cq.id=%u cid=%d sc_sq_avail=%d/%d",
2221 __entry
->cq_id
, __entry
->completion_id
,
2222 __entry
->avail
, __entry
->depth
2226 #define DEFINE_SQ_EVENT(name) \
2227 DEFINE_EVENT(svcrdma_sendqueue_class, name, \
2229 const struct svcxprt_rdma *rdma, \
2230 const struct rpc_rdma_cid *cid \
2232 TP_ARGS(rdma, cid) \
2235 DEFINE_SQ_EVENT(svcrdma_sq_full
);
2236 DEFINE_SQ_EVENT(svcrdma_sq_retry
);
2238 TRACE_EVENT(svcrdma_sq_post_err
,
2240 const struct svcxprt_rdma
*rdma
,
2241 const struct rpc_rdma_cid
*cid
,
2245 TP_ARGS(rdma
, cid
, status
),
2249 __field(int, completion_id
)
2252 __field(int, status
)
2256 __entry
->cq_id
= cid
->ci_queue_id
;
2257 __entry
->completion_id
= cid
->ci_completion_id
;
2258 __entry
->avail
= atomic_read(&rdma
->sc_sq_avail
);
2259 __entry
->depth
= rdma
->sc_sq_depth
;
2260 __entry
->status
= status
;
2263 TP_printk("cq.id=%u cid=%d sc_sq_avail=%d/%d status=%d",
2264 __entry
->cq_id
, __entry
->completion_id
,
2265 __entry
->avail
, __entry
->depth
, __entry
->status
2269 DECLARE_EVENT_CLASS(rpcrdma_client_device_class
,
2271 const struct ib_device
*device
2277 __string(name
, device
->name
)
2284 TP_printk("device=%s",
2289 #define DEFINE_CLIENT_DEVICE_EVENT(name) \
2290 DEFINE_EVENT(rpcrdma_client_device_class, name, \
2292 const struct ib_device *device \
2297 DEFINE_CLIENT_DEVICE_EVENT(rpcrdma_client_completion
);
2298 DEFINE_CLIENT_DEVICE_EVENT(rpcrdma_client_add_one
);
2299 DEFINE_CLIENT_DEVICE_EVENT(rpcrdma_client_remove_one
);
2300 DEFINE_CLIENT_DEVICE_EVENT(rpcrdma_client_wait_on
);
2301 DEFINE_CLIENT_DEVICE_EVENT(rpcrdma_client_remove_one_done
);
2303 DECLARE_EVENT_CLASS(rpcrdma_client_register_class
,
2305 const struct ib_device
*device
,
2306 const struct rpcrdma_notification
*rn
2309 TP_ARGS(device
, rn
),
2312 __string(name
, device
->name
)
2313 __field(void *, callback
)
2319 __entry
->callback
= rn
->rn_done
;
2320 __entry
->index
= rn
->rn_index
;
2323 TP_printk("device=%s index=%u done callback=%pS\n",
2324 __get_str(name
), __entry
->index
, __entry
->callback
2328 #define DEFINE_CLIENT_REGISTER_EVENT(name) \
2329 DEFINE_EVENT(rpcrdma_client_register_class, name, \
2331 const struct ib_device *device, \
2332 const struct rpcrdma_notification *rn \
2334 TP_ARGS(device, rn))
2336 DEFINE_CLIENT_REGISTER_EVENT(rpcrdma_client_register
);
2337 DEFINE_CLIENT_REGISTER_EVENT(rpcrdma_client_unregister
);
2339 #endif /* _TRACE_RPCRDMA_H */
2341 #include <trace/define_trace.h>