i2c: mxs: use MXS_DMA_CTRL_WAIT4END instead of DMA_CTRL_ACK
[linux/fpc-iii.git] / include / trace / events / rpcrdma.h
blob2464311b03896602b35daa2ce13ea33db97abc9c
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3 * Copyright (c) 2017, 2018 Oracle. All rights reserved.
5 * Trace point definitions for the "rpcrdma" subsystem.
6 */
7 #undef TRACE_SYSTEM
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/tracepoint.h>
15 #include <trace/events/rdma.h>
17 /**
18 ** Event classes
19 **/
21 DECLARE_EVENT_CLASS(xprtrdma_reply_event,
22 TP_PROTO(
23 const struct rpcrdma_rep *rep
26 TP_ARGS(rep),
28 TP_STRUCT__entry(
29 __field(const void *, rep)
30 __field(const void *, r_xprt)
31 __field(u32, xid)
32 __field(u32, version)
33 __field(u32, proc)
36 TP_fast_assign(
37 __entry->rep = rep;
38 __entry->r_xprt = rep->rr_rxprt;
39 __entry->xid = be32_to_cpu(rep->rr_xid);
40 __entry->version = be32_to_cpu(rep->rr_vers);
41 __entry->proc = be32_to_cpu(rep->rr_proc);
44 TP_printk("rxprt %p xid=0x%08x rep=%p: version %u proc %u",
45 __entry->r_xprt, __entry->xid, __entry->rep,
46 __entry->version, __entry->proc
50 #define DEFINE_REPLY_EVENT(name) \
51 DEFINE_EVENT(xprtrdma_reply_event, name, \
52 TP_PROTO( \
53 const struct rpcrdma_rep *rep \
54 ), \
55 TP_ARGS(rep))
57 DECLARE_EVENT_CLASS(xprtrdma_rxprt,
58 TP_PROTO(
59 const struct rpcrdma_xprt *r_xprt
62 TP_ARGS(r_xprt),
64 TP_STRUCT__entry(
65 __field(const void *, r_xprt)
66 __string(addr, rpcrdma_addrstr(r_xprt))
67 __string(port, rpcrdma_portstr(r_xprt))
70 TP_fast_assign(
71 __entry->r_xprt = r_xprt;
72 __assign_str(addr, rpcrdma_addrstr(r_xprt));
73 __assign_str(port, rpcrdma_portstr(r_xprt));
76 TP_printk("peer=[%s]:%s r_xprt=%p",
77 __get_str(addr), __get_str(port), __entry->r_xprt
81 #define DEFINE_RXPRT_EVENT(name) \
82 DEFINE_EVENT(xprtrdma_rxprt, name, \
83 TP_PROTO( \
84 const struct rpcrdma_xprt *r_xprt \
85 ), \
86 TP_ARGS(r_xprt))
88 DECLARE_EVENT_CLASS(xprtrdma_rdch_event,
89 TP_PROTO(
90 const struct rpc_task *task,
91 unsigned int pos,
92 struct rpcrdma_mr *mr,
93 int nsegs
96 TP_ARGS(task, pos, mr, nsegs),
98 TP_STRUCT__entry(
99 __field(unsigned int, task_id)
100 __field(unsigned int, client_id)
101 __field(unsigned int, pos)
102 __field(int, nents)
103 __field(u32, handle)
104 __field(u32, length)
105 __field(u64, offset)
106 __field(int, nsegs)
109 TP_fast_assign(
110 __entry->task_id = task->tk_pid;
111 __entry->client_id = task->tk_client->cl_clid;
112 __entry->pos = pos;
113 __entry->nents = mr->mr_nents;
114 __entry->handle = mr->mr_handle;
115 __entry->length = mr->mr_length;
116 __entry->offset = mr->mr_offset;
117 __entry->nsegs = nsegs;
120 TP_printk("task:%u@%u pos=%u %u@0x%016llx:0x%08x (%s)",
121 __entry->task_id, __entry->client_id,
122 __entry->pos, __entry->length,
123 (unsigned long long)__entry->offset, __entry->handle,
124 __entry->nents < __entry->nsegs ? "more" : "last"
128 #define DEFINE_RDCH_EVENT(name) \
129 DEFINE_EVENT(xprtrdma_rdch_event, xprtrdma_chunk_##name,\
130 TP_PROTO( \
131 const struct rpc_task *task, \
132 unsigned int pos, \
133 struct rpcrdma_mr *mr, \
134 int nsegs \
135 ), \
136 TP_ARGS(task, pos, mr, nsegs))
138 DECLARE_EVENT_CLASS(xprtrdma_wrch_event,
139 TP_PROTO(
140 const struct rpc_task *task,
141 struct rpcrdma_mr *mr,
142 int nsegs
145 TP_ARGS(task, mr, nsegs),
147 TP_STRUCT__entry(
148 __field(unsigned int, task_id)
149 __field(unsigned int, client_id)
150 __field(int, nents)
151 __field(u32, handle)
152 __field(u32, length)
153 __field(u64, offset)
154 __field(int, nsegs)
157 TP_fast_assign(
158 __entry->task_id = task->tk_pid;
159 __entry->client_id = task->tk_client->cl_clid;
160 __entry->nents = mr->mr_nents;
161 __entry->handle = mr->mr_handle;
162 __entry->length = mr->mr_length;
163 __entry->offset = mr->mr_offset;
164 __entry->nsegs = nsegs;
167 TP_printk("task:%u@%u %u@0x%016llx:0x%08x (%s)",
168 __entry->task_id, __entry->client_id,
169 __entry->length, (unsigned long long)__entry->offset,
170 __entry->handle,
171 __entry->nents < __entry->nsegs ? "more" : "last"
175 #define DEFINE_WRCH_EVENT(name) \
176 DEFINE_EVENT(xprtrdma_wrch_event, xprtrdma_chunk_##name,\
177 TP_PROTO( \
178 const struct rpc_task *task, \
179 struct rpcrdma_mr *mr, \
180 int nsegs \
181 ), \
182 TP_ARGS(task, mr, nsegs))
184 DECLARE_EVENT_CLASS(xprtrdma_frwr_done,
185 TP_PROTO(
186 const struct ib_wc *wc,
187 const struct rpcrdma_frwr *frwr
190 TP_ARGS(wc, frwr),
192 TP_STRUCT__entry(
193 __field(const void *, mr)
194 __field(unsigned int, status)
195 __field(unsigned int, vendor_err)
198 TP_fast_assign(
199 __entry->mr = container_of(frwr, struct rpcrdma_mr, frwr);
200 __entry->status = wc->status;
201 __entry->vendor_err = __entry->status ? wc->vendor_err : 0;
204 TP_printk(
205 "mr=%p: %s (%u/0x%x)",
206 __entry->mr, rdma_show_wc_status(__entry->status),
207 __entry->status, __entry->vendor_err
211 #define DEFINE_FRWR_DONE_EVENT(name) \
212 DEFINE_EVENT(xprtrdma_frwr_done, name, \
213 TP_PROTO( \
214 const struct ib_wc *wc, \
215 const struct rpcrdma_frwr *frwr \
216 ), \
217 TP_ARGS(wc, frwr))
219 TRACE_DEFINE_ENUM(DMA_BIDIRECTIONAL);
220 TRACE_DEFINE_ENUM(DMA_TO_DEVICE);
221 TRACE_DEFINE_ENUM(DMA_FROM_DEVICE);
222 TRACE_DEFINE_ENUM(DMA_NONE);
224 #define xprtrdma_show_direction(x) \
225 __print_symbolic(x, \
226 { DMA_BIDIRECTIONAL, "BIDIR" }, \
227 { DMA_TO_DEVICE, "TO_DEVICE" }, \
228 { DMA_FROM_DEVICE, "FROM_DEVICE" }, \
229 { DMA_NONE, "NONE" })
231 DECLARE_EVENT_CLASS(xprtrdma_mr,
232 TP_PROTO(
233 const struct rpcrdma_mr *mr
236 TP_ARGS(mr),
238 TP_STRUCT__entry(
239 __field(const void *, mr)
240 __field(u32, handle)
241 __field(u32, length)
242 __field(u64, offset)
243 __field(u32, dir)
246 TP_fast_assign(
247 __entry->mr = mr;
248 __entry->handle = mr->mr_handle;
249 __entry->length = mr->mr_length;
250 __entry->offset = mr->mr_offset;
251 __entry->dir = mr->mr_dir;
254 TP_printk("mr=%p %u@0x%016llx:0x%08x (%s)",
255 __entry->mr, __entry->length,
256 (unsigned long long)__entry->offset, __entry->handle,
257 xprtrdma_show_direction(__entry->dir)
261 #define DEFINE_MR_EVENT(name) \
262 DEFINE_EVENT(xprtrdma_mr, xprtrdma_mr_##name, \
263 TP_PROTO( \
264 const struct rpcrdma_mr *mr \
265 ), \
266 TP_ARGS(mr))
268 DECLARE_EVENT_CLASS(xprtrdma_cb_event,
269 TP_PROTO(
270 const struct rpc_rqst *rqst
273 TP_ARGS(rqst),
275 TP_STRUCT__entry(
276 __field(const void *, rqst)
277 __field(const void *, rep)
278 __field(const void *, req)
279 __field(u32, xid)
282 TP_fast_assign(
283 __entry->rqst = rqst;
284 __entry->req = rpcr_to_rdmar(rqst);
285 __entry->rep = rpcr_to_rdmar(rqst)->rl_reply;
286 __entry->xid = be32_to_cpu(rqst->rq_xid);
289 TP_printk("xid=0x%08x, rqst=%p req=%p rep=%p",
290 __entry->xid, __entry->rqst, __entry->req, __entry->rep
294 #define DEFINE_CB_EVENT(name) \
295 DEFINE_EVENT(xprtrdma_cb_event, name, \
296 TP_PROTO( \
297 const struct rpc_rqst *rqst \
298 ), \
299 TP_ARGS(rqst))
302 ** Connection events
305 TRACE_EVENT(xprtrdma_cm_event,
306 TP_PROTO(
307 const struct rpcrdma_xprt *r_xprt,
308 struct rdma_cm_event *event
311 TP_ARGS(r_xprt, event),
313 TP_STRUCT__entry(
314 __field(const void *, r_xprt)
315 __field(unsigned int, event)
316 __field(int, status)
317 __string(addr, rpcrdma_addrstr(r_xprt))
318 __string(port, rpcrdma_portstr(r_xprt))
321 TP_fast_assign(
322 __entry->r_xprt = r_xprt;
323 __entry->event = event->event;
324 __entry->status = event->status;
325 __assign_str(addr, rpcrdma_addrstr(r_xprt));
326 __assign_str(port, rpcrdma_portstr(r_xprt));
329 TP_printk("peer=[%s]:%s r_xprt=%p: %s (%u/%d)",
330 __get_str(addr), __get_str(port),
331 __entry->r_xprt, rdma_show_cm_event(__entry->event),
332 __entry->event, __entry->status
336 TRACE_EVENT(xprtrdma_disconnect,
337 TP_PROTO(
338 const struct rpcrdma_xprt *r_xprt,
339 int status
342 TP_ARGS(r_xprt, status),
344 TP_STRUCT__entry(
345 __field(const void *, r_xprt)
346 __field(int, status)
347 __field(int, connected)
348 __string(addr, rpcrdma_addrstr(r_xprt))
349 __string(port, rpcrdma_portstr(r_xprt))
352 TP_fast_assign(
353 __entry->r_xprt = r_xprt;
354 __entry->status = status;
355 __entry->connected = r_xprt->rx_ep.rep_connected;
356 __assign_str(addr, rpcrdma_addrstr(r_xprt));
357 __assign_str(port, rpcrdma_portstr(r_xprt));
360 TP_printk("peer=[%s]:%s r_xprt=%p: status=%d %sconnected",
361 __get_str(addr), __get_str(port),
362 __entry->r_xprt, __entry->status,
363 __entry->connected == 1 ? "still " : "dis"
367 DEFINE_RXPRT_EVENT(xprtrdma_conn_start);
368 DEFINE_RXPRT_EVENT(xprtrdma_conn_tout);
369 DEFINE_RXPRT_EVENT(xprtrdma_create);
370 DEFINE_RXPRT_EVENT(xprtrdma_op_destroy);
371 DEFINE_RXPRT_EVENT(xprtrdma_remove);
372 DEFINE_RXPRT_EVENT(xprtrdma_reinsert);
373 DEFINE_RXPRT_EVENT(xprtrdma_reconnect);
374 DEFINE_RXPRT_EVENT(xprtrdma_op_inject_dsc);
375 DEFINE_RXPRT_EVENT(xprtrdma_op_close);
376 DEFINE_RXPRT_EVENT(xprtrdma_op_connect);
378 TRACE_EVENT(xprtrdma_op_set_cto,
379 TP_PROTO(
380 const struct rpcrdma_xprt *r_xprt,
381 unsigned long connect,
382 unsigned long reconnect
385 TP_ARGS(r_xprt, connect, reconnect),
387 TP_STRUCT__entry(
388 __field(const void *, r_xprt)
389 __field(unsigned long, connect)
390 __field(unsigned long, reconnect)
391 __string(addr, rpcrdma_addrstr(r_xprt))
392 __string(port, rpcrdma_portstr(r_xprt))
395 TP_fast_assign(
396 __entry->r_xprt = r_xprt;
397 __entry->connect = connect;
398 __entry->reconnect = reconnect;
399 __assign_str(addr, rpcrdma_addrstr(r_xprt));
400 __assign_str(port, rpcrdma_portstr(r_xprt));
403 TP_printk("peer=[%s]:%s r_xprt=%p: connect=%lu reconnect=%lu",
404 __get_str(addr), __get_str(port), __entry->r_xprt,
405 __entry->connect / HZ, __entry->reconnect / HZ
409 TRACE_EVENT(xprtrdma_qp_event,
410 TP_PROTO(
411 const struct rpcrdma_xprt *r_xprt,
412 const struct ib_event *event
415 TP_ARGS(r_xprt, event),
417 TP_STRUCT__entry(
418 __field(const void *, r_xprt)
419 __field(unsigned int, event)
420 __string(name, event->device->name)
421 __string(addr, rpcrdma_addrstr(r_xprt))
422 __string(port, rpcrdma_portstr(r_xprt))
425 TP_fast_assign(
426 __entry->r_xprt = r_xprt;
427 __entry->event = event->event;
428 __assign_str(name, event->device->name);
429 __assign_str(addr, rpcrdma_addrstr(r_xprt));
430 __assign_str(port, rpcrdma_portstr(r_xprt));
433 TP_printk("peer=[%s]:%s r_xprt=%p: dev %s: %s (%u)",
434 __get_str(addr), __get_str(port), __entry->r_xprt,
435 __get_str(name), rdma_show_ib_event(__entry->event),
436 __entry->event
441 ** Call events
444 TRACE_EVENT(xprtrdma_createmrs,
445 TP_PROTO(
446 const struct rpcrdma_xprt *r_xprt,
447 unsigned int count
450 TP_ARGS(r_xprt, count),
452 TP_STRUCT__entry(
453 __field(const void *, r_xprt)
454 __string(addr, rpcrdma_addrstr(r_xprt))
455 __string(port, rpcrdma_portstr(r_xprt))
456 __field(unsigned int, count)
459 TP_fast_assign(
460 __entry->r_xprt = r_xprt;
461 __entry->count = count;
462 __assign_str(addr, rpcrdma_addrstr(r_xprt));
463 __assign_str(port, rpcrdma_portstr(r_xprt));
466 TP_printk("peer=[%s]:%s r_xprt=%p: created %u MRs",
467 __get_str(addr), __get_str(port), __entry->r_xprt,
468 __entry->count
472 TRACE_EVENT(xprtrdma_mr_get,
473 TP_PROTO(
474 const struct rpcrdma_req *req
477 TP_ARGS(req),
479 TP_STRUCT__entry(
480 __field(const void *, req)
481 __field(unsigned int, task_id)
482 __field(unsigned int, client_id)
483 __field(u32, xid)
486 TP_fast_assign(
487 const struct rpc_rqst *rqst = &req->rl_slot;
489 __entry->req = req;
490 __entry->task_id = rqst->rq_task->tk_pid;
491 __entry->client_id = rqst->rq_task->tk_client->cl_clid;
492 __entry->xid = be32_to_cpu(rqst->rq_xid);
495 TP_printk("task:%u@%u xid=0x%08x req=%p",
496 __entry->task_id, __entry->client_id, __entry->xid,
497 __entry->req
501 TRACE_EVENT(xprtrdma_nomrs,
502 TP_PROTO(
503 const struct rpcrdma_req *req
506 TP_ARGS(req),
508 TP_STRUCT__entry(
509 __field(const void *, req)
510 __field(unsigned int, task_id)
511 __field(unsigned int, client_id)
512 __field(u32, xid)
515 TP_fast_assign(
516 const struct rpc_rqst *rqst = &req->rl_slot;
518 __entry->req = req;
519 __entry->task_id = rqst->rq_task->tk_pid;
520 __entry->client_id = rqst->rq_task->tk_client->cl_clid;
521 __entry->xid = be32_to_cpu(rqst->rq_xid);
524 TP_printk("task:%u@%u xid=0x%08x req=%p",
525 __entry->task_id, __entry->client_id, __entry->xid,
526 __entry->req
530 DEFINE_RDCH_EVENT(read);
531 DEFINE_WRCH_EVENT(write);
532 DEFINE_WRCH_EVENT(reply);
534 TRACE_DEFINE_ENUM(rpcrdma_noch);
535 TRACE_DEFINE_ENUM(rpcrdma_readch);
536 TRACE_DEFINE_ENUM(rpcrdma_areadch);
537 TRACE_DEFINE_ENUM(rpcrdma_writech);
538 TRACE_DEFINE_ENUM(rpcrdma_replych);
540 #define xprtrdma_show_chunktype(x) \
541 __print_symbolic(x, \
542 { rpcrdma_noch, "inline" }, \
543 { rpcrdma_readch, "read list" }, \
544 { rpcrdma_areadch, "*read list" }, \
545 { rpcrdma_writech, "write list" }, \
546 { rpcrdma_replych, "reply chunk" })
548 TRACE_EVENT(xprtrdma_marshal,
549 TP_PROTO(
550 const struct rpcrdma_req *req,
551 unsigned int rtype,
552 unsigned int wtype
555 TP_ARGS(req, rtype, wtype),
557 TP_STRUCT__entry(
558 __field(unsigned int, task_id)
559 __field(unsigned int, client_id)
560 __field(u32, xid)
561 __field(unsigned int, hdrlen)
562 __field(unsigned int, headlen)
563 __field(unsigned int, pagelen)
564 __field(unsigned int, taillen)
565 __field(unsigned int, rtype)
566 __field(unsigned int, wtype)
569 TP_fast_assign(
570 const struct rpc_rqst *rqst = &req->rl_slot;
572 __entry->task_id = rqst->rq_task->tk_pid;
573 __entry->client_id = rqst->rq_task->tk_client->cl_clid;
574 __entry->xid = be32_to_cpu(rqst->rq_xid);
575 __entry->hdrlen = req->rl_hdrbuf.len;
576 __entry->headlen = rqst->rq_snd_buf.head[0].iov_len;
577 __entry->pagelen = rqst->rq_snd_buf.page_len;
578 __entry->taillen = rqst->rq_snd_buf.tail[0].iov_len;
579 __entry->rtype = rtype;
580 __entry->wtype = wtype;
583 TP_printk("task:%u@%u xid=0x%08x: hdr=%u xdr=%u/%u/%u %s/%s",
584 __entry->task_id, __entry->client_id, __entry->xid,
585 __entry->hdrlen,
586 __entry->headlen, __entry->pagelen, __entry->taillen,
587 xprtrdma_show_chunktype(__entry->rtype),
588 xprtrdma_show_chunktype(__entry->wtype)
592 TRACE_EVENT(xprtrdma_marshal_failed,
593 TP_PROTO(const struct rpc_rqst *rqst,
594 int ret
597 TP_ARGS(rqst, ret),
599 TP_STRUCT__entry(
600 __field(unsigned int, task_id)
601 __field(unsigned int, client_id)
602 __field(u32, xid)
603 __field(int, ret)
606 TP_fast_assign(
607 __entry->task_id = rqst->rq_task->tk_pid;
608 __entry->client_id = rqst->rq_task->tk_client->cl_clid;
609 __entry->xid = be32_to_cpu(rqst->rq_xid);
610 __entry->ret = ret;
613 TP_printk("task:%u@%u xid=0x%08x: ret=%d",
614 __entry->task_id, __entry->client_id, __entry->xid,
615 __entry->ret
619 TRACE_EVENT(xprtrdma_prepsend_failed,
620 TP_PROTO(const struct rpc_rqst *rqst,
621 int ret
624 TP_ARGS(rqst, ret),
626 TP_STRUCT__entry(
627 __field(unsigned int, task_id)
628 __field(unsigned int, client_id)
629 __field(u32, xid)
630 __field(int, ret)
633 TP_fast_assign(
634 __entry->task_id = rqst->rq_task->tk_pid;
635 __entry->client_id = rqst->rq_task->tk_client->cl_clid;
636 __entry->xid = be32_to_cpu(rqst->rq_xid);
637 __entry->ret = ret;
640 TP_printk("task:%u@%u xid=0x%08x: ret=%d",
641 __entry->task_id, __entry->client_id, __entry->xid,
642 __entry->ret
646 TRACE_EVENT(xprtrdma_post_send,
647 TP_PROTO(
648 const struct rpcrdma_req *req,
649 int status
652 TP_ARGS(req, status),
654 TP_STRUCT__entry(
655 __field(const void *, req)
656 __field(unsigned int, task_id)
657 __field(unsigned int, client_id)
658 __field(int, num_sge)
659 __field(int, signaled)
660 __field(int, status)
663 TP_fast_assign(
664 const struct rpc_rqst *rqst = &req->rl_slot;
666 __entry->task_id = rqst->rq_task->tk_pid;
667 __entry->client_id = rqst->rq_task->tk_client ?
668 rqst->rq_task->tk_client->cl_clid : -1;
669 __entry->req = req;
670 __entry->num_sge = req->rl_sendctx->sc_wr.num_sge;
671 __entry->signaled = req->rl_sendctx->sc_wr.send_flags &
672 IB_SEND_SIGNALED;
673 __entry->status = status;
676 TP_printk("task:%u@%u req=%p (%d SGE%s) %sstatus=%d",
677 __entry->task_id, __entry->client_id,
678 __entry->req, __entry->num_sge,
679 (__entry->num_sge == 1 ? "" : "s"),
680 (__entry->signaled ? "signaled " : ""),
681 __entry->status
685 TRACE_EVENT(xprtrdma_post_recv,
686 TP_PROTO(
687 const struct rpcrdma_rep *rep
690 TP_ARGS(rep),
692 TP_STRUCT__entry(
693 __field(const void *, rep)
696 TP_fast_assign(
697 __entry->rep = rep;
700 TP_printk("rep=%p",
701 __entry->rep
705 TRACE_EVENT(xprtrdma_post_recvs,
706 TP_PROTO(
707 const struct rpcrdma_xprt *r_xprt,
708 unsigned int count,
709 int status
712 TP_ARGS(r_xprt, count, status),
714 TP_STRUCT__entry(
715 __field(const void *, r_xprt)
716 __field(unsigned int, count)
717 __field(int, status)
718 __field(int, posted)
719 __string(addr, rpcrdma_addrstr(r_xprt))
720 __string(port, rpcrdma_portstr(r_xprt))
723 TP_fast_assign(
724 __entry->r_xprt = r_xprt;
725 __entry->count = count;
726 __entry->status = status;
727 __entry->posted = r_xprt->rx_ep.rep_receive_count;
728 __assign_str(addr, rpcrdma_addrstr(r_xprt));
729 __assign_str(port, rpcrdma_portstr(r_xprt));
732 TP_printk("peer=[%s]:%s r_xprt=%p: %u new recvs, %d active (rc %d)",
733 __get_str(addr), __get_str(port), __entry->r_xprt,
734 __entry->count, __entry->posted, __entry->status
738 TRACE_EVENT(xprtrdma_post_linv,
739 TP_PROTO(
740 const struct rpcrdma_req *req,
741 int status
744 TP_ARGS(req, status),
746 TP_STRUCT__entry(
747 __field(const void *, req)
748 __field(int, status)
749 __field(u32, xid)
752 TP_fast_assign(
753 __entry->req = req;
754 __entry->status = status;
755 __entry->xid = be32_to_cpu(req->rl_slot.rq_xid);
758 TP_printk("req=%p xid=0x%08x status=%d",
759 __entry->req, __entry->xid, __entry->status
764 ** Completion events
767 TRACE_EVENT(xprtrdma_wc_send,
768 TP_PROTO(
769 const struct rpcrdma_sendctx *sc,
770 const struct ib_wc *wc
773 TP_ARGS(sc, wc),
775 TP_STRUCT__entry(
776 __field(const void *, req)
777 __field(unsigned int, unmap_count)
778 __field(unsigned int, status)
779 __field(unsigned int, vendor_err)
782 TP_fast_assign(
783 __entry->req = sc->sc_req;
784 __entry->unmap_count = sc->sc_unmap_count;
785 __entry->status = wc->status;
786 __entry->vendor_err = __entry->status ? wc->vendor_err : 0;
789 TP_printk("req=%p, unmapped %u pages: %s (%u/0x%x)",
790 __entry->req, __entry->unmap_count,
791 rdma_show_wc_status(__entry->status),
792 __entry->status, __entry->vendor_err
796 TRACE_EVENT(xprtrdma_wc_receive,
797 TP_PROTO(
798 const struct ib_wc *wc
801 TP_ARGS(wc),
803 TP_STRUCT__entry(
804 __field(const void *, rep)
805 __field(u32, byte_len)
806 __field(unsigned int, status)
807 __field(u32, vendor_err)
810 TP_fast_assign(
811 __entry->rep = container_of(wc->wr_cqe, struct rpcrdma_rep,
812 rr_cqe);
813 __entry->status = wc->status;
814 if (wc->status) {
815 __entry->byte_len = 0;
816 __entry->vendor_err = wc->vendor_err;
817 } else {
818 __entry->byte_len = wc->byte_len;
819 __entry->vendor_err = 0;
823 TP_printk("rep=%p %u bytes: %s (%u/0x%x)",
824 __entry->rep, __entry->byte_len,
825 rdma_show_wc_status(__entry->status),
826 __entry->status, __entry->vendor_err
830 DEFINE_FRWR_DONE_EVENT(xprtrdma_wc_fastreg);
831 DEFINE_FRWR_DONE_EVENT(xprtrdma_wc_li);
832 DEFINE_FRWR_DONE_EVENT(xprtrdma_wc_li_wake);
833 DEFINE_FRWR_DONE_EVENT(xprtrdma_wc_li_done);
835 TRACE_EVENT(xprtrdma_frwr_alloc,
836 TP_PROTO(
837 const struct rpcrdma_mr *mr,
838 int rc
841 TP_ARGS(mr, rc),
843 TP_STRUCT__entry(
844 __field(const void *, mr)
845 __field(int, rc)
848 TP_fast_assign(
849 __entry->mr = mr;
850 __entry->rc = rc;
853 TP_printk("mr=%p: rc=%d",
854 __entry->mr, __entry->rc
858 TRACE_EVENT(xprtrdma_frwr_dereg,
859 TP_PROTO(
860 const struct rpcrdma_mr *mr,
861 int rc
864 TP_ARGS(mr, rc),
866 TP_STRUCT__entry(
867 __field(const void *, mr)
868 __field(u32, handle)
869 __field(u32, length)
870 __field(u64, offset)
871 __field(u32, dir)
872 __field(int, rc)
875 TP_fast_assign(
876 __entry->mr = mr;
877 __entry->handle = mr->mr_handle;
878 __entry->length = mr->mr_length;
879 __entry->offset = mr->mr_offset;
880 __entry->dir = mr->mr_dir;
881 __entry->rc = rc;
884 TP_printk("mr=%p %u@0x%016llx:0x%08x (%s): rc=%d",
885 __entry->mr, __entry->length,
886 (unsigned long long)__entry->offset, __entry->handle,
887 xprtrdma_show_direction(__entry->dir),
888 __entry->rc
892 TRACE_EVENT(xprtrdma_frwr_sgerr,
893 TP_PROTO(
894 const struct rpcrdma_mr *mr,
895 int sg_nents
898 TP_ARGS(mr, sg_nents),
900 TP_STRUCT__entry(
901 __field(const void *, mr)
902 __field(u64, addr)
903 __field(u32, dir)
904 __field(int, nents)
907 TP_fast_assign(
908 __entry->mr = mr;
909 __entry->addr = mr->mr_sg->dma_address;
910 __entry->dir = mr->mr_dir;
911 __entry->nents = sg_nents;
914 TP_printk("mr=%p dma addr=0x%llx (%s) sg_nents=%d",
915 __entry->mr, __entry->addr,
916 xprtrdma_show_direction(__entry->dir),
917 __entry->nents
921 TRACE_EVENT(xprtrdma_frwr_maperr,
922 TP_PROTO(
923 const struct rpcrdma_mr *mr,
924 int num_mapped
927 TP_ARGS(mr, num_mapped),
929 TP_STRUCT__entry(
930 __field(const void *, mr)
931 __field(u64, addr)
932 __field(u32, dir)
933 __field(int, num_mapped)
934 __field(int, nents)
937 TP_fast_assign(
938 __entry->mr = mr;
939 __entry->addr = mr->mr_sg->dma_address;
940 __entry->dir = mr->mr_dir;
941 __entry->num_mapped = num_mapped;
942 __entry->nents = mr->mr_nents;
945 TP_printk("mr=%p dma addr=0x%llx (%s) nents=%d of %d",
946 __entry->mr, __entry->addr,
947 xprtrdma_show_direction(__entry->dir),
948 __entry->num_mapped, __entry->nents
952 DEFINE_MR_EVENT(localinv);
953 DEFINE_MR_EVENT(map);
954 DEFINE_MR_EVENT(unmap);
955 DEFINE_MR_EVENT(remoteinv);
956 DEFINE_MR_EVENT(recycle);
958 TRACE_EVENT(xprtrdma_dma_maperr,
959 TP_PROTO(
960 u64 addr
963 TP_ARGS(addr),
965 TP_STRUCT__entry(
966 __field(u64, addr)
969 TP_fast_assign(
970 __entry->addr = addr;
973 TP_printk("dma addr=0x%llx\n", __entry->addr)
977 ** Reply events
980 TRACE_EVENT(xprtrdma_reply,
981 TP_PROTO(
982 const struct rpc_task *task,
983 const struct rpcrdma_rep *rep,
984 const struct rpcrdma_req *req,
985 unsigned int credits
988 TP_ARGS(task, rep, req, credits),
990 TP_STRUCT__entry(
991 __field(unsigned int, task_id)
992 __field(unsigned int, client_id)
993 __field(const void *, rep)
994 __field(const void *, req)
995 __field(u32, xid)
996 __field(unsigned int, credits)
999 TP_fast_assign(
1000 __entry->task_id = task->tk_pid;
1001 __entry->client_id = task->tk_client->cl_clid;
1002 __entry->rep = rep;
1003 __entry->req = req;
1004 __entry->xid = be32_to_cpu(rep->rr_xid);
1005 __entry->credits = credits;
1008 TP_printk("task:%u@%u xid=0x%08x, %u credits, rep=%p -> req=%p",
1009 __entry->task_id, __entry->client_id, __entry->xid,
1010 __entry->credits, __entry->rep, __entry->req
1014 TRACE_EVENT(xprtrdma_defer_cmp,
1015 TP_PROTO(
1016 const struct rpcrdma_rep *rep
1019 TP_ARGS(rep),
1021 TP_STRUCT__entry(
1022 __field(unsigned int, task_id)
1023 __field(unsigned int, client_id)
1024 __field(const void *, rep)
1025 __field(u32, xid)
1028 TP_fast_assign(
1029 __entry->task_id = rep->rr_rqst->rq_task->tk_pid;
1030 __entry->client_id = rep->rr_rqst->rq_task->tk_client->cl_clid;
1031 __entry->rep = rep;
1032 __entry->xid = be32_to_cpu(rep->rr_xid);
1035 TP_printk("task:%u@%u xid=0x%08x rep=%p",
1036 __entry->task_id, __entry->client_id, __entry->xid,
1037 __entry->rep
1041 DEFINE_REPLY_EVENT(xprtrdma_reply_vers);
1042 DEFINE_REPLY_EVENT(xprtrdma_reply_rqst);
1043 DEFINE_REPLY_EVENT(xprtrdma_reply_short);
1044 DEFINE_REPLY_EVENT(xprtrdma_reply_hdr);
1046 TRACE_EVENT(xprtrdma_fixup,
1047 TP_PROTO(
1048 const struct rpc_rqst *rqst,
1049 int len,
1050 int hdrlen
1053 TP_ARGS(rqst, len, hdrlen),
1055 TP_STRUCT__entry(
1056 __field(unsigned int, task_id)
1057 __field(unsigned int, client_id)
1058 __field(const void *, base)
1059 __field(int, len)
1060 __field(int, hdrlen)
1063 TP_fast_assign(
1064 __entry->task_id = rqst->rq_task->tk_pid;
1065 __entry->client_id = rqst->rq_task->tk_client->cl_clid;
1066 __entry->base = rqst->rq_rcv_buf.head[0].iov_base;
1067 __entry->len = len;
1068 __entry->hdrlen = hdrlen;
1071 TP_printk("task:%u@%u base=%p len=%d hdrlen=%d",
1072 __entry->task_id, __entry->client_id,
1073 __entry->base, __entry->len, __entry->hdrlen
1077 TRACE_EVENT(xprtrdma_fixup_pg,
1078 TP_PROTO(
1079 const struct rpc_rqst *rqst,
1080 int pageno,
1081 const void *pos,
1082 int len,
1083 int curlen
1086 TP_ARGS(rqst, pageno, pos, len, curlen),
1088 TP_STRUCT__entry(
1089 __field(unsigned int, task_id)
1090 __field(unsigned int, client_id)
1091 __field(const void *, pos)
1092 __field(int, pageno)
1093 __field(int, len)
1094 __field(int, curlen)
1097 TP_fast_assign(
1098 __entry->task_id = rqst->rq_task->tk_pid;
1099 __entry->client_id = rqst->rq_task->tk_client->cl_clid;
1100 __entry->pos = pos;
1101 __entry->pageno = pageno;
1102 __entry->len = len;
1103 __entry->curlen = curlen;
1106 TP_printk("task:%u@%u pageno=%d pos=%p len=%d curlen=%d",
1107 __entry->task_id, __entry->client_id,
1108 __entry->pageno, __entry->pos, __entry->len, __entry->curlen
1112 TRACE_EVENT(xprtrdma_decode_seg,
1113 TP_PROTO(
1114 u32 handle,
1115 u32 length,
1116 u64 offset
1119 TP_ARGS(handle, length, offset),
1121 TP_STRUCT__entry(
1122 __field(u32, handle)
1123 __field(u32, length)
1124 __field(u64, offset)
1127 TP_fast_assign(
1128 __entry->handle = handle;
1129 __entry->length = length;
1130 __entry->offset = offset;
1133 TP_printk("%u@0x%016llx:0x%08x",
1134 __entry->length, (unsigned long long)__entry->offset,
1135 __entry->handle
1140 ** Allocation/release of rpcrdma_reqs and rpcrdma_reps
1143 TRACE_EVENT(xprtrdma_op_allocate,
1144 TP_PROTO(
1145 const struct rpc_task *task,
1146 const struct rpcrdma_req *req
1149 TP_ARGS(task, req),
1151 TP_STRUCT__entry(
1152 __field(unsigned int, task_id)
1153 __field(unsigned int, client_id)
1154 __field(const void *, req)
1155 __field(size_t, callsize)
1156 __field(size_t, rcvsize)
1159 TP_fast_assign(
1160 __entry->task_id = task->tk_pid;
1161 __entry->client_id = task->tk_client->cl_clid;
1162 __entry->req = req;
1163 __entry->callsize = task->tk_rqstp->rq_callsize;
1164 __entry->rcvsize = task->tk_rqstp->rq_rcvsize;
1167 TP_printk("task:%u@%u req=%p (%zu, %zu)",
1168 __entry->task_id, __entry->client_id,
1169 __entry->req, __entry->callsize, __entry->rcvsize
1173 TRACE_EVENT(xprtrdma_op_free,
1174 TP_PROTO(
1175 const struct rpc_task *task,
1176 const struct rpcrdma_req *req
1179 TP_ARGS(task, req),
1181 TP_STRUCT__entry(
1182 __field(unsigned int, task_id)
1183 __field(unsigned int, client_id)
1184 __field(const void *, req)
1185 __field(const void *, rep)
1188 TP_fast_assign(
1189 __entry->task_id = task->tk_pid;
1190 __entry->client_id = task->tk_client->cl_clid;
1191 __entry->req = req;
1192 __entry->rep = req->rl_reply;
1195 TP_printk("task:%u@%u req=%p rep=%p",
1196 __entry->task_id, __entry->client_id,
1197 __entry->req, __entry->rep
1202 ** Callback events
1205 TRACE_EVENT(xprtrdma_cb_setup,
1206 TP_PROTO(
1207 const struct rpcrdma_xprt *r_xprt,
1208 unsigned int reqs
1211 TP_ARGS(r_xprt, reqs),
1213 TP_STRUCT__entry(
1214 __field(const void *, r_xprt)
1215 __field(unsigned int, reqs)
1216 __string(addr, rpcrdma_addrstr(r_xprt))
1217 __string(port, rpcrdma_portstr(r_xprt))
1220 TP_fast_assign(
1221 __entry->r_xprt = r_xprt;
1222 __entry->reqs = reqs;
1223 __assign_str(addr, rpcrdma_addrstr(r_xprt));
1224 __assign_str(port, rpcrdma_portstr(r_xprt));
1227 TP_printk("peer=[%s]:%s r_xprt=%p: %u reqs",
1228 __get_str(addr), __get_str(port),
1229 __entry->r_xprt, __entry->reqs
1233 DEFINE_CB_EVENT(xprtrdma_cb_call);
1234 DEFINE_CB_EVENT(xprtrdma_cb_reply);
1236 TRACE_EVENT(xprtrdma_leaked_rep,
1237 TP_PROTO(
1238 const struct rpc_rqst *rqst,
1239 const struct rpcrdma_rep *rep
1242 TP_ARGS(rqst, rep),
1244 TP_STRUCT__entry(
1245 __field(unsigned int, task_id)
1246 __field(unsigned int, client_id)
1247 __field(u32, xid)
1248 __field(const void *, rep)
1251 TP_fast_assign(
1252 __entry->task_id = rqst->rq_task->tk_pid;
1253 __entry->client_id = rqst->rq_task->tk_client->cl_clid;
1254 __entry->xid = be32_to_cpu(rqst->rq_xid);
1255 __entry->rep = rep;
1258 TP_printk("task:%u@%u xid=0x%08x rep=%p",
1259 __entry->task_id, __entry->client_id, __entry->xid,
1260 __entry->rep
1265 ** Server-side RPC/RDMA events
1268 DECLARE_EVENT_CLASS(svcrdma_xprt_event,
1269 TP_PROTO(
1270 const struct svc_xprt *xprt
1273 TP_ARGS(xprt),
1275 TP_STRUCT__entry(
1276 __field(const void *, xprt)
1277 __string(addr, xprt->xpt_remotebuf)
1280 TP_fast_assign(
1281 __entry->xprt = xprt;
1282 __assign_str(addr, xprt->xpt_remotebuf);
1285 TP_printk("xprt=%p addr=%s",
1286 __entry->xprt, __get_str(addr)
1290 #define DEFINE_XPRT_EVENT(name) \
1291 DEFINE_EVENT(svcrdma_xprt_event, svcrdma_xprt_##name, \
1292 TP_PROTO( \
1293 const struct svc_xprt *xprt \
1294 ), \
1295 TP_ARGS(xprt))
1297 DEFINE_XPRT_EVENT(accept);
1298 DEFINE_XPRT_EVENT(fail);
1299 DEFINE_XPRT_EVENT(free);
1301 TRACE_DEFINE_ENUM(RDMA_MSG);
1302 TRACE_DEFINE_ENUM(RDMA_NOMSG);
1303 TRACE_DEFINE_ENUM(RDMA_MSGP);
1304 TRACE_DEFINE_ENUM(RDMA_DONE);
1305 TRACE_DEFINE_ENUM(RDMA_ERROR);
1307 #define show_rpcrdma_proc(x) \
1308 __print_symbolic(x, \
1309 { RDMA_MSG, "RDMA_MSG" }, \
1310 { RDMA_NOMSG, "RDMA_NOMSG" }, \
1311 { RDMA_MSGP, "RDMA_MSGP" }, \
1312 { RDMA_DONE, "RDMA_DONE" }, \
1313 { RDMA_ERROR, "RDMA_ERROR" })
1315 TRACE_EVENT(svcrdma_decode_rqst,
1316 TP_PROTO(
1317 __be32 *p,
1318 unsigned int hdrlen
1321 TP_ARGS(p, hdrlen),
1323 TP_STRUCT__entry(
1324 __field(u32, xid)
1325 __field(u32, vers)
1326 __field(u32, proc)
1327 __field(u32, credits)
1328 __field(unsigned int, hdrlen)
1331 TP_fast_assign(
1332 __entry->xid = be32_to_cpup(p++);
1333 __entry->vers = be32_to_cpup(p++);
1334 __entry->credits = be32_to_cpup(p++);
1335 __entry->proc = be32_to_cpup(p);
1336 __entry->hdrlen = hdrlen;
1339 TP_printk("xid=0x%08x vers=%u credits=%u proc=%s hdrlen=%u",
1340 __entry->xid, __entry->vers, __entry->credits,
1341 show_rpcrdma_proc(__entry->proc), __entry->hdrlen)
1344 TRACE_EVENT(svcrdma_decode_short,
1345 TP_PROTO(
1346 unsigned int hdrlen
1349 TP_ARGS(hdrlen),
1351 TP_STRUCT__entry(
1352 __field(unsigned int, hdrlen)
1355 TP_fast_assign(
1356 __entry->hdrlen = hdrlen;
1359 TP_printk("hdrlen=%u", __entry->hdrlen)
1362 DECLARE_EVENT_CLASS(svcrdma_badreq_event,
1363 TP_PROTO(
1364 __be32 *p
1367 TP_ARGS(p),
1369 TP_STRUCT__entry(
1370 __field(u32, xid)
1371 __field(u32, vers)
1372 __field(u32, proc)
1373 __field(u32, credits)
1376 TP_fast_assign(
1377 __entry->xid = be32_to_cpup(p++);
1378 __entry->vers = be32_to_cpup(p++);
1379 __entry->credits = be32_to_cpup(p++);
1380 __entry->proc = be32_to_cpup(p);
1383 TP_printk("xid=0x%08x vers=%u credits=%u proc=%u",
1384 __entry->xid, __entry->vers, __entry->credits, __entry->proc)
1387 #define DEFINE_BADREQ_EVENT(name) \
1388 DEFINE_EVENT(svcrdma_badreq_event, svcrdma_decode_##name,\
1389 TP_PROTO( \
1390 __be32 *p \
1391 ), \
1392 TP_ARGS(p))
1394 DEFINE_BADREQ_EVENT(badvers);
1395 DEFINE_BADREQ_EVENT(drop);
1396 DEFINE_BADREQ_EVENT(badproc);
1397 DEFINE_BADREQ_EVENT(parse);
1399 DECLARE_EVENT_CLASS(svcrdma_segment_event,
1400 TP_PROTO(
1401 u32 handle,
1402 u32 length,
1403 u64 offset
1406 TP_ARGS(handle, length, offset),
1408 TP_STRUCT__entry(
1409 __field(u32, handle)
1410 __field(u32, length)
1411 __field(u64, offset)
1414 TP_fast_assign(
1415 __entry->handle = handle;
1416 __entry->length = length;
1417 __entry->offset = offset;
1420 TP_printk("%u@0x%016llx:0x%08x",
1421 __entry->length, (unsigned long long)__entry->offset,
1422 __entry->handle
1426 #define DEFINE_SEGMENT_EVENT(name) \
1427 DEFINE_EVENT(svcrdma_segment_event, svcrdma_encode_##name,\
1428 TP_PROTO( \
1429 u32 handle, \
1430 u32 length, \
1431 u64 offset \
1432 ), \
1433 TP_ARGS(handle, length, offset))
1435 DEFINE_SEGMENT_EVENT(rseg);
1436 DEFINE_SEGMENT_EVENT(wseg);
1438 DECLARE_EVENT_CLASS(svcrdma_chunk_event,
1439 TP_PROTO(
1440 u32 length
1443 TP_ARGS(length),
1445 TP_STRUCT__entry(
1446 __field(u32, length)
1449 TP_fast_assign(
1450 __entry->length = length;
1453 TP_printk("length=%u",
1454 __entry->length
1458 #define DEFINE_CHUNK_EVENT(name) \
1459 DEFINE_EVENT(svcrdma_chunk_event, svcrdma_encode_##name,\
1460 TP_PROTO( \
1461 u32 length \
1462 ), \
1463 TP_ARGS(length))
1465 DEFINE_CHUNK_EVENT(pzr);
1466 DEFINE_CHUNK_EVENT(write);
1467 DEFINE_CHUNK_EVENT(reply);
1469 TRACE_EVENT(svcrdma_encode_read,
1470 TP_PROTO(
1471 u32 length,
1472 u32 position
1475 TP_ARGS(length, position),
1477 TP_STRUCT__entry(
1478 __field(u32, length)
1479 __field(u32, position)
1482 TP_fast_assign(
1483 __entry->length = length;
1484 __entry->position = position;
1487 TP_printk("length=%u position=%u",
1488 __entry->length, __entry->position
1492 DECLARE_EVENT_CLASS(svcrdma_error_event,
1493 TP_PROTO(
1494 __be32 xid
1497 TP_ARGS(xid),
1499 TP_STRUCT__entry(
1500 __field(u32, xid)
1503 TP_fast_assign(
1504 __entry->xid = be32_to_cpu(xid);
1507 TP_printk("xid=0x%08x",
1508 __entry->xid
1512 #define DEFINE_ERROR_EVENT(name) \
1513 DEFINE_EVENT(svcrdma_error_event, svcrdma_err_##name, \
1514 TP_PROTO( \
1515 __be32 xid \
1516 ), \
1517 TP_ARGS(xid))
1519 DEFINE_ERROR_EVENT(vers);
1520 DEFINE_ERROR_EVENT(chunk);
1523 ** Server-side RDMA API events
1526 TRACE_EVENT(svcrdma_dma_map_page,
1527 TP_PROTO(
1528 const struct svcxprt_rdma *rdma,
1529 const void *page
1532 TP_ARGS(rdma, page),
1534 TP_STRUCT__entry(
1535 __field(const void *, page);
1536 __string(device, rdma->sc_cm_id->device->name)
1537 __string(addr, rdma->sc_xprt.xpt_remotebuf)
1540 TP_fast_assign(
1541 __entry->page = page;
1542 __assign_str(device, rdma->sc_cm_id->device->name);
1543 __assign_str(addr, rdma->sc_xprt.xpt_remotebuf);
1546 TP_printk("addr=%s device=%s page=%p",
1547 __get_str(addr), __get_str(device), __entry->page
1551 TRACE_EVENT(svcrdma_dma_map_rwctx,
1552 TP_PROTO(
1553 const struct svcxprt_rdma *rdma,
1554 int status
1557 TP_ARGS(rdma, status),
1559 TP_STRUCT__entry(
1560 __field(int, status)
1561 __string(device, rdma->sc_cm_id->device->name)
1562 __string(addr, rdma->sc_xprt.xpt_remotebuf)
1565 TP_fast_assign(
1566 __entry->status = status;
1567 __assign_str(device, rdma->sc_cm_id->device->name);
1568 __assign_str(addr, rdma->sc_xprt.xpt_remotebuf);
1571 TP_printk("addr=%s device=%s status=%d",
1572 __get_str(addr), __get_str(device), __entry->status
1576 TRACE_EVENT(svcrdma_send_failed,
1577 TP_PROTO(
1578 const struct svc_rqst *rqst,
1579 int status
1582 TP_ARGS(rqst, status),
1584 TP_STRUCT__entry(
1585 __field(int, status)
1586 __field(u32, xid)
1587 __field(const void *, xprt)
1588 __string(addr, rqst->rq_xprt->xpt_remotebuf)
1591 TP_fast_assign(
1592 __entry->status = status;
1593 __entry->xid = __be32_to_cpu(rqst->rq_xid);
1594 __entry->xprt = rqst->rq_xprt;
1595 __assign_str(addr, rqst->rq_xprt->xpt_remotebuf);
1598 TP_printk("xprt=%p addr=%s xid=0x%08x status=%d",
1599 __entry->xprt, __get_str(addr),
1600 __entry->xid, __entry->status
1604 DECLARE_EVENT_CLASS(svcrdma_sendcomp_event,
1605 TP_PROTO(
1606 const struct ib_wc *wc
1609 TP_ARGS(wc),
1611 TP_STRUCT__entry(
1612 __field(const void *, cqe)
1613 __field(unsigned int, status)
1614 __field(unsigned int, vendor_err)
1617 TP_fast_assign(
1618 __entry->cqe = wc->wr_cqe;
1619 __entry->status = wc->status;
1620 if (wc->status)
1621 __entry->vendor_err = wc->vendor_err;
1622 else
1623 __entry->vendor_err = 0;
1626 TP_printk("cqe=%p status=%s (%u/0x%x)",
1627 __entry->cqe, rdma_show_wc_status(__entry->status),
1628 __entry->status, __entry->vendor_err
1632 #define DEFINE_SENDCOMP_EVENT(name) \
1633 DEFINE_EVENT(svcrdma_sendcomp_event, svcrdma_wc_##name, \
1634 TP_PROTO( \
1635 const struct ib_wc *wc \
1636 ), \
1637 TP_ARGS(wc))
1639 TRACE_EVENT(svcrdma_post_send,
1640 TP_PROTO(
1641 const struct ib_send_wr *wr
1644 TP_ARGS(wr),
1646 TP_STRUCT__entry(
1647 __field(const void *, cqe)
1648 __field(unsigned int, num_sge)
1649 __field(u32, inv_rkey)
1652 TP_fast_assign(
1653 __entry->cqe = wr->wr_cqe;
1654 __entry->num_sge = wr->num_sge;
1655 __entry->inv_rkey = (wr->opcode == IB_WR_SEND_WITH_INV) ?
1656 wr->ex.invalidate_rkey : 0;
1659 TP_printk("cqe=%p num_sge=%u inv_rkey=0x%08x",
1660 __entry->cqe, __entry->num_sge,
1661 __entry->inv_rkey
1665 DEFINE_SENDCOMP_EVENT(send);
1667 TRACE_EVENT(svcrdma_post_recv,
1668 TP_PROTO(
1669 const struct ib_recv_wr *wr,
1670 int status
1673 TP_ARGS(wr, status),
1675 TP_STRUCT__entry(
1676 __field(const void *, cqe)
1677 __field(int, status)
1680 TP_fast_assign(
1681 __entry->cqe = wr->wr_cqe;
1682 __entry->status = status;
1685 TP_printk("cqe=%p status=%d",
1686 __entry->cqe, __entry->status
1690 TRACE_EVENT(svcrdma_wc_receive,
1691 TP_PROTO(
1692 const struct ib_wc *wc
1695 TP_ARGS(wc),
1697 TP_STRUCT__entry(
1698 __field(const void *, cqe)
1699 __field(u32, byte_len)
1700 __field(unsigned int, status)
1701 __field(u32, vendor_err)
1704 TP_fast_assign(
1705 __entry->cqe = wc->wr_cqe;
1706 __entry->status = wc->status;
1707 if (wc->status) {
1708 __entry->byte_len = 0;
1709 __entry->vendor_err = wc->vendor_err;
1710 } else {
1711 __entry->byte_len = wc->byte_len;
1712 __entry->vendor_err = 0;
1716 TP_printk("cqe=%p byte_len=%u status=%s (%u/0x%x)",
1717 __entry->cqe, __entry->byte_len,
1718 rdma_show_wc_status(__entry->status),
1719 __entry->status, __entry->vendor_err
1723 TRACE_EVENT(svcrdma_post_rw,
1724 TP_PROTO(
1725 const void *cqe,
1726 int sqecount
1729 TP_ARGS(cqe, sqecount),
1731 TP_STRUCT__entry(
1732 __field(const void *, cqe)
1733 __field(int, sqecount)
1736 TP_fast_assign(
1737 __entry->cqe = cqe;
1738 __entry->sqecount = sqecount;
1741 TP_printk("cqe=%p sqecount=%d",
1742 __entry->cqe, __entry->sqecount
1746 DEFINE_SENDCOMP_EVENT(read);
1747 DEFINE_SENDCOMP_EVENT(write);
1749 TRACE_EVENT(svcrdma_cm_event,
1750 TP_PROTO(
1751 const struct rdma_cm_event *event,
1752 const struct sockaddr *sap
1755 TP_ARGS(event, sap),
1757 TP_STRUCT__entry(
1758 __field(unsigned int, event)
1759 __field(int, status)
1760 __array(__u8, addr, INET6_ADDRSTRLEN + 10)
1763 TP_fast_assign(
1764 __entry->event = event->event;
1765 __entry->status = event->status;
1766 snprintf(__entry->addr, sizeof(__entry->addr) - 1,
1767 "%pISpc", sap);
1770 TP_printk("addr=%s event=%s (%u/%d)",
1771 __entry->addr,
1772 rdma_show_cm_event(__entry->event),
1773 __entry->event, __entry->status
1777 TRACE_EVENT(svcrdma_qp_error,
1778 TP_PROTO(
1779 const struct ib_event *event,
1780 const struct sockaddr *sap
1783 TP_ARGS(event, sap),
1785 TP_STRUCT__entry(
1786 __field(unsigned int, event)
1787 __string(device, event->device->name)
1788 __array(__u8, addr, INET6_ADDRSTRLEN + 10)
1791 TP_fast_assign(
1792 __entry->event = event->event;
1793 __assign_str(device, event->device->name);
1794 snprintf(__entry->addr, sizeof(__entry->addr) - 1,
1795 "%pISpc", sap);
1798 TP_printk("addr=%s dev=%s event=%s (%u)",
1799 __entry->addr, __get_str(device),
1800 rdma_show_ib_event(__entry->event), __entry->event
1804 DECLARE_EVENT_CLASS(svcrdma_sendqueue_event,
1805 TP_PROTO(
1806 const struct svcxprt_rdma *rdma
1809 TP_ARGS(rdma),
1811 TP_STRUCT__entry(
1812 __field(int, avail)
1813 __field(int, depth)
1814 __string(addr, rdma->sc_xprt.xpt_remotebuf)
1817 TP_fast_assign(
1818 __entry->avail = atomic_read(&rdma->sc_sq_avail);
1819 __entry->depth = rdma->sc_sq_depth;
1820 __assign_str(addr, rdma->sc_xprt.xpt_remotebuf);
1823 TP_printk("addr=%s sc_sq_avail=%d/%d",
1824 __get_str(addr), __entry->avail, __entry->depth
1828 #define DEFINE_SQ_EVENT(name) \
1829 DEFINE_EVENT(svcrdma_sendqueue_event, svcrdma_sq_##name,\
1830 TP_PROTO( \
1831 const struct svcxprt_rdma *rdma \
1832 ), \
1833 TP_ARGS(rdma))
1835 DEFINE_SQ_EVENT(full);
1836 DEFINE_SQ_EVENT(retry);
1838 TRACE_EVENT(svcrdma_sq_post_err,
1839 TP_PROTO(
1840 const struct svcxprt_rdma *rdma,
1841 int status
1844 TP_ARGS(rdma, status),
1846 TP_STRUCT__entry(
1847 __field(int, avail)
1848 __field(int, depth)
1849 __field(int, status)
1850 __string(addr, rdma->sc_xprt.xpt_remotebuf)
1853 TP_fast_assign(
1854 __entry->avail = atomic_read(&rdma->sc_sq_avail);
1855 __entry->depth = rdma->sc_sq_depth;
1856 __entry->status = status;
1857 __assign_str(addr, rdma->sc_xprt.xpt_remotebuf);
1860 TP_printk("addr=%s sc_sq_avail=%d/%d status=%d",
1861 __get_str(addr), __entry->avail, __entry->depth,
1862 __entry->status
1866 #endif /* _TRACE_RPCRDMA_H */
1868 #include <trace/define_trace.h>