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/events/rdma.h>
19 #include <trace/events/sunrpc_base.h>
25 DECLARE_EVENT_CLASS(rpcrdma_completion_class,
27 const struct ib_wc *wc,
28 const struct rpc_rdma_cid *cid
35 __field(int, completion_id)
36 __field(unsigned long, status)
37 __field(unsigned int, vendor_err)
41 __entry->cq_id = cid->ci_queue_id;
42 __entry->completion_id = cid->ci_completion_id;
43 __entry->status = wc->status;
45 __entry->vendor_err = wc->vendor_err;
47 __entry->vendor_err = 0;
50 TP_printk("cq.id=%u cid=%d status=%s (%lu/0x%x)",
51 __entry->cq_id, __entry->completion_id,
52 rdma_show_wc_status(__entry->status),
53 __entry->status, __entry->vendor_err
57 #define DEFINE_COMPLETION_EVENT(name) \
58 DEFINE_EVENT(rpcrdma_completion_class, name, \
60 const struct ib_wc *wc, \
61 const struct rpc_rdma_cid *cid \
65 DECLARE_EVENT_CLASS(rpcrdma_send_completion_class,
67 const struct ib_wc *wc,
68 const struct rpc_rdma_cid *cid
75 __field(int, completion_id)
79 __entry->cq_id = cid->ci_queue_id;
80 __entry->completion_id = cid->ci_completion_id;
83 TP_printk("cq.id=%u cid=%d",
84 __entry->cq_id, __entry->completion_id
88 #define DEFINE_SEND_COMPLETION_EVENT(name) \
89 DEFINE_EVENT(rpcrdma_send_completion_class, name, \
91 const struct ib_wc *wc, \
92 const struct rpc_rdma_cid *cid \
96 DECLARE_EVENT_CLASS(rpcrdma_send_flush_class,
98 const struct ib_wc *wc,
99 const struct rpc_rdma_cid *cid
106 __field(int, completion_id)
107 __field(unsigned long, status)
108 __field(unsigned int, vendor_err)
112 __entry->cq_id = cid->ci_queue_id;
113 __entry->completion_id = cid->ci_completion_id;
114 __entry->status = wc->status;
115 __entry->vendor_err = wc->vendor_err;
118 TP_printk("cq.id=%u cid=%d status=%s (%lu/0x%x)",
119 __entry->cq_id, __entry->completion_id,
120 rdma_show_wc_status(__entry->status),
121 __entry->status, __entry->vendor_err
125 #define DEFINE_SEND_FLUSH_EVENT(name) \
126 DEFINE_EVENT(rpcrdma_send_flush_class, name, \
128 const struct ib_wc *wc, \
129 const struct rpc_rdma_cid *cid \
133 DECLARE_EVENT_CLASS(rpcrdma_mr_completion_class,
135 const struct ib_wc *wc,
136 const struct rpc_rdma_cid *cid
143 __field(int, completion_id)
144 __field(unsigned long, status)
145 __field(unsigned int, vendor_err)
149 __entry->cq_id = cid->ci_queue_id;
150 __entry->completion_id = cid->ci_completion_id;
151 __entry->status = wc->status;
153 __entry->vendor_err = wc->vendor_err;
155 __entry->vendor_err = 0;
158 TP_printk("cq.id=%u mr.id=%d status=%s (%lu/0x%x)",
159 __entry->cq_id, __entry->completion_id,
160 rdma_show_wc_status(__entry->status),
161 __entry->status, __entry->vendor_err
165 #define DEFINE_MR_COMPLETION_EVENT(name) \
166 DEFINE_EVENT(rpcrdma_mr_completion_class, name, \
168 const struct ib_wc *wc, \
169 const struct rpc_rdma_cid *cid \
173 DECLARE_EVENT_CLASS(rpcrdma_receive_completion_class,
175 const struct ib_wc *wc,
176 const struct rpc_rdma_cid *cid
183 __field(int, completion_id)
184 __field(u32, received)
185 __field(unsigned long, status)
186 __field(unsigned int, vendor_err)
190 __entry->cq_id = cid->ci_queue_id;
191 __entry->completion_id = cid->ci_completion_id;
192 __entry->status = wc->status;
194 __entry->received = 0;
195 __entry->vendor_err = wc->vendor_err;
197 __entry->received = wc->byte_len;
198 __entry->vendor_err = 0;
202 TP_printk("cq.id=%u cid=%d status=%s (%lu/0x%x) received=%u",
203 __entry->cq_id, __entry->completion_id,
204 rdma_show_wc_status(__entry->status),
205 __entry->status, __entry->vendor_err,
210 #define DEFINE_RECEIVE_COMPLETION_EVENT(name) \
211 DEFINE_EVENT(rpcrdma_receive_completion_class, name, \
213 const struct ib_wc *wc, \
214 const struct rpc_rdma_cid *cid \
218 DECLARE_EVENT_CLASS(rpcrdma_receive_success_class,
220 const struct ib_wc *wc,
221 const struct rpc_rdma_cid *cid
228 __field(int, completion_id)
229 __field(u32, received)
233 __entry->cq_id = cid->ci_queue_id;
234 __entry->completion_id = cid->ci_completion_id;
235 __entry->received = wc->byte_len;
238 TP_printk("cq.id=%u cid=%d received=%u",
239 __entry->cq_id, __entry->completion_id,
244 #define DEFINE_RECEIVE_SUCCESS_EVENT(name) \
245 DEFINE_EVENT(rpcrdma_receive_success_class, name, \
247 const struct ib_wc *wc, \
248 const struct rpc_rdma_cid *cid \
252 DECLARE_EVENT_CLASS(rpcrdma_receive_flush_class,
254 const struct ib_wc *wc,
255 const struct rpc_rdma_cid *cid
262 __field(int, completion_id)
263 __field(unsigned long, status)
264 __field(unsigned int, vendor_err)
268 __entry->cq_id = cid->ci_queue_id;
269 __entry->completion_id = cid->ci_completion_id;
270 __entry->status = wc->status;
271 __entry->vendor_err = wc->vendor_err;
274 TP_printk("cq.id=%u cid=%d status=%s (%lu/0x%x)",
275 __entry->cq_id, __entry->completion_id,
276 rdma_show_wc_status(__entry->status),
277 __entry->status, __entry->vendor_err
281 #define DEFINE_RECEIVE_FLUSH_EVENT(name) \
282 DEFINE_EVENT(rpcrdma_receive_flush_class, name, \
284 const struct ib_wc *wc, \
285 const struct rpc_rdma_cid *cid \
289 DECLARE_EVENT_CLASS(xprtrdma_reply_class,
291 const struct rpcrdma_rep *rep
298 __field(u32, version)
300 __string(addr, rpcrdma_addrstr(rep->rr_rxprt))
301 __string(port, rpcrdma_portstr(rep->rr_rxprt))
305 __entry->xid = be32_to_cpu(rep->rr_xid);
306 __entry->version = be32_to_cpu(rep->rr_vers);
307 __entry->proc = be32_to_cpu(rep->rr_proc);
308 __assign_str(addr, rpcrdma_addrstr(rep->rr_rxprt));
309 __assign_str(port, rpcrdma_portstr(rep->rr_rxprt));
312 TP_printk("peer=[%s]:%s xid=0x%08x version=%u proc=%u",
313 __get_str(addr), __get_str(port),
314 __entry->xid, __entry->version, __entry->proc
318 #define DEFINE_REPLY_EVENT(name) \
319 DEFINE_EVENT(xprtrdma_reply_class, \
320 xprtrdma_reply_##name##_err, \
322 const struct rpcrdma_rep *rep \
326 DECLARE_EVENT_CLASS(xprtrdma_rxprt,
328 const struct rpcrdma_xprt *r_xprt
334 __string(addr, rpcrdma_addrstr(r_xprt))
335 __string(port, rpcrdma_portstr(r_xprt))
339 __assign_str(addr, rpcrdma_addrstr(r_xprt));
340 __assign_str(port, rpcrdma_portstr(r_xprt));
343 TP_printk("peer=[%s]:%s",
344 __get_str(addr), __get_str(port)
348 #define DEFINE_RXPRT_EVENT(name) \
349 DEFINE_EVENT(xprtrdma_rxprt, name, \
351 const struct rpcrdma_xprt *r_xprt \
355 DECLARE_EVENT_CLASS(xprtrdma_connect_class,
357 const struct rpcrdma_xprt *r_xprt,
365 __field(int, connect_status)
366 __string(addr, rpcrdma_addrstr(r_xprt))
367 __string(port, rpcrdma_portstr(r_xprt))
372 __entry->connect_status = r_xprt->rx_ep->re_connect_status;
373 __assign_str(addr, rpcrdma_addrstr(r_xprt));
374 __assign_str(port, rpcrdma_portstr(r_xprt));
377 TP_printk("peer=[%s]:%s rc=%d connection status=%d",
378 __get_str(addr), __get_str(port),
379 __entry->rc, __entry->connect_status
383 #define DEFINE_CONN_EVENT(name) \
384 DEFINE_EVENT(xprtrdma_connect_class, xprtrdma_##name, \
386 const struct rpcrdma_xprt *r_xprt, \
391 DECLARE_EVENT_CLASS(xprtrdma_rdch_event,
393 const struct rpc_task *task,
395 struct rpcrdma_mr *mr,
399 TP_ARGS(task, pos, mr, nsegs),
402 __field(unsigned int, task_id)
403 __field(unsigned int, client_id)
404 __field(unsigned int, pos)
413 __entry->task_id = task->tk_pid;
414 __entry->client_id = task->tk_client->cl_clid;
416 __entry->nents = mr->mr_nents;
417 __entry->handle = mr->mr_handle;
418 __entry->length = mr->mr_length;
419 __entry->offset = mr->mr_offset;
420 __entry->nsegs = nsegs;
423 TP_printk(SUNRPC_TRACE_TASK_SPECIFIER
424 " pos=%u %u@0x%016llx:0x%08x (%s)",
425 __entry->task_id, __entry->client_id,
426 __entry->pos, __entry->length,
427 (unsigned long long)__entry->offset, __entry->handle,
428 __entry->nents < __entry->nsegs ? "more" : "last"
432 #define DEFINE_RDCH_EVENT(name) \
433 DEFINE_EVENT(xprtrdma_rdch_event, xprtrdma_chunk_##name,\
435 const struct rpc_task *task, \
437 struct rpcrdma_mr *mr, \
440 TP_ARGS(task, pos, mr, nsegs))
442 DECLARE_EVENT_CLASS(xprtrdma_wrch_event,
444 const struct rpc_task *task,
445 struct rpcrdma_mr *mr,
449 TP_ARGS(task, mr, nsegs),
452 __field(unsigned int, task_id)
453 __field(unsigned int, client_id)
462 __entry->task_id = task->tk_pid;
463 __entry->client_id = task->tk_client->cl_clid;
464 __entry->nents = mr->mr_nents;
465 __entry->handle = mr->mr_handle;
466 __entry->length = mr->mr_length;
467 __entry->offset = mr->mr_offset;
468 __entry->nsegs = nsegs;
471 TP_printk(SUNRPC_TRACE_TASK_SPECIFIER
472 " %u@0x%016llx:0x%08x (%s)",
473 __entry->task_id, __entry->client_id,
474 __entry->length, (unsigned long long)__entry->offset,
476 __entry->nents < __entry->nsegs ? "more" : "last"
480 #define DEFINE_WRCH_EVENT(name) \
481 DEFINE_EVENT(xprtrdma_wrch_event, xprtrdma_chunk_##name,\
483 const struct rpc_task *task, \
484 struct rpcrdma_mr *mr, \
487 TP_ARGS(task, mr, nsegs))
489 TRACE_DEFINE_ENUM(DMA_BIDIRECTIONAL);
490 TRACE_DEFINE_ENUM(DMA_TO_DEVICE);
491 TRACE_DEFINE_ENUM(DMA_FROM_DEVICE);
492 TRACE_DEFINE_ENUM(DMA_NONE);
494 #define xprtrdma_show_direction(x) \
495 __print_symbolic(x, \
496 { DMA_BIDIRECTIONAL, "BIDIR" }, \
497 { DMA_TO_DEVICE, "TO_DEVICE" }, \
498 { DMA_FROM_DEVICE, "FROM_DEVICE" }, \
499 { DMA_NONE, "NONE" })
501 DECLARE_EVENT_CLASS(xprtrdma_mr_class,
503 const struct rpcrdma_mr *mr
509 __field(unsigned int, task_id)
510 __field(unsigned int, client_id)
520 const struct rpcrdma_req *req = mr->mr_req;
523 const struct rpc_task *task = req->rl_slot.rq_task;
525 __entry->task_id = task->tk_pid;
526 __entry->client_id = task->tk_client->cl_clid;
528 __entry->task_id = 0;
529 __entry->client_id = -1;
531 __entry->mr_id = mr->mr_ibmr->res.id;
532 __entry->nents = mr->mr_nents;
533 __entry->handle = mr->mr_handle;
534 __entry->length = mr->mr_length;
535 __entry->offset = mr->mr_offset;
536 __entry->dir = mr->mr_dir;
539 TP_printk(SUNRPC_TRACE_TASK_SPECIFIER
540 " mr.id=%u nents=%d %u@0x%016llx:0x%08x (%s)",
541 __entry->task_id, __entry->client_id,
542 __entry->mr_id, __entry->nents, __entry->length,
543 (unsigned long long)__entry->offset, __entry->handle,
544 xprtrdma_show_direction(__entry->dir)
548 #define DEFINE_MR_EVENT(name) \
549 DEFINE_EVENT(xprtrdma_mr_class, \
550 xprtrdma_mr_##name, \
552 const struct rpcrdma_mr *mr \
556 DECLARE_EVENT_CLASS(xprtrdma_anonymous_mr_class,
558 const struct rpcrdma_mr *mr
573 __entry->mr_id = mr->mr_ibmr->res.id;
574 __entry->nents = mr->mr_nents;
575 __entry->handle = mr->mr_handle;
576 __entry->length = mr->mr_length;
577 __entry->offset = mr->mr_offset;
578 __entry->dir = mr->mr_dir;
581 TP_printk("mr.id=%u nents=%d %u@0x%016llx:0x%08x (%s)",
582 __entry->mr_id, __entry->nents, __entry->length,
583 (unsigned long long)__entry->offset, __entry->handle,
584 xprtrdma_show_direction(__entry->dir)
588 #define DEFINE_ANON_MR_EVENT(name) \
589 DEFINE_EVENT(xprtrdma_anonymous_mr_class, \
590 xprtrdma_mr_##name, \
592 const struct rpcrdma_mr *mr \
596 DECLARE_EVENT_CLASS(xprtrdma_callback_class,
598 const struct rpcrdma_xprt *r_xprt,
599 const struct rpc_rqst *rqst
602 TP_ARGS(r_xprt, rqst),
606 __string(addr, rpcrdma_addrstr(r_xprt))
607 __string(port, rpcrdma_portstr(r_xprt))
611 __entry->xid = be32_to_cpu(rqst->rq_xid);
612 __assign_str(addr, rpcrdma_addrstr(r_xprt));
613 __assign_str(port, rpcrdma_portstr(r_xprt));
616 TP_printk("peer=[%s]:%s xid=0x%08x",
617 __get_str(addr), __get_str(port), __entry->xid
621 #define DEFINE_CALLBACK_EVENT(name) \
622 DEFINE_EVENT(xprtrdma_callback_class, \
623 xprtrdma_cb_##name, \
625 const struct rpcrdma_xprt *r_xprt, \
626 const struct rpc_rqst *rqst \
628 TP_ARGS(r_xprt, rqst))
634 TRACE_EVENT(xprtrdma_inline_thresh,
636 const struct rpcrdma_ep *ep
642 __field(unsigned int, inline_send)
643 __field(unsigned int, inline_recv)
644 __field(unsigned int, max_send)
645 __field(unsigned int, max_recv)
646 __array(unsigned char, srcaddr, sizeof(struct sockaddr_in6))
647 __array(unsigned char, dstaddr, sizeof(struct sockaddr_in6))
651 const struct rdma_cm_id *id = ep->re_id;
653 __entry->inline_send = ep->re_inline_send;
654 __entry->inline_recv = ep->re_inline_recv;
655 __entry->max_send = ep->re_max_inline_send;
656 __entry->max_recv = ep->re_max_inline_recv;
657 memcpy(__entry->srcaddr, &id->route.addr.src_addr,
658 sizeof(struct sockaddr_in6));
659 memcpy(__entry->dstaddr, &id->route.addr.dst_addr,
660 sizeof(struct sockaddr_in6));
663 TP_printk("%pISpc -> %pISpc neg send/recv=%u/%u, calc send/recv=%u/%u",
664 __entry->srcaddr, __entry->dstaddr,
665 __entry->inline_send, __entry->inline_recv,
666 __entry->max_send, __entry->max_recv
670 DEFINE_CONN_EVENT(connect);
671 DEFINE_CONN_EVENT(disconnect);
673 DEFINE_RXPRT_EVENT(xprtrdma_op_inject_dsc);
675 TRACE_EVENT(xprtrdma_op_connect,
677 const struct rpcrdma_xprt *r_xprt,
681 TP_ARGS(r_xprt, delay),
684 __field(unsigned long, delay)
685 __string(addr, rpcrdma_addrstr(r_xprt))
686 __string(port, rpcrdma_portstr(r_xprt))
690 __entry->delay = delay;
691 __assign_str(addr, rpcrdma_addrstr(r_xprt));
692 __assign_str(port, rpcrdma_portstr(r_xprt));
695 TP_printk("peer=[%s]:%s delay=%lu",
696 __get_str(addr), __get_str(port), __entry->delay
701 TRACE_EVENT(xprtrdma_op_set_cto,
703 const struct rpcrdma_xprt *r_xprt,
704 unsigned long connect,
705 unsigned long reconnect
708 TP_ARGS(r_xprt, connect, reconnect),
711 __field(unsigned long, connect)
712 __field(unsigned long, reconnect)
713 __string(addr, rpcrdma_addrstr(r_xprt))
714 __string(port, rpcrdma_portstr(r_xprt))
718 __entry->connect = connect;
719 __entry->reconnect = reconnect;
720 __assign_str(addr, rpcrdma_addrstr(r_xprt));
721 __assign_str(port, rpcrdma_portstr(r_xprt));
724 TP_printk("peer=[%s]:%s connect=%lu reconnect=%lu",
725 __get_str(addr), __get_str(port),
726 __entry->connect / HZ, __entry->reconnect / HZ
734 TRACE_EVENT(xprtrdma_createmrs,
736 const struct rpcrdma_xprt *r_xprt,
740 TP_ARGS(r_xprt, count),
743 __string(addr, rpcrdma_addrstr(r_xprt))
744 __string(port, rpcrdma_portstr(r_xprt))
745 __field(unsigned int, count)
749 __entry->count = count;
750 __assign_str(addr, rpcrdma_addrstr(r_xprt));
751 __assign_str(port, rpcrdma_portstr(r_xprt));
754 TP_printk("peer=[%s]:%s created %u MRs",
755 __get_str(addr), __get_str(port), __entry->count
759 TRACE_EVENT(xprtrdma_nomrs_err,
761 const struct rpcrdma_xprt *r_xprt,
762 const struct rpcrdma_req *req
765 TP_ARGS(r_xprt, req),
768 __field(unsigned int, task_id)
769 __field(unsigned int, client_id)
770 __string(addr, rpcrdma_addrstr(r_xprt))
771 __string(port, rpcrdma_portstr(r_xprt))
775 const struct rpc_rqst *rqst = &req->rl_slot;
777 __entry->task_id = rqst->rq_task->tk_pid;
778 __entry->client_id = rqst->rq_task->tk_client->cl_clid;
779 __assign_str(addr, rpcrdma_addrstr(r_xprt));
780 __assign_str(port, rpcrdma_portstr(r_xprt));
783 TP_printk(SUNRPC_TRACE_TASK_SPECIFIER " peer=[%s]:%s",
784 __entry->task_id, __entry->client_id,
785 __get_str(addr), __get_str(port)
789 DEFINE_RDCH_EVENT(read);
790 DEFINE_WRCH_EVENT(write);
791 DEFINE_WRCH_EVENT(reply);
792 DEFINE_WRCH_EVENT(wp);
794 TRACE_DEFINE_ENUM(rpcrdma_noch);
795 TRACE_DEFINE_ENUM(rpcrdma_noch_pullup);
796 TRACE_DEFINE_ENUM(rpcrdma_noch_mapped);
797 TRACE_DEFINE_ENUM(rpcrdma_readch);
798 TRACE_DEFINE_ENUM(rpcrdma_areadch);
799 TRACE_DEFINE_ENUM(rpcrdma_writech);
800 TRACE_DEFINE_ENUM(rpcrdma_replych);
802 #define xprtrdma_show_chunktype(x) \
803 __print_symbolic(x, \
804 { rpcrdma_noch, "inline" }, \
805 { rpcrdma_noch_pullup, "pullup" }, \
806 { rpcrdma_noch_mapped, "mapped" }, \
807 { rpcrdma_readch, "read list" }, \
808 { rpcrdma_areadch, "*read list" }, \
809 { rpcrdma_writech, "write list" }, \
810 { rpcrdma_replych, "reply chunk" })
812 TRACE_EVENT(xprtrdma_marshal,
814 const struct rpcrdma_req *req,
819 TP_ARGS(req, rtype, wtype),
822 __field(unsigned int, task_id)
823 __field(unsigned int, client_id)
825 __field(unsigned int, hdrlen)
826 __field(unsigned int, headlen)
827 __field(unsigned int, pagelen)
828 __field(unsigned int, taillen)
829 __field(unsigned int, rtype)
830 __field(unsigned int, wtype)
834 const struct rpc_rqst *rqst = &req->rl_slot;
836 __entry->task_id = rqst->rq_task->tk_pid;
837 __entry->client_id = rqst->rq_task->tk_client->cl_clid;
838 __entry->xid = be32_to_cpu(rqst->rq_xid);
839 __entry->hdrlen = req->rl_hdrbuf.len;
840 __entry->headlen = rqst->rq_snd_buf.head[0].iov_len;
841 __entry->pagelen = rqst->rq_snd_buf.page_len;
842 __entry->taillen = rqst->rq_snd_buf.tail[0].iov_len;
843 __entry->rtype = rtype;
844 __entry->wtype = wtype;
847 TP_printk(SUNRPC_TRACE_TASK_SPECIFIER
848 " xid=0x%08x hdr=%u xdr=%u/%u/%u %s/%s",
849 __entry->task_id, __entry->client_id, __entry->xid,
851 __entry->headlen, __entry->pagelen, __entry->taillen,
852 xprtrdma_show_chunktype(__entry->rtype),
853 xprtrdma_show_chunktype(__entry->wtype)
857 TRACE_EVENT(xprtrdma_marshal_failed,
858 TP_PROTO(const struct rpc_rqst *rqst,
865 __field(unsigned int, task_id)
866 __field(unsigned int, client_id)
872 __entry->task_id = rqst->rq_task->tk_pid;
873 __entry->client_id = rqst->rq_task->tk_client->cl_clid;
874 __entry->xid = be32_to_cpu(rqst->rq_xid);
878 TP_printk(SUNRPC_TRACE_TASK_SPECIFIER " xid=0x%08x ret=%d",
879 __entry->task_id, __entry->client_id, __entry->xid,
884 TRACE_EVENT(xprtrdma_prepsend_failed,
885 TP_PROTO(const struct rpc_rqst *rqst,
892 __field(unsigned int, task_id)
893 __field(unsigned int, client_id)
899 __entry->task_id = rqst->rq_task->tk_pid;
900 __entry->client_id = rqst->rq_task->tk_client->cl_clid;
901 __entry->xid = be32_to_cpu(rqst->rq_xid);
905 TP_printk(SUNRPC_TRACE_TASK_SPECIFIER " xid=0x%08x ret=%d",
906 __entry->task_id, __entry->client_id, __entry->xid,
911 TRACE_EVENT(xprtrdma_post_send,
913 const struct rpcrdma_req *req
920 __field(int, completion_id)
921 __field(unsigned int, task_id)
922 __field(unsigned int, client_id)
923 __field(int, num_sge)
924 __field(int, signaled)
928 const struct rpc_rqst *rqst = &req->rl_slot;
929 const struct rpcrdma_sendctx *sc = req->rl_sendctx;
931 __entry->cq_id = sc->sc_cid.ci_queue_id;
932 __entry->completion_id = sc->sc_cid.ci_completion_id;
933 __entry->task_id = rqst->rq_task->tk_pid;
934 __entry->client_id = rqst->rq_task->tk_client ?
935 rqst->rq_task->tk_client->cl_clid : -1;
936 __entry->num_sge = req->rl_wr.num_sge;
937 __entry->signaled = req->rl_wr.send_flags & IB_SEND_SIGNALED;
940 TP_printk(SUNRPC_TRACE_TASK_SPECIFIER " cq.id=%u cid=%d (%d SGE%s) %s",
941 __entry->task_id, __entry->client_id,
942 __entry->cq_id, __entry->completion_id,
943 __entry->num_sge, (__entry->num_sge == 1 ? "" : "s"),
944 (__entry->signaled ? "signaled" : "")
948 TRACE_EVENT(xprtrdma_post_send_err,
950 const struct rpcrdma_xprt *r_xprt,
951 const struct rpcrdma_req *req,
955 TP_ARGS(r_xprt, req, rc),
959 __field(unsigned int, task_id)
960 __field(unsigned int, client_id)
965 const struct rpc_rqst *rqst = &req->rl_slot;
966 const struct rpcrdma_ep *ep = r_xprt->rx_ep;
968 __entry->cq_id = ep ? ep->re_attr.recv_cq->res.id : 0;
969 __entry->task_id = rqst->rq_task->tk_pid;
970 __entry->client_id = rqst->rq_task->tk_client ?
971 rqst->rq_task->tk_client->cl_clid : -1;
975 TP_printk(SUNRPC_TRACE_TASK_SPECIFIER " cq.id=%u rc=%d",
976 __entry->task_id, __entry->client_id,
977 __entry->cq_id, __entry->rc
981 TRACE_EVENT(xprtrdma_post_recv,
983 const struct rpcrdma_rep *rep
990 __field(int, completion_id)
994 __entry->cq_id = rep->rr_cid.ci_queue_id;
995 __entry->completion_id = rep->rr_cid.ci_completion_id;
998 TP_printk("cq.id=%d cid=%d",
999 __entry->cq_id, __entry->completion_id
1003 TRACE_EVENT(xprtrdma_post_recvs,
1005 const struct rpcrdma_xprt *r_xprt,
1009 TP_ARGS(r_xprt, count),
1013 __field(unsigned int, count)
1014 __field(int, posted)
1015 __string(addr, rpcrdma_addrstr(r_xprt))
1016 __string(port, rpcrdma_portstr(r_xprt))
1020 const struct rpcrdma_ep *ep = r_xprt->rx_ep;
1022 __entry->cq_id = ep->re_attr.recv_cq->res.id;
1023 __entry->count = count;
1024 __entry->posted = ep->re_receive_count;
1025 __assign_str(addr, rpcrdma_addrstr(r_xprt));
1026 __assign_str(port, rpcrdma_portstr(r_xprt));
1029 TP_printk("peer=[%s]:%s cq.id=%d %u new recvs, %d active",
1030 __get_str(addr), __get_str(port), __entry->cq_id,
1031 __entry->count, __entry->posted
1035 TRACE_EVENT(xprtrdma_post_recvs_err,
1037 const struct rpcrdma_xprt *r_xprt,
1041 TP_ARGS(r_xprt, status),
1045 __field(int, status)
1046 __string(addr, rpcrdma_addrstr(r_xprt))
1047 __string(port, rpcrdma_portstr(r_xprt))
1051 const struct rpcrdma_ep *ep = r_xprt->rx_ep;
1053 __entry->cq_id = ep->re_attr.recv_cq->res.id;
1054 __entry->status = status;
1055 __assign_str(addr, rpcrdma_addrstr(r_xprt));
1056 __assign_str(port, rpcrdma_portstr(r_xprt));
1059 TP_printk("peer=[%s]:%s cq.id=%d rc=%d",
1060 __get_str(addr), __get_str(port), __entry->cq_id,
1065 TRACE_EVENT(xprtrdma_post_linv_err,
1067 const struct rpcrdma_req *req,
1071 TP_ARGS(req, status),
1074 __field(unsigned int, task_id)
1075 __field(unsigned int, client_id)
1076 __field(int, status)
1080 const struct rpc_task *task = req->rl_slot.rq_task;
1082 __entry->task_id = task->tk_pid;
1083 __entry->client_id = task->tk_client->cl_clid;
1084 __entry->status = status;
1087 TP_printk(SUNRPC_TRACE_TASK_SPECIFIER " status=%d",
1088 __entry->task_id, __entry->client_id, __entry->status
1093 ** Completion events
1096 DEFINE_RECEIVE_COMPLETION_EVENT(xprtrdma_wc_receive);
1098 DEFINE_COMPLETION_EVENT(xprtrdma_wc_send);
1099 DEFINE_MR_COMPLETION_EVENT(xprtrdma_wc_fastreg);
1100 DEFINE_MR_COMPLETION_EVENT(xprtrdma_wc_li);
1101 DEFINE_MR_COMPLETION_EVENT(xprtrdma_wc_li_wake);
1102 DEFINE_MR_COMPLETION_EVENT(xprtrdma_wc_li_done);
1104 TRACE_EVENT(xprtrdma_frwr_alloc,
1106 const struct rpcrdma_mr *mr,
1118 __entry->mr_id = mr->mr_ibmr->res.id;
1122 TP_printk("mr.id=%u: rc=%d",
1123 __entry->mr_id, __entry->rc
1127 TRACE_EVENT(xprtrdma_frwr_dereg,
1129 const struct rpcrdma_mr *mr,
1138 __field(u32, handle)
1139 __field(u32, length)
1140 __field(u64, offset)
1146 __entry->mr_id = mr->mr_ibmr->res.id;
1147 __entry->nents = mr->mr_nents;
1148 __entry->handle = mr->mr_handle;
1149 __entry->length = mr->mr_length;
1150 __entry->offset = mr->mr_offset;
1151 __entry->dir = mr->mr_dir;
1155 TP_printk("mr.id=%u nents=%d %u@0x%016llx:0x%08x (%s): rc=%d",
1156 __entry->mr_id, __entry->nents, __entry->length,
1157 (unsigned long long)__entry->offset, __entry->handle,
1158 xprtrdma_show_direction(__entry->dir),
1163 TRACE_EVENT(xprtrdma_frwr_sgerr,
1165 const struct rpcrdma_mr *mr,
1169 TP_ARGS(mr, sg_nents),
1179 __entry->mr_id = mr->mr_ibmr->res.id;
1180 __entry->addr = mr->mr_sg->dma_address;
1181 __entry->dir = mr->mr_dir;
1182 __entry->nents = sg_nents;
1185 TP_printk("mr.id=%u DMA addr=0x%llx (%s) sg_nents=%d",
1186 __entry->mr_id, __entry->addr,
1187 xprtrdma_show_direction(__entry->dir),
1192 TRACE_EVENT(xprtrdma_frwr_maperr,
1194 const struct rpcrdma_mr *mr,
1198 TP_ARGS(mr, num_mapped),
1204 __field(int, num_mapped)
1209 __entry->mr_id = mr->mr_ibmr->res.id;
1210 __entry->addr = mr->mr_sg->dma_address;
1211 __entry->dir = mr->mr_dir;
1212 __entry->num_mapped = num_mapped;
1213 __entry->nents = mr->mr_nents;
1216 TP_printk("mr.id=%u DMA addr=0x%llx (%s) nents=%d of %d",
1217 __entry->mr_id, __entry->addr,
1218 xprtrdma_show_direction(__entry->dir),
1219 __entry->num_mapped, __entry->nents
1223 DEFINE_MR_EVENT(fastreg);
1224 DEFINE_MR_EVENT(localinv);
1225 DEFINE_MR_EVENT(reminv);
1226 DEFINE_MR_EVENT(map);
1228 DEFINE_ANON_MR_EVENT(unmap);
1230 TRACE_EVENT(xprtrdma_dma_maperr,
1242 __entry->addr = addr;
1245 TP_printk("dma addr=0x%llx\n", __entry->addr)
1252 TRACE_EVENT(xprtrdma_reply,
1254 const struct rpc_task *task,
1255 const struct rpcrdma_rep *rep,
1256 unsigned int credits
1259 TP_ARGS(task, rep, credits),
1262 __field(unsigned int, task_id)
1263 __field(unsigned int, client_id)
1265 __field(unsigned int, credits)
1269 __entry->task_id = task->tk_pid;
1270 __entry->client_id = task->tk_client->cl_clid;
1271 __entry->xid = be32_to_cpu(rep->rr_xid);
1272 __entry->credits = credits;
1275 TP_printk(SUNRPC_TRACE_TASK_SPECIFIER " xid=0x%08x credits=%u",
1276 __entry->task_id, __entry->client_id, __entry->xid,
1281 DEFINE_REPLY_EVENT(vers);
1282 DEFINE_REPLY_EVENT(rqst);
1283 DEFINE_REPLY_EVENT(short);
1284 DEFINE_REPLY_EVENT(hdr);
1286 TRACE_EVENT(xprtrdma_err_vers,
1288 const struct rpc_rqst *rqst,
1293 TP_ARGS(rqst, min, max),
1296 __field(unsigned int, task_id)
1297 __field(unsigned int, client_id)
1304 __entry->task_id = rqst->rq_task->tk_pid;
1305 __entry->client_id = rqst->rq_task->tk_client->cl_clid;
1306 __entry->xid = be32_to_cpu(rqst->rq_xid);
1307 __entry->min = be32_to_cpup(min);
1308 __entry->max = be32_to_cpup(max);
1311 TP_printk(SUNRPC_TRACE_TASK_SPECIFIER " xid=0x%08x versions=[%u, %u]",
1312 __entry->task_id, __entry->client_id, __entry->xid,
1313 __entry->min, __entry->max
1317 TRACE_EVENT(xprtrdma_err_chunk,
1319 const struct rpc_rqst *rqst
1325 __field(unsigned int, task_id)
1326 __field(unsigned int, client_id)
1331 __entry->task_id = rqst->rq_task->tk_pid;
1332 __entry->client_id = rqst->rq_task->tk_client->cl_clid;
1333 __entry->xid = be32_to_cpu(rqst->rq_xid);
1336 TP_printk(SUNRPC_TRACE_TASK_SPECIFIER " xid=0x%08x",
1337 __entry->task_id, __entry->client_id, __entry->xid
1341 TRACE_EVENT(xprtrdma_err_unrecognized,
1343 const struct rpc_rqst *rqst,
1347 TP_ARGS(rqst, procedure),
1350 __field(unsigned int, task_id)
1351 __field(unsigned int, client_id)
1353 __field(u32, procedure)
1357 __entry->task_id = rqst->rq_task->tk_pid;
1358 __entry->client_id = rqst->rq_task->tk_client->cl_clid;
1359 __entry->procedure = be32_to_cpup(procedure);
1362 TP_printk(SUNRPC_TRACE_TASK_SPECIFIER " xid=0x%08x procedure=%u",
1363 __entry->task_id, __entry->client_id, __entry->xid,
1368 TRACE_EVENT(xprtrdma_fixup,
1370 const struct rpc_rqst *rqst,
1374 TP_ARGS(rqst, fixup),
1377 __field(unsigned int, task_id)
1378 __field(unsigned int, client_id)
1379 __field(unsigned long, fixup)
1380 __field(size_t, headlen)
1381 __field(unsigned int, pagelen)
1382 __field(size_t, taillen)
1386 __entry->task_id = rqst->rq_task->tk_pid;
1387 __entry->client_id = rqst->rq_task->tk_client->cl_clid;
1388 __entry->fixup = fixup;
1389 __entry->headlen = rqst->rq_rcv_buf.head[0].iov_len;
1390 __entry->pagelen = rqst->rq_rcv_buf.page_len;
1391 __entry->taillen = rqst->rq_rcv_buf.tail[0].iov_len;
1394 TP_printk(SUNRPC_TRACE_TASK_SPECIFIER " fixup=%lu xdr=%zu/%u/%zu",
1395 __entry->task_id, __entry->client_id, __entry->fixup,
1396 __entry->headlen, __entry->pagelen, __entry->taillen
1400 TRACE_EVENT(xprtrdma_decode_seg,
1407 TP_ARGS(handle, length, offset),
1410 __field(u32, handle)
1411 __field(u32, length)
1412 __field(u64, offset)
1416 __entry->handle = handle;
1417 __entry->length = length;
1418 __entry->offset = offset;
1421 TP_printk("%u@0x%016llx:0x%08x",
1422 __entry->length, (unsigned long long)__entry->offset,
1427 TRACE_EVENT(xprtrdma_mrs_zap,
1429 const struct rpc_task *task
1435 __field(unsigned int, task_id)
1436 __field(unsigned int, client_id)
1440 __entry->task_id = task->tk_pid;
1441 __entry->client_id = task->tk_client->cl_clid;
1444 TP_printk(SUNRPC_TRACE_TASK_SPECIFIER,
1445 __entry->task_id, __entry->client_id
1453 TRACE_EVENT(xprtrdma_cb_setup,
1455 const struct rpcrdma_xprt *r_xprt,
1459 TP_ARGS(r_xprt, reqs),
1462 __field(unsigned int, reqs)
1463 __string(addr, rpcrdma_addrstr(r_xprt))
1464 __string(port, rpcrdma_portstr(r_xprt))
1468 __entry->reqs = reqs;
1469 __assign_str(addr, rpcrdma_addrstr(r_xprt));
1470 __assign_str(port, rpcrdma_portstr(r_xprt));
1473 TP_printk("peer=[%s]:%s %u reqs",
1474 __get_str(addr), __get_str(port), __entry->reqs
1478 DEFINE_CALLBACK_EVENT(call);
1479 DEFINE_CALLBACK_EVENT(reply);
1482 ** Server-side RPC/RDMA events
1485 DECLARE_EVENT_CLASS(svcrdma_accept_class,
1487 const struct svcxprt_rdma *rdma,
1491 TP_ARGS(rdma, status),
1494 __field(long, status)
1495 __string(addr, rdma->sc_xprt.xpt_remotebuf)
1499 __entry->status = status;
1500 __assign_str(addr, rdma->sc_xprt.xpt_remotebuf);
1503 TP_printk("addr=%s status=%ld",
1504 __get_str(addr), __entry->status
1508 #define DEFINE_ACCEPT_EVENT(name) \
1509 DEFINE_EVENT(svcrdma_accept_class, svcrdma_##name##_err, \
1511 const struct svcxprt_rdma *rdma, \
1514 TP_ARGS(rdma, status))
1516 DEFINE_ACCEPT_EVENT(pd);
1517 DEFINE_ACCEPT_EVENT(qp);
1518 DEFINE_ACCEPT_EVENT(fabric);
1519 DEFINE_ACCEPT_EVENT(initdepth);
1520 DEFINE_ACCEPT_EVENT(accept);
1522 TRACE_DEFINE_ENUM(RDMA_MSG);
1523 TRACE_DEFINE_ENUM(RDMA_NOMSG);
1524 TRACE_DEFINE_ENUM(RDMA_MSGP);
1525 TRACE_DEFINE_ENUM(RDMA_DONE);
1526 TRACE_DEFINE_ENUM(RDMA_ERROR);
1528 #define show_rpcrdma_proc(x) \
1529 __print_symbolic(x, \
1530 { RDMA_MSG, "RDMA_MSG" }, \
1531 { RDMA_NOMSG, "RDMA_NOMSG" }, \
1532 { RDMA_MSGP, "RDMA_MSGP" }, \
1533 { RDMA_DONE, "RDMA_DONE" }, \
1534 { RDMA_ERROR, "RDMA_ERROR" })
1536 TRACE_EVENT(svcrdma_decode_rqst,
1538 const struct svc_rdma_recv_ctxt *ctxt,
1543 TP_ARGS(ctxt, p, hdrlen),
1547 __field(int, completion_id)
1551 __field(u32, credits)
1552 __field(unsigned int, hdrlen)
1556 __entry->cq_id = ctxt->rc_cid.ci_queue_id;
1557 __entry->completion_id = ctxt->rc_cid.ci_completion_id;
1558 __entry->xid = be32_to_cpup(p++);
1559 __entry->vers = be32_to_cpup(p++);
1560 __entry->credits = be32_to_cpup(p++);
1561 __entry->proc = be32_to_cpup(p);
1562 __entry->hdrlen = hdrlen;
1565 TP_printk("cq.id=%u cid=%d xid=0x%08x vers=%u credits=%u proc=%s hdrlen=%u",
1566 __entry->cq_id, __entry->completion_id,
1567 __entry->xid, __entry->vers, __entry->credits,
1568 show_rpcrdma_proc(__entry->proc), __entry->hdrlen)
1571 TRACE_EVENT(svcrdma_decode_short_err,
1573 const struct svc_rdma_recv_ctxt *ctxt,
1577 TP_ARGS(ctxt, hdrlen),
1581 __field(int, completion_id)
1582 __field(unsigned int, hdrlen)
1586 __entry->cq_id = ctxt->rc_cid.ci_queue_id;
1587 __entry->completion_id = ctxt->rc_cid.ci_completion_id;
1588 __entry->hdrlen = hdrlen;
1591 TP_printk("cq.id=%u cid=%d hdrlen=%u",
1592 __entry->cq_id, __entry->completion_id,
1596 DECLARE_EVENT_CLASS(svcrdma_badreq_event,
1598 const struct svc_rdma_recv_ctxt *ctxt,
1606 __field(int, completion_id)
1610 __field(u32, credits)
1614 __entry->cq_id = ctxt->rc_cid.ci_queue_id;
1615 __entry->completion_id = ctxt->rc_cid.ci_completion_id;
1616 __entry->xid = be32_to_cpup(p++);
1617 __entry->vers = be32_to_cpup(p++);
1618 __entry->credits = be32_to_cpup(p++);
1619 __entry->proc = be32_to_cpup(p);
1622 TP_printk("cq.id=%u cid=%d xid=0x%08x vers=%u credits=%u proc=%u",
1623 __entry->cq_id, __entry->completion_id,
1624 __entry->xid, __entry->vers, __entry->credits, __entry->proc)
1627 #define DEFINE_BADREQ_EVENT(name) \
1628 DEFINE_EVENT(svcrdma_badreq_event, \
1629 svcrdma_decode_##name##_err, \
1631 const struct svc_rdma_recv_ctxt *ctxt, \
1636 DEFINE_BADREQ_EVENT(badvers);
1637 DEFINE_BADREQ_EVENT(drop);
1638 DEFINE_BADREQ_EVENT(badproc);
1639 DEFINE_BADREQ_EVENT(parse);
1641 TRACE_EVENT(svcrdma_encode_wseg,
1643 const struct svc_rdma_send_ctxt *ctxt,
1650 TP_ARGS(ctxt, segno, handle, length, offset),
1654 __field(int, completion_id)
1656 __field(u32, handle)
1657 __field(u32, length)
1658 __field(u64, offset)
1662 __entry->cq_id = ctxt->sc_cid.ci_queue_id;
1663 __entry->completion_id = ctxt->sc_cid.ci_completion_id;
1664 __entry->segno = segno;
1665 __entry->handle = handle;
1666 __entry->length = length;
1667 __entry->offset = offset;
1670 TP_printk("cq_id=%u cid=%d segno=%u %u@0x%016llx:0x%08x",
1671 __entry->cq_id, __entry->completion_id,
1672 __entry->segno, __entry->length,
1673 (unsigned long long)__entry->offset, __entry->handle
1677 TRACE_EVENT(svcrdma_decode_rseg,
1679 const struct rpc_rdma_cid *cid,
1680 const struct svc_rdma_chunk *chunk,
1681 const struct svc_rdma_segment *segment
1684 TP_ARGS(cid, chunk, segment),
1688 __field(int, completion_id)
1690 __field(u32, position)
1691 __field(u32, handle)
1692 __field(u32, length)
1693 __field(u64, offset)
1697 __entry->cq_id = cid->ci_queue_id;
1698 __entry->completion_id = cid->ci_completion_id;
1699 __entry->segno = chunk->ch_segcount;
1700 __entry->position = chunk->ch_position;
1701 __entry->handle = segment->rs_handle;
1702 __entry->length = segment->rs_length;
1703 __entry->offset = segment->rs_offset;
1706 TP_printk("cq_id=%u cid=%d segno=%u position=%u %u@0x%016llx:0x%08x",
1707 __entry->cq_id, __entry->completion_id,
1708 __entry->segno, __entry->position, __entry->length,
1709 (unsigned long long)__entry->offset, __entry->handle
1713 TRACE_EVENT(svcrdma_decode_wseg,
1715 const struct rpc_rdma_cid *cid,
1716 const struct svc_rdma_chunk *chunk,
1720 TP_ARGS(cid, chunk, segno),
1724 __field(int, completion_id)
1726 __field(u32, handle)
1727 __field(u32, length)
1728 __field(u64, offset)
1732 const struct svc_rdma_segment *segment =
1733 &chunk->ch_segments[segno];
1735 __entry->cq_id = cid->ci_queue_id;
1736 __entry->completion_id = cid->ci_completion_id;
1737 __entry->segno = segno;
1738 __entry->handle = segment->rs_handle;
1739 __entry->length = segment->rs_length;
1740 __entry->offset = segment->rs_offset;
1743 TP_printk("cq_id=%u cid=%d segno=%u %u@0x%016llx:0x%08x",
1744 __entry->cq_id, __entry->completion_id,
1745 __entry->segno, __entry->length,
1746 (unsigned long long)__entry->offset, __entry->handle
1750 DECLARE_EVENT_CLASS(svcrdma_error_event,
1762 __entry->xid = be32_to_cpu(xid);
1765 TP_printk("xid=0x%08x",
1770 #define DEFINE_ERROR_EVENT(name) \
1771 DEFINE_EVENT(svcrdma_error_event, svcrdma_err_##name, \
1777 DEFINE_ERROR_EVENT(vers);
1778 DEFINE_ERROR_EVENT(chunk);
1781 ** Server-side RDMA API events
1784 DECLARE_EVENT_CLASS(svcrdma_dma_map_class,
1786 const struct svcxprt_rdma *rdma,
1791 TP_ARGS(rdma, dma_addr, length),
1794 __field(u64, dma_addr)
1795 __field(u32, length)
1796 __string(device, rdma->sc_cm_id->device->name)
1797 __string(addr, rdma->sc_xprt.xpt_remotebuf)
1801 __entry->dma_addr = dma_addr;
1802 __entry->length = length;
1803 __assign_str(device, rdma->sc_cm_id->device->name);
1804 __assign_str(addr, rdma->sc_xprt.xpt_remotebuf);
1807 TP_printk("addr=%s device=%s dma_addr=%llu length=%u",
1808 __get_str(addr), __get_str(device),
1809 __entry->dma_addr, __entry->length
1813 #define DEFINE_SVC_DMA_EVENT(name) \
1814 DEFINE_EVENT(svcrdma_dma_map_class, svcrdma_##name, \
1816 const struct svcxprt_rdma *rdma,\
1820 TP_ARGS(rdma, dma_addr, length))
1822 DEFINE_SVC_DMA_EVENT(dma_map_page);
1823 DEFINE_SVC_DMA_EVENT(dma_map_err);
1824 DEFINE_SVC_DMA_EVENT(dma_unmap_page);
1826 TRACE_EVENT(svcrdma_dma_map_rw_err,
1828 const struct svcxprt_rdma *rdma,
1833 TP_ARGS(rdma, nents, status),
1836 __field(int, status)
1837 __field(unsigned int, nents)
1838 __string(device, rdma->sc_cm_id->device->name)
1839 __string(addr, rdma->sc_xprt.xpt_remotebuf)
1843 __entry->status = status;
1844 __entry->nents = nents;
1845 __assign_str(device, rdma->sc_cm_id->device->name);
1846 __assign_str(addr, rdma->sc_xprt.xpt_remotebuf);
1849 TP_printk("addr=%s device=%s nents=%u status=%d",
1850 __get_str(addr), __get_str(device), __entry->nents,
1855 TRACE_EVENT(svcrdma_no_rwctx_err,
1857 const struct svcxprt_rdma *rdma,
1858 unsigned int num_sges
1861 TP_ARGS(rdma, num_sges),
1864 __field(unsigned int, num_sges)
1865 __string(device, rdma->sc_cm_id->device->name)
1866 __string(addr, rdma->sc_xprt.xpt_remotebuf)
1870 __entry->num_sges = num_sges;
1871 __assign_str(device, rdma->sc_cm_id->device->name);
1872 __assign_str(addr, rdma->sc_xprt.xpt_remotebuf);
1875 TP_printk("addr=%s device=%s num_sges=%d",
1876 __get_str(addr), __get_str(device), __entry->num_sges
1880 TRACE_EVENT(svcrdma_page_overrun_err,
1882 const struct svcxprt_rdma *rdma,
1883 const struct svc_rqst *rqst,
1887 TP_ARGS(rdma, rqst, pageno),
1890 __field(unsigned int, pageno)
1892 __string(device, rdma->sc_cm_id->device->name)
1893 __string(addr, rdma->sc_xprt.xpt_remotebuf)
1897 __entry->pageno = pageno;
1898 __entry->xid = __be32_to_cpu(rqst->rq_xid);
1899 __assign_str(device, rdma->sc_cm_id->device->name);
1900 __assign_str(addr, rdma->sc_xprt.xpt_remotebuf);
1903 TP_printk("addr=%s device=%s xid=0x%08x pageno=%u", __get_str(addr),
1904 __get_str(device), __entry->xid, __entry->pageno
1908 TRACE_EVENT(svcrdma_small_wrch_err,
1910 const struct svcxprt_rdma *rdma,
1911 unsigned int remaining,
1912 unsigned int seg_no,
1913 unsigned int num_segs
1916 TP_ARGS(rdma, remaining, seg_no, num_segs),
1919 __field(unsigned int, remaining)
1920 __field(unsigned int, seg_no)
1921 __field(unsigned int, num_segs)
1922 __string(device, rdma->sc_cm_id->device->name)
1923 __string(addr, rdma->sc_xprt.xpt_remotebuf)
1927 __entry->remaining = remaining;
1928 __entry->seg_no = seg_no;
1929 __entry->num_segs = num_segs;
1930 __assign_str(device, rdma->sc_cm_id->device->name);
1931 __assign_str(addr, rdma->sc_xprt.xpt_remotebuf);
1934 TP_printk("addr=%s device=%s remaining=%u seg_no=%u num_segs=%u",
1935 __get_str(addr), __get_str(device), __entry->remaining,
1936 __entry->seg_no, __entry->num_segs
1940 TRACE_EVENT(svcrdma_send_pullup,
1942 const struct svc_rdma_send_ctxt *ctxt,
1946 TP_ARGS(ctxt, msglen),
1950 __field(int, completion_id)
1951 __field(unsigned int, hdrlen)
1952 __field(unsigned int, msglen)
1956 __entry->cq_id = ctxt->sc_cid.ci_queue_id;
1957 __entry->completion_id = ctxt->sc_cid.ci_completion_id;
1958 __entry->hdrlen = ctxt->sc_hdrbuf.len,
1959 __entry->msglen = msglen;
1962 TP_printk("cq_id=%u cid=%d hdr=%u msg=%u (total %u)",
1963 __entry->cq_id, __entry->completion_id,
1964 __entry->hdrlen, __entry->msglen,
1965 __entry->hdrlen + __entry->msglen)
1968 TRACE_EVENT(svcrdma_send_err,
1970 const struct svc_rqst *rqst,
1974 TP_ARGS(rqst, status),
1977 __field(int, status)
1979 __string(addr, rqst->rq_xprt->xpt_remotebuf)
1983 __entry->status = status;
1984 __entry->xid = __be32_to_cpu(rqst->rq_xid);
1985 __assign_str(addr, rqst->rq_xprt->xpt_remotebuf);
1988 TP_printk("addr=%s xid=0x%08x status=%d", __get_str(addr),
1989 __entry->xid, __entry->status
1993 TRACE_EVENT(svcrdma_post_send,
1995 const struct svc_rdma_send_ctxt *ctxt
2002 __field(int, completion_id)
2003 __field(unsigned int, num_sge)
2004 __field(u32, inv_rkey)
2008 const struct ib_send_wr *wr = &ctxt->sc_send_wr;
2010 __entry->cq_id = ctxt->sc_cid.ci_queue_id;
2011 __entry->completion_id = ctxt->sc_cid.ci_completion_id;
2012 __entry->num_sge = wr->num_sge;
2013 __entry->inv_rkey = (wr->opcode == IB_WR_SEND_WITH_INV) ?
2014 wr->ex.invalidate_rkey : 0;
2017 TP_printk("cq_id=%u cid=%d num_sge=%u inv_rkey=0x%08x",
2018 __entry->cq_id, __entry->completion_id,
2019 __entry->num_sge, __entry->inv_rkey
2023 DEFINE_SEND_COMPLETION_EVENT(svcrdma_wc_send);
2024 DEFINE_SEND_FLUSH_EVENT(svcrdma_wc_send_flush);
2025 DEFINE_SEND_FLUSH_EVENT(svcrdma_wc_send_err);
2027 TRACE_EVENT(svcrdma_post_recv,
2029 const struct svc_rdma_recv_ctxt *ctxt
2036 __field(int, completion_id)
2040 __entry->cq_id = ctxt->rc_cid.ci_queue_id;
2041 __entry->completion_id = ctxt->rc_cid.ci_completion_id;
2044 TP_printk("cq.id=%d cid=%d",
2045 __entry->cq_id, __entry->completion_id
2049 DEFINE_RECEIVE_SUCCESS_EVENT(svcrdma_wc_recv);
2050 DEFINE_RECEIVE_FLUSH_EVENT(svcrdma_wc_recv_flush);
2051 DEFINE_RECEIVE_FLUSH_EVENT(svcrdma_wc_recv_err);
2053 TRACE_EVENT(svcrdma_rq_post_err,
2055 const struct svcxprt_rdma *rdma,
2059 TP_ARGS(rdma, status),
2062 __field(int, status)
2063 __string(addr, rdma->sc_xprt.xpt_remotebuf)
2067 __entry->status = status;
2068 __assign_str(addr, rdma->sc_xprt.xpt_remotebuf);
2071 TP_printk("addr=%s status=%d",
2072 __get_str(addr), __entry->status
2076 DECLARE_EVENT_CLASS(svcrdma_post_chunk_class,
2078 const struct rpc_rdma_cid *cid,
2082 TP_ARGS(cid, sqecount),
2086 __field(int, completion_id)
2087 __field(int, sqecount)
2091 __entry->cq_id = cid->ci_queue_id;
2092 __entry->completion_id = cid->ci_completion_id;
2093 __entry->sqecount = sqecount;
2096 TP_printk("cq.id=%u cid=%d sqecount=%d",
2097 __entry->cq_id, __entry->completion_id,
2102 #define DEFINE_POST_CHUNK_EVENT(name) \
2103 DEFINE_EVENT(svcrdma_post_chunk_class, \
2104 svcrdma_post_##name##_chunk, \
2106 const struct rpc_rdma_cid *cid, \
2109 TP_ARGS(cid, sqecount))
2111 DEFINE_POST_CHUNK_EVENT(read);
2112 DEFINE_POST_CHUNK_EVENT(write);
2113 DEFINE_POST_CHUNK_EVENT(reply);
2115 TRACE_EVENT(svcrdma_wc_read,
2117 const struct ib_wc *wc,
2118 const struct rpc_rdma_cid *cid,
2119 unsigned int totalbytes,
2120 const ktime_t posttime
2123 TP_ARGS(wc, cid, totalbytes, posttime),
2127 __field(int, completion_id)
2128 __field(s64, read_latency)
2129 __field(unsigned int, totalbytes)
2133 __entry->cq_id = cid->ci_queue_id;
2134 __entry->completion_id = cid->ci_completion_id;
2135 __entry->totalbytes = totalbytes;
2136 __entry->read_latency = ktime_us_delta(ktime_get(), posttime);
2139 TP_printk("cq.id=%u cid=%d totalbytes=%u latency-us=%lld",
2140 __entry->cq_id, __entry->completion_id,
2141 __entry->totalbytes, __entry->read_latency
2145 DEFINE_SEND_FLUSH_EVENT(svcrdma_wc_read_flush);
2146 DEFINE_SEND_FLUSH_EVENT(svcrdma_wc_read_err);
2148 DEFINE_SEND_COMPLETION_EVENT(svcrdma_wc_write);
2149 DEFINE_SEND_FLUSH_EVENT(svcrdma_wc_write_flush);
2150 DEFINE_SEND_FLUSH_EVENT(svcrdma_wc_write_err);
2152 TRACE_EVENT(svcrdma_qp_error,
2154 const struct ib_event *event,
2155 const struct sockaddr *sap
2158 TP_ARGS(event, sap),
2161 __field(unsigned int, event)
2162 __string(device, event->device->name)
2163 __array(__u8, addr, INET6_ADDRSTRLEN + 10)
2167 __entry->event = event->event;
2168 __assign_str(device, event->device->name);
2169 snprintf(__entry->addr, sizeof(__entry->addr) - 1,
2173 TP_printk("addr=%s dev=%s event=%s (%u)",
2174 __entry->addr, __get_str(device),
2175 rdma_show_ib_event(__entry->event), __entry->event
2179 DECLARE_EVENT_CLASS(svcrdma_sendqueue_event,
2181 const struct svcxprt_rdma *rdma
2189 __string(addr, rdma->sc_xprt.xpt_remotebuf)
2193 __entry->avail = atomic_read(&rdma->sc_sq_avail);
2194 __entry->depth = rdma->sc_sq_depth;
2195 __assign_str(addr, rdma->sc_xprt.xpt_remotebuf);
2198 TP_printk("addr=%s sc_sq_avail=%d/%d",
2199 __get_str(addr), __entry->avail, __entry->depth
2203 #define DEFINE_SQ_EVENT(name) \
2204 DEFINE_EVENT(svcrdma_sendqueue_event, svcrdma_sq_##name,\
2206 const struct svcxprt_rdma *rdma \
2210 DEFINE_SQ_EVENT(full);
2211 DEFINE_SQ_EVENT(retry);
2213 TRACE_EVENT(svcrdma_sq_post_err,
2215 const struct svcxprt_rdma *rdma,
2219 TP_ARGS(rdma, status),
2224 __field(int, status)
2225 __string(addr, rdma->sc_xprt.xpt_remotebuf)
2229 __entry->avail = atomic_read(&rdma->sc_sq_avail);
2230 __entry->depth = rdma->sc_sq_depth;
2231 __entry->status = status;
2232 __assign_str(addr, rdma->sc_xprt.xpt_remotebuf);
2235 TP_printk("addr=%s sc_sq_avail=%d/%d status=%d",
2236 __get_str(addr), __entry->avail, __entry->depth,
2241 #endif /* _TRACE_RPCRDMA_H */
2243 #include <trace/define_trace.h>