WIP FPC-III support
[linux/fpc-iii.git] / include / trace / events / rpcrdma.h
blob76e85e16854b6605b7dde826e9c9f449fdf25818
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/sunrpc/rpc_rdma_cid.h>
15 #include <linux/tracepoint.h>
16 #include <rdma/ib_cm.h>
17 #include <trace/events/rdma.h>
19 /**
20 ** Event classes
21 **/
23 DECLARE_EVENT_CLASS(rpcrdma_completion_class,
24 TP_PROTO(
25 const struct ib_wc *wc,
26 const struct rpc_rdma_cid *cid
29 TP_ARGS(wc, cid),
31 TP_STRUCT__entry(
32 __field(u32, cq_id)
33 __field(int, completion_id)
34 __field(unsigned long, status)
35 __field(unsigned int, vendor_err)
38 TP_fast_assign(
39 __entry->cq_id = cid->ci_queue_id;
40 __entry->completion_id = cid->ci_completion_id;
41 __entry->status = wc->status;
42 if (wc->status)
43 __entry->vendor_err = wc->vendor_err;
44 else
45 __entry->vendor_err = 0;
48 TP_printk("cq.id=%u cid=%d status=%s (%lu/0x%x)",
49 __entry->cq_id, __entry->completion_id,
50 rdma_show_wc_status(__entry->status),
51 __entry->status, __entry->vendor_err
55 #define DEFINE_COMPLETION_EVENT(name) \
56 DEFINE_EVENT(rpcrdma_completion_class, name, \
57 TP_PROTO( \
58 const struct ib_wc *wc, \
59 const struct rpc_rdma_cid *cid \
60 ), \
61 TP_ARGS(wc, cid))
63 DECLARE_EVENT_CLASS(xprtrdma_reply_class,
64 TP_PROTO(
65 const struct rpcrdma_rep *rep
68 TP_ARGS(rep),
70 TP_STRUCT__entry(
71 __field(u32, xid)
72 __field(u32, version)
73 __field(u32, proc)
74 __string(addr, rpcrdma_addrstr(rep->rr_rxprt))
75 __string(port, rpcrdma_portstr(rep->rr_rxprt))
78 TP_fast_assign(
79 __entry->xid = be32_to_cpu(rep->rr_xid);
80 __entry->version = be32_to_cpu(rep->rr_vers);
81 __entry->proc = be32_to_cpu(rep->rr_proc);
82 __assign_str(addr, rpcrdma_addrstr(rep->rr_rxprt));
83 __assign_str(port, rpcrdma_portstr(rep->rr_rxprt));
86 TP_printk("peer=[%s]:%s xid=0x%08x version=%u proc=%u",
87 __get_str(addr), __get_str(port),
88 __entry->xid, __entry->version, __entry->proc
92 #define DEFINE_REPLY_EVENT(name) \
93 DEFINE_EVENT(xprtrdma_reply_class, \
94 xprtrdma_reply_##name##_err, \
95 TP_PROTO( \
96 const struct rpcrdma_rep *rep \
97 ), \
98 TP_ARGS(rep))
100 DECLARE_EVENT_CLASS(xprtrdma_rxprt,
101 TP_PROTO(
102 const struct rpcrdma_xprt *r_xprt
105 TP_ARGS(r_xprt),
107 TP_STRUCT__entry(
108 __field(const void *, r_xprt)
109 __string(addr, rpcrdma_addrstr(r_xprt))
110 __string(port, rpcrdma_portstr(r_xprt))
113 TP_fast_assign(
114 __entry->r_xprt = r_xprt;
115 __assign_str(addr, rpcrdma_addrstr(r_xprt));
116 __assign_str(port, rpcrdma_portstr(r_xprt));
119 TP_printk("peer=[%s]:%s r_xprt=%p",
120 __get_str(addr), __get_str(port), __entry->r_xprt
124 #define DEFINE_RXPRT_EVENT(name) \
125 DEFINE_EVENT(xprtrdma_rxprt, name, \
126 TP_PROTO( \
127 const struct rpcrdma_xprt *r_xprt \
128 ), \
129 TP_ARGS(r_xprt))
131 DECLARE_EVENT_CLASS(xprtrdma_connect_class,
132 TP_PROTO(
133 const struct rpcrdma_xprt *r_xprt,
134 int rc
137 TP_ARGS(r_xprt, rc),
139 TP_STRUCT__entry(
140 __field(const void *, r_xprt)
141 __field(int, rc)
142 __field(int, connect_status)
143 __string(addr, rpcrdma_addrstr(r_xprt))
144 __string(port, rpcrdma_portstr(r_xprt))
147 TP_fast_assign(
148 __entry->r_xprt = r_xprt;
149 __entry->rc = rc;
150 __entry->connect_status = r_xprt->rx_ep->re_connect_status;
151 __assign_str(addr, rpcrdma_addrstr(r_xprt));
152 __assign_str(port, rpcrdma_portstr(r_xprt));
155 TP_printk("peer=[%s]:%s r_xprt=%p: rc=%d connection status=%d",
156 __get_str(addr), __get_str(port), __entry->r_xprt,
157 __entry->rc, __entry->connect_status
161 #define DEFINE_CONN_EVENT(name) \
162 DEFINE_EVENT(xprtrdma_connect_class, xprtrdma_##name, \
163 TP_PROTO( \
164 const struct rpcrdma_xprt *r_xprt, \
165 int rc \
166 ), \
167 TP_ARGS(r_xprt, rc))
169 DECLARE_EVENT_CLASS(xprtrdma_rdch_event,
170 TP_PROTO(
171 const struct rpc_task *task,
172 unsigned int pos,
173 struct rpcrdma_mr *mr,
174 int nsegs
177 TP_ARGS(task, pos, mr, nsegs),
179 TP_STRUCT__entry(
180 __field(unsigned int, task_id)
181 __field(unsigned int, client_id)
182 __field(unsigned int, pos)
183 __field(int, nents)
184 __field(u32, handle)
185 __field(u32, length)
186 __field(u64, offset)
187 __field(int, nsegs)
190 TP_fast_assign(
191 __entry->task_id = task->tk_pid;
192 __entry->client_id = task->tk_client->cl_clid;
193 __entry->pos = pos;
194 __entry->nents = mr->mr_nents;
195 __entry->handle = mr->mr_handle;
196 __entry->length = mr->mr_length;
197 __entry->offset = mr->mr_offset;
198 __entry->nsegs = nsegs;
201 TP_printk("task:%u@%u pos=%u %u@0x%016llx:0x%08x (%s)",
202 __entry->task_id, __entry->client_id,
203 __entry->pos, __entry->length,
204 (unsigned long long)__entry->offset, __entry->handle,
205 __entry->nents < __entry->nsegs ? "more" : "last"
209 #define DEFINE_RDCH_EVENT(name) \
210 DEFINE_EVENT(xprtrdma_rdch_event, xprtrdma_chunk_##name,\
211 TP_PROTO( \
212 const struct rpc_task *task, \
213 unsigned int pos, \
214 struct rpcrdma_mr *mr, \
215 int nsegs \
216 ), \
217 TP_ARGS(task, pos, mr, nsegs))
219 DECLARE_EVENT_CLASS(xprtrdma_wrch_event,
220 TP_PROTO(
221 const struct rpc_task *task,
222 struct rpcrdma_mr *mr,
223 int nsegs
226 TP_ARGS(task, mr, nsegs),
228 TP_STRUCT__entry(
229 __field(unsigned int, task_id)
230 __field(unsigned int, client_id)
231 __field(int, nents)
232 __field(u32, handle)
233 __field(u32, length)
234 __field(u64, offset)
235 __field(int, nsegs)
238 TP_fast_assign(
239 __entry->task_id = task->tk_pid;
240 __entry->client_id = task->tk_client->cl_clid;
241 __entry->nents = mr->mr_nents;
242 __entry->handle = mr->mr_handle;
243 __entry->length = mr->mr_length;
244 __entry->offset = mr->mr_offset;
245 __entry->nsegs = nsegs;
248 TP_printk("task:%u@%u %u@0x%016llx:0x%08x (%s)",
249 __entry->task_id, __entry->client_id,
250 __entry->length, (unsigned long long)__entry->offset,
251 __entry->handle,
252 __entry->nents < __entry->nsegs ? "more" : "last"
256 #define DEFINE_WRCH_EVENT(name) \
257 DEFINE_EVENT(xprtrdma_wrch_event, xprtrdma_chunk_##name,\
258 TP_PROTO( \
259 const struct rpc_task *task, \
260 struct rpcrdma_mr *mr, \
261 int nsegs \
262 ), \
263 TP_ARGS(task, mr, nsegs))
265 TRACE_DEFINE_ENUM(DMA_BIDIRECTIONAL);
266 TRACE_DEFINE_ENUM(DMA_TO_DEVICE);
267 TRACE_DEFINE_ENUM(DMA_FROM_DEVICE);
268 TRACE_DEFINE_ENUM(DMA_NONE);
270 #define xprtrdma_show_direction(x) \
271 __print_symbolic(x, \
272 { DMA_BIDIRECTIONAL, "BIDIR" }, \
273 { DMA_TO_DEVICE, "TO_DEVICE" }, \
274 { DMA_FROM_DEVICE, "FROM_DEVICE" }, \
275 { DMA_NONE, "NONE" })
277 DECLARE_EVENT_CLASS(xprtrdma_mr_class,
278 TP_PROTO(
279 const struct rpcrdma_mr *mr
282 TP_ARGS(mr),
284 TP_STRUCT__entry(
285 __field(unsigned int, task_id)
286 __field(unsigned int, client_id)
287 __field(u32, mr_id)
288 __field(int, nents)
289 __field(u32, handle)
290 __field(u32, length)
291 __field(u64, offset)
292 __field(u32, dir)
295 TP_fast_assign(
296 const struct rpcrdma_req *req = mr->mr_req;
297 const struct rpc_task *task = req->rl_slot.rq_task;
299 __entry->task_id = task->tk_pid;
300 __entry->client_id = task->tk_client->cl_clid;
301 __entry->mr_id = mr->frwr.fr_mr->res.id;
302 __entry->nents = mr->mr_nents;
303 __entry->handle = mr->mr_handle;
304 __entry->length = mr->mr_length;
305 __entry->offset = mr->mr_offset;
306 __entry->dir = mr->mr_dir;
309 TP_printk("task:%u@%u mr.id=%u nents=%d %u@0x%016llx:0x%08x (%s)",
310 __entry->task_id, __entry->client_id,
311 __entry->mr_id, __entry->nents, __entry->length,
312 (unsigned long long)__entry->offset, __entry->handle,
313 xprtrdma_show_direction(__entry->dir)
317 #define DEFINE_MR_EVENT(name) \
318 DEFINE_EVENT(xprtrdma_mr_class, \
319 xprtrdma_mr_##name, \
320 TP_PROTO( \
321 const struct rpcrdma_mr *mr \
322 ), \
323 TP_ARGS(mr))
325 DECLARE_EVENT_CLASS(xprtrdma_anonymous_mr_class,
326 TP_PROTO(
327 const struct rpcrdma_mr *mr
330 TP_ARGS(mr),
332 TP_STRUCT__entry(
333 __field(u32, mr_id)
334 __field(int, nents)
335 __field(u32, handle)
336 __field(u32, length)
337 __field(u64, offset)
338 __field(u32, dir)
341 TP_fast_assign(
342 __entry->mr_id = mr->frwr.fr_mr->res.id;
343 __entry->nents = mr->mr_nents;
344 __entry->handle = mr->mr_handle;
345 __entry->length = mr->mr_length;
346 __entry->offset = mr->mr_offset;
347 __entry->dir = mr->mr_dir;
350 TP_printk("mr.id=%u nents=%d %u@0x%016llx:0x%08x (%s)",
351 __entry->mr_id, __entry->nents, __entry->length,
352 (unsigned long long)__entry->offset, __entry->handle,
353 xprtrdma_show_direction(__entry->dir)
357 #define DEFINE_ANON_MR_EVENT(name) \
358 DEFINE_EVENT(xprtrdma_anonymous_mr_class, \
359 xprtrdma_mr_##name, \
360 TP_PROTO( \
361 const struct rpcrdma_mr *mr \
362 ), \
363 TP_ARGS(mr))
365 DECLARE_EVENT_CLASS(xprtrdma_callback_class,
366 TP_PROTO(
367 const struct rpcrdma_xprt *r_xprt,
368 const struct rpc_rqst *rqst
371 TP_ARGS(r_xprt, rqst),
373 TP_STRUCT__entry(
374 __field(u32, xid)
375 __string(addr, rpcrdma_addrstr(r_xprt))
376 __string(port, rpcrdma_portstr(r_xprt))
379 TP_fast_assign(
380 __entry->xid = be32_to_cpu(rqst->rq_xid);
381 __assign_str(addr, rpcrdma_addrstr(r_xprt));
382 __assign_str(port, rpcrdma_portstr(r_xprt));
385 TP_printk("peer=[%s]:%s xid=0x%08x",
386 __get_str(addr), __get_str(port), __entry->xid
390 #define DEFINE_CALLBACK_EVENT(name) \
391 DEFINE_EVENT(xprtrdma_callback_class, \
392 xprtrdma_cb_##name, \
393 TP_PROTO( \
394 const struct rpcrdma_xprt *r_xprt, \
395 const struct rpc_rqst *rqst \
396 ), \
397 TP_ARGS(r_xprt, rqst))
400 ** Connection events
403 TRACE_EVENT(xprtrdma_inline_thresh,
404 TP_PROTO(
405 const struct rpcrdma_ep *ep
408 TP_ARGS(ep),
410 TP_STRUCT__entry(
411 __field(unsigned int, inline_send)
412 __field(unsigned int, inline_recv)
413 __field(unsigned int, max_send)
414 __field(unsigned int, max_recv)
415 __array(unsigned char, srcaddr, sizeof(struct sockaddr_in6))
416 __array(unsigned char, dstaddr, sizeof(struct sockaddr_in6))
419 TP_fast_assign(
420 const struct rdma_cm_id *id = ep->re_id;
422 __entry->inline_send = ep->re_inline_send;
423 __entry->inline_recv = ep->re_inline_recv;
424 __entry->max_send = ep->re_max_inline_send;
425 __entry->max_recv = ep->re_max_inline_recv;
426 memcpy(__entry->srcaddr, &id->route.addr.src_addr,
427 sizeof(struct sockaddr_in6));
428 memcpy(__entry->dstaddr, &id->route.addr.dst_addr,
429 sizeof(struct sockaddr_in6));
432 TP_printk("%pISpc -> %pISpc neg send/recv=%u/%u, calc send/recv=%u/%u",
433 __entry->srcaddr, __entry->dstaddr,
434 __entry->inline_send, __entry->inline_recv,
435 __entry->max_send, __entry->max_recv
439 DEFINE_CONN_EVENT(connect);
440 DEFINE_CONN_EVENT(disconnect);
442 DEFINE_RXPRT_EVENT(xprtrdma_op_inject_dsc);
444 TRACE_EVENT(xprtrdma_op_connect,
445 TP_PROTO(
446 const struct rpcrdma_xprt *r_xprt,
447 unsigned long delay
450 TP_ARGS(r_xprt, delay),
452 TP_STRUCT__entry(
453 __field(const void *, r_xprt)
454 __field(unsigned long, delay)
455 __string(addr, rpcrdma_addrstr(r_xprt))
456 __string(port, rpcrdma_portstr(r_xprt))
459 TP_fast_assign(
460 __entry->r_xprt = r_xprt;
461 __entry->delay = delay;
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 delay=%lu",
467 __get_str(addr), __get_str(port), __entry->r_xprt,
468 __entry->delay
473 TRACE_EVENT(xprtrdma_op_set_cto,
474 TP_PROTO(
475 const struct rpcrdma_xprt *r_xprt,
476 unsigned long connect,
477 unsigned long reconnect
480 TP_ARGS(r_xprt, connect, reconnect),
482 TP_STRUCT__entry(
483 __field(const void *, r_xprt)
484 __field(unsigned long, connect)
485 __field(unsigned long, reconnect)
486 __string(addr, rpcrdma_addrstr(r_xprt))
487 __string(port, rpcrdma_portstr(r_xprt))
490 TP_fast_assign(
491 __entry->r_xprt = r_xprt;
492 __entry->connect = connect;
493 __entry->reconnect = reconnect;
494 __assign_str(addr, rpcrdma_addrstr(r_xprt));
495 __assign_str(port, rpcrdma_portstr(r_xprt));
498 TP_printk("peer=[%s]:%s r_xprt=%p: connect=%lu reconnect=%lu",
499 __get_str(addr), __get_str(port), __entry->r_xprt,
500 __entry->connect / HZ, __entry->reconnect / HZ
504 TRACE_EVENT(xprtrdma_qp_event,
505 TP_PROTO(
506 const struct rpcrdma_ep *ep,
507 const struct ib_event *event
510 TP_ARGS(ep, event),
512 TP_STRUCT__entry(
513 __field(unsigned long, event)
514 __string(name, event->device->name)
515 __array(unsigned char, srcaddr, sizeof(struct sockaddr_in6))
516 __array(unsigned char, dstaddr, sizeof(struct sockaddr_in6))
519 TP_fast_assign(
520 const struct rdma_cm_id *id = ep->re_id;
522 __entry->event = event->event;
523 __assign_str(name, event->device->name);
524 memcpy(__entry->srcaddr, &id->route.addr.src_addr,
525 sizeof(struct sockaddr_in6));
526 memcpy(__entry->dstaddr, &id->route.addr.dst_addr,
527 sizeof(struct sockaddr_in6));
530 TP_printk("%pISpc -> %pISpc device=%s %s (%lu)",
531 __entry->srcaddr, __entry->dstaddr, __get_str(name),
532 rdma_show_ib_event(__entry->event), __entry->event
537 ** Call events
540 TRACE_EVENT(xprtrdma_createmrs,
541 TP_PROTO(
542 const struct rpcrdma_xprt *r_xprt,
543 unsigned int count
546 TP_ARGS(r_xprt, count),
548 TP_STRUCT__entry(
549 __field(const void *, r_xprt)
550 __string(addr, rpcrdma_addrstr(r_xprt))
551 __string(port, rpcrdma_portstr(r_xprt))
552 __field(unsigned int, count)
555 TP_fast_assign(
556 __entry->r_xprt = r_xprt;
557 __entry->count = count;
558 __assign_str(addr, rpcrdma_addrstr(r_xprt));
559 __assign_str(port, rpcrdma_portstr(r_xprt));
562 TP_printk("peer=[%s]:%s r_xprt=%p: created %u MRs",
563 __get_str(addr), __get_str(port), __entry->r_xprt,
564 __entry->count
568 TRACE_EVENT(xprtrdma_nomrs_err,
569 TP_PROTO(
570 const struct rpcrdma_xprt *r_xprt,
571 const struct rpcrdma_req *req
574 TP_ARGS(r_xprt, req),
576 TP_STRUCT__entry(
577 __field(unsigned int, task_id)
578 __field(unsigned int, client_id)
579 __string(addr, rpcrdma_addrstr(r_xprt))
580 __string(port, rpcrdma_portstr(r_xprt))
583 TP_fast_assign(
584 const struct rpc_rqst *rqst = &req->rl_slot;
586 __entry->task_id = rqst->rq_task->tk_pid;
587 __entry->client_id = rqst->rq_task->tk_client->cl_clid;
588 __assign_str(addr, rpcrdma_addrstr(r_xprt));
589 __assign_str(port, rpcrdma_portstr(r_xprt));
592 TP_printk("peer=[%s]:%s task:%u@%u",
593 __get_str(addr), __get_str(port),
594 __entry->task_id, __entry->client_id
598 DEFINE_RDCH_EVENT(read);
599 DEFINE_WRCH_EVENT(write);
600 DEFINE_WRCH_EVENT(reply);
602 TRACE_DEFINE_ENUM(rpcrdma_noch);
603 TRACE_DEFINE_ENUM(rpcrdma_noch_pullup);
604 TRACE_DEFINE_ENUM(rpcrdma_noch_mapped);
605 TRACE_DEFINE_ENUM(rpcrdma_readch);
606 TRACE_DEFINE_ENUM(rpcrdma_areadch);
607 TRACE_DEFINE_ENUM(rpcrdma_writech);
608 TRACE_DEFINE_ENUM(rpcrdma_replych);
610 #define xprtrdma_show_chunktype(x) \
611 __print_symbolic(x, \
612 { rpcrdma_noch, "inline" }, \
613 { rpcrdma_noch_pullup, "pullup" }, \
614 { rpcrdma_noch_mapped, "mapped" }, \
615 { rpcrdma_readch, "read list" }, \
616 { rpcrdma_areadch, "*read list" }, \
617 { rpcrdma_writech, "write list" }, \
618 { rpcrdma_replych, "reply chunk" })
620 TRACE_EVENT(xprtrdma_marshal,
621 TP_PROTO(
622 const struct rpcrdma_req *req,
623 unsigned int rtype,
624 unsigned int wtype
627 TP_ARGS(req, rtype, wtype),
629 TP_STRUCT__entry(
630 __field(unsigned int, task_id)
631 __field(unsigned int, client_id)
632 __field(u32, xid)
633 __field(unsigned int, hdrlen)
634 __field(unsigned int, headlen)
635 __field(unsigned int, pagelen)
636 __field(unsigned int, taillen)
637 __field(unsigned int, rtype)
638 __field(unsigned int, wtype)
641 TP_fast_assign(
642 const struct rpc_rqst *rqst = &req->rl_slot;
644 __entry->task_id = rqst->rq_task->tk_pid;
645 __entry->client_id = rqst->rq_task->tk_client->cl_clid;
646 __entry->xid = be32_to_cpu(rqst->rq_xid);
647 __entry->hdrlen = req->rl_hdrbuf.len;
648 __entry->headlen = rqst->rq_snd_buf.head[0].iov_len;
649 __entry->pagelen = rqst->rq_snd_buf.page_len;
650 __entry->taillen = rqst->rq_snd_buf.tail[0].iov_len;
651 __entry->rtype = rtype;
652 __entry->wtype = wtype;
655 TP_printk("task:%u@%u xid=0x%08x: hdr=%u xdr=%u/%u/%u %s/%s",
656 __entry->task_id, __entry->client_id, __entry->xid,
657 __entry->hdrlen,
658 __entry->headlen, __entry->pagelen, __entry->taillen,
659 xprtrdma_show_chunktype(__entry->rtype),
660 xprtrdma_show_chunktype(__entry->wtype)
664 TRACE_EVENT(xprtrdma_marshal_failed,
665 TP_PROTO(const struct rpc_rqst *rqst,
666 int ret
669 TP_ARGS(rqst, ret),
671 TP_STRUCT__entry(
672 __field(unsigned int, task_id)
673 __field(unsigned int, client_id)
674 __field(u32, xid)
675 __field(int, ret)
678 TP_fast_assign(
679 __entry->task_id = rqst->rq_task->tk_pid;
680 __entry->client_id = rqst->rq_task->tk_client->cl_clid;
681 __entry->xid = be32_to_cpu(rqst->rq_xid);
682 __entry->ret = ret;
685 TP_printk("task:%u@%u xid=0x%08x: ret=%d",
686 __entry->task_id, __entry->client_id, __entry->xid,
687 __entry->ret
691 TRACE_EVENT(xprtrdma_prepsend_failed,
692 TP_PROTO(const struct rpc_rqst *rqst,
693 int ret
696 TP_ARGS(rqst, ret),
698 TP_STRUCT__entry(
699 __field(unsigned int, task_id)
700 __field(unsigned int, client_id)
701 __field(u32, xid)
702 __field(int, ret)
705 TP_fast_assign(
706 __entry->task_id = rqst->rq_task->tk_pid;
707 __entry->client_id = rqst->rq_task->tk_client->cl_clid;
708 __entry->xid = be32_to_cpu(rqst->rq_xid);
709 __entry->ret = ret;
712 TP_printk("task:%u@%u xid=0x%08x: ret=%d",
713 __entry->task_id, __entry->client_id, __entry->xid,
714 __entry->ret
718 TRACE_EVENT(xprtrdma_post_send,
719 TP_PROTO(
720 const struct rpcrdma_req *req
723 TP_ARGS(req),
725 TP_STRUCT__entry(
726 __field(u32, cq_id)
727 __field(int, completion_id)
728 __field(unsigned int, task_id)
729 __field(unsigned int, client_id)
730 __field(int, num_sge)
731 __field(int, signaled)
734 TP_fast_assign(
735 const struct rpc_rqst *rqst = &req->rl_slot;
736 const struct rpcrdma_sendctx *sc = req->rl_sendctx;
738 __entry->cq_id = sc->sc_cid.ci_queue_id;
739 __entry->completion_id = sc->sc_cid.ci_completion_id;
740 __entry->task_id = rqst->rq_task->tk_pid;
741 __entry->client_id = rqst->rq_task->tk_client ?
742 rqst->rq_task->tk_client->cl_clid : -1;
743 __entry->num_sge = req->rl_wr.num_sge;
744 __entry->signaled = req->rl_wr.send_flags & IB_SEND_SIGNALED;
747 TP_printk("task:%u@%u cq.id=%u cid=%d (%d SGE%s) %s",
748 __entry->task_id, __entry->client_id,
749 __entry->cq_id, __entry->completion_id,
750 __entry->num_sge, (__entry->num_sge == 1 ? "" : "s"),
751 (__entry->signaled ? "signaled" : "")
755 TRACE_EVENT(xprtrdma_post_recv,
756 TP_PROTO(
757 const struct rpcrdma_rep *rep
760 TP_ARGS(rep),
762 TP_STRUCT__entry(
763 __field(u32, cq_id)
764 __field(int, completion_id)
767 TP_fast_assign(
768 __entry->cq_id = rep->rr_cid.ci_queue_id;
769 __entry->completion_id = rep->rr_cid.ci_completion_id;
772 TP_printk("cq.id=%d cid=%d",
773 __entry->cq_id, __entry->completion_id
777 TRACE_EVENT(xprtrdma_post_recvs,
778 TP_PROTO(
779 const struct rpcrdma_xprt *r_xprt,
780 unsigned int count,
781 int status
784 TP_ARGS(r_xprt, count, status),
786 TP_STRUCT__entry(
787 __field(const void *, r_xprt)
788 __field(unsigned int, count)
789 __field(int, status)
790 __field(int, posted)
791 __string(addr, rpcrdma_addrstr(r_xprt))
792 __string(port, rpcrdma_portstr(r_xprt))
795 TP_fast_assign(
796 __entry->r_xprt = r_xprt;
797 __entry->count = count;
798 __entry->status = status;
799 __entry->posted = r_xprt->rx_ep->re_receive_count;
800 __assign_str(addr, rpcrdma_addrstr(r_xprt));
801 __assign_str(port, rpcrdma_portstr(r_xprt));
804 TP_printk("peer=[%s]:%s r_xprt=%p: %u new recvs, %d active (rc %d)",
805 __get_str(addr), __get_str(port), __entry->r_xprt,
806 __entry->count, __entry->posted, __entry->status
810 TRACE_EVENT(xprtrdma_post_linv_err,
811 TP_PROTO(
812 const struct rpcrdma_req *req,
813 int status
816 TP_ARGS(req, status),
818 TP_STRUCT__entry(
819 __field(unsigned int, task_id)
820 __field(unsigned int, client_id)
821 __field(int, status)
824 TP_fast_assign(
825 const struct rpc_task *task = req->rl_slot.rq_task;
827 __entry->task_id = task->tk_pid;
828 __entry->client_id = task->tk_client->cl_clid;
829 __entry->status = status;
832 TP_printk("task:%u@%u status=%d",
833 __entry->task_id, __entry->client_id, __entry->status
838 ** Completion events
841 DEFINE_COMPLETION_EVENT(xprtrdma_wc_receive);
842 DEFINE_COMPLETION_EVENT(xprtrdma_wc_send);
843 DEFINE_COMPLETION_EVENT(xprtrdma_wc_fastreg);
844 DEFINE_COMPLETION_EVENT(xprtrdma_wc_li);
845 DEFINE_COMPLETION_EVENT(xprtrdma_wc_li_wake);
846 DEFINE_COMPLETION_EVENT(xprtrdma_wc_li_done);
848 TRACE_EVENT(xprtrdma_frwr_alloc,
849 TP_PROTO(
850 const struct rpcrdma_mr *mr,
851 int rc
854 TP_ARGS(mr, rc),
856 TP_STRUCT__entry(
857 __field(u32, mr_id)
858 __field(int, rc)
861 TP_fast_assign(
862 __entry->mr_id = mr->frwr.fr_mr->res.id;
863 __entry->rc = rc;
866 TP_printk("mr.id=%u: rc=%d",
867 __entry->mr_id, __entry->rc
871 TRACE_EVENT(xprtrdma_frwr_dereg,
872 TP_PROTO(
873 const struct rpcrdma_mr *mr,
874 int rc
877 TP_ARGS(mr, rc),
879 TP_STRUCT__entry(
880 __field(u32, mr_id)
881 __field(int, nents)
882 __field(u32, handle)
883 __field(u32, length)
884 __field(u64, offset)
885 __field(u32, dir)
886 __field(int, rc)
889 TP_fast_assign(
890 __entry->mr_id = mr->frwr.fr_mr->res.id;
891 __entry->nents = mr->mr_nents;
892 __entry->handle = mr->mr_handle;
893 __entry->length = mr->mr_length;
894 __entry->offset = mr->mr_offset;
895 __entry->dir = mr->mr_dir;
896 __entry->rc = rc;
899 TP_printk("mr.id=%u nents=%d %u@0x%016llx:0x%08x (%s): rc=%d",
900 __entry->mr_id, __entry->nents, __entry->length,
901 (unsigned long long)__entry->offset, __entry->handle,
902 xprtrdma_show_direction(__entry->dir),
903 __entry->rc
907 TRACE_EVENT(xprtrdma_frwr_sgerr,
908 TP_PROTO(
909 const struct rpcrdma_mr *mr,
910 int sg_nents
913 TP_ARGS(mr, sg_nents),
915 TP_STRUCT__entry(
916 __field(u32, mr_id)
917 __field(u64, addr)
918 __field(u32, dir)
919 __field(int, nents)
922 TP_fast_assign(
923 __entry->mr_id = mr->frwr.fr_mr->res.id;
924 __entry->addr = mr->mr_sg->dma_address;
925 __entry->dir = mr->mr_dir;
926 __entry->nents = sg_nents;
929 TP_printk("mr.id=%u DMA addr=0x%llx (%s) sg_nents=%d",
930 __entry->mr_id, __entry->addr,
931 xprtrdma_show_direction(__entry->dir),
932 __entry->nents
936 TRACE_EVENT(xprtrdma_frwr_maperr,
937 TP_PROTO(
938 const struct rpcrdma_mr *mr,
939 int num_mapped
942 TP_ARGS(mr, num_mapped),
944 TP_STRUCT__entry(
945 __field(u32, mr_id)
946 __field(u64, addr)
947 __field(u32, dir)
948 __field(int, num_mapped)
949 __field(int, nents)
952 TP_fast_assign(
953 __entry->mr_id = mr->frwr.fr_mr->res.id;
954 __entry->addr = mr->mr_sg->dma_address;
955 __entry->dir = mr->mr_dir;
956 __entry->num_mapped = num_mapped;
957 __entry->nents = mr->mr_nents;
960 TP_printk("mr.id=%u DMA addr=0x%llx (%s) nents=%d of %d",
961 __entry->mr_id, __entry->addr,
962 xprtrdma_show_direction(__entry->dir),
963 __entry->num_mapped, __entry->nents
967 DEFINE_MR_EVENT(localinv);
968 DEFINE_MR_EVENT(map);
970 DEFINE_ANON_MR_EVENT(unmap);
971 DEFINE_ANON_MR_EVENT(recycle);
973 TRACE_EVENT(xprtrdma_dma_maperr,
974 TP_PROTO(
975 u64 addr
978 TP_ARGS(addr),
980 TP_STRUCT__entry(
981 __field(u64, addr)
984 TP_fast_assign(
985 __entry->addr = addr;
988 TP_printk("dma addr=0x%llx\n", __entry->addr)
992 ** Reply events
995 TRACE_EVENT(xprtrdma_reply,
996 TP_PROTO(
997 const struct rpc_task *task,
998 const struct rpcrdma_rep *rep,
999 unsigned int credits
1002 TP_ARGS(task, rep, credits),
1004 TP_STRUCT__entry(
1005 __field(unsigned int, task_id)
1006 __field(unsigned int, client_id)
1007 __field(u32, xid)
1008 __field(unsigned int, credits)
1011 TP_fast_assign(
1012 __entry->task_id = task->tk_pid;
1013 __entry->client_id = task->tk_client->cl_clid;
1014 __entry->xid = be32_to_cpu(rep->rr_xid);
1015 __entry->credits = credits;
1018 TP_printk("task:%u@%u xid=0x%08x credits=%u",
1019 __entry->task_id, __entry->client_id, __entry->xid,
1020 __entry->credits
1024 DEFINE_REPLY_EVENT(vers);
1025 DEFINE_REPLY_EVENT(rqst);
1026 DEFINE_REPLY_EVENT(short);
1027 DEFINE_REPLY_EVENT(hdr);
1029 TRACE_EVENT(xprtrdma_err_vers,
1030 TP_PROTO(
1031 const struct rpc_rqst *rqst,
1032 __be32 *min,
1033 __be32 *max
1036 TP_ARGS(rqst, min, max),
1038 TP_STRUCT__entry(
1039 __field(unsigned int, task_id)
1040 __field(unsigned int, client_id)
1041 __field(u32, xid)
1042 __field(u32, min)
1043 __field(u32, max)
1046 TP_fast_assign(
1047 __entry->task_id = rqst->rq_task->tk_pid;
1048 __entry->client_id = rqst->rq_task->tk_client->cl_clid;
1049 __entry->xid = be32_to_cpu(rqst->rq_xid);
1050 __entry->min = be32_to_cpup(min);
1051 __entry->max = be32_to_cpup(max);
1054 TP_printk("task:%u@%u xid=0x%08x versions=[%u, %u]",
1055 __entry->task_id, __entry->client_id, __entry->xid,
1056 __entry->min, __entry->max
1060 TRACE_EVENT(xprtrdma_err_chunk,
1061 TP_PROTO(
1062 const struct rpc_rqst *rqst
1065 TP_ARGS(rqst),
1067 TP_STRUCT__entry(
1068 __field(unsigned int, task_id)
1069 __field(unsigned int, client_id)
1070 __field(u32, xid)
1073 TP_fast_assign(
1074 __entry->task_id = rqst->rq_task->tk_pid;
1075 __entry->client_id = rqst->rq_task->tk_client->cl_clid;
1076 __entry->xid = be32_to_cpu(rqst->rq_xid);
1079 TP_printk("task:%u@%u xid=0x%08x",
1080 __entry->task_id, __entry->client_id, __entry->xid
1084 TRACE_EVENT(xprtrdma_err_unrecognized,
1085 TP_PROTO(
1086 const struct rpc_rqst *rqst,
1087 __be32 *procedure
1090 TP_ARGS(rqst, procedure),
1092 TP_STRUCT__entry(
1093 __field(unsigned int, task_id)
1094 __field(unsigned int, client_id)
1095 __field(u32, xid)
1096 __field(u32, procedure)
1099 TP_fast_assign(
1100 __entry->task_id = rqst->rq_task->tk_pid;
1101 __entry->client_id = rqst->rq_task->tk_client->cl_clid;
1102 __entry->procedure = be32_to_cpup(procedure);
1105 TP_printk("task:%u@%u xid=0x%08x procedure=%u",
1106 __entry->task_id, __entry->client_id, __entry->xid,
1107 __entry->procedure
1111 TRACE_EVENT(xprtrdma_fixup,
1112 TP_PROTO(
1113 const struct rpc_rqst *rqst,
1114 unsigned long fixup
1117 TP_ARGS(rqst, fixup),
1119 TP_STRUCT__entry(
1120 __field(unsigned int, task_id)
1121 __field(unsigned int, client_id)
1122 __field(unsigned long, fixup)
1123 __field(size_t, headlen)
1124 __field(unsigned int, pagelen)
1125 __field(size_t, taillen)
1128 TP_fast_assign(
1129 __entry->task_id = rqst->rq_task->tk_pid;
1130 __entry->client_id = rqst->rq_task->tk_client->cl_clid;
1131 __entry->fixup = fixup;
1132 __entry->headlen = rqst->rq_rcv_buf.head[0].iov_len;
1133 __entry->pagelen = rqst->rq_rcv_buf.page_len;
1134 __entry->taillen = rqst->rq_rcv_buf.tail[0].iov_len;
1137 TP_printk("task:%u@%u fixup=%lu xdr=%zu/%u/%zu",
1138 __entry->task_id, __entry->client_id, __entry->fixup,
1139 __entry->headlen, __entry->pagelen, __entry->taillen
1143 TRACE_EVENT(xprtrdma_decode_seg,
1144 TP_PROTO(
1145 u32 handle,
1146 u32 length,
1147 u64 offset
1150 TP_ARGS(handle, length, offset),
1152 TP_STRUCT__entry(
1153 __field(u32, handle)
1154 __field(u32, length)
1155 __field(u64, offset)
1158 TP_fast_assign(
1159 __entry->handle = handle;
1160 __entry->length = length;
1161 __entry->offset = offset;
1164 TP_printk("%u@0x%016llx:0x%08x",
1165 __entry->length, (unsigned long long)__entry->offset,
1166 __entry->handle
1170 TRACE_EVENT(xprtrdma_mrs_zap,
1171 TP_PROTO(
1172 const struct rpc_task *task
1175 TP_ARGS(task),
1177 TP_STRUCT__entry(
1178 __field(unsigned int, task_id)
1179 __field(unsigned int, client_id)
1182 TP_fast_assign(
1183 __entry->task_id = task->tk_pid;
1184 __entry->client_id = task->tk_client->cl_clid;
1187 TP_printk("task:%u@%u",
1188 __entry->task_id, __entry->client_id
1193 ** Callback events
1196 TRACE_EVENT(xprtrdma_cb_setup,
1197 TP_PROTO(
1198 const struct rpcrdma_xprt *r_xprt,
1199 unsigned int reqs
1202 TP_ARGS(r_xprt, reqs),
1204 TP_STRUCT__entry(
1205 __field(const void *, r_xprt)
1206 __field(unsigned int, reqs)
1207 __string(addr, rpcrdma_addrstr(r_xprt))
1208 __string(port, rpcrdma_portstr(r_xprt))
1211 TP_fast_assign(
1212 __entry->r_xprt = r_xprt;
1213 __entry->reqs = reqs;
1214 __assign_str(addr, rpcrdma_addrstr(r_xprt));
1215 __assign_str(port, rpcrdma_portstr(r_xprt));
1218 TP_printk("peer=[%s]:%s r_xprt=%p: %u reqs",
1219 __get_str(addr), __get_str(port),
1220 __entry->r_xprt, __entry->reqs
1224 DEFINE_CALLBACK_EVENT(call);
1225 DEFINE_CALLBACK_EVENT(reply);
1228 ** Server-side RPC/RDMA events
1231 DECLARE_EVENT_CLASS(svcrdma_accept_class,
1232 TP_PROTO(
1233 const struct svcxprt_rdma *rdma,
1234 long status
1237 TP_ARGS(rdma, status),
1239 TP_STRUCT__entry(
1240 __field(long, status)
1241 __string(addr, rdma->sc_xprt.xpt_remotebuf)
1244 TP_fast_assign(
1245 __entry->status = status;
1246 __assign_str(addr, rdma->sc_xprt.xpt_remotebuf);
1249 TP_printk("addr=%s status=%ld",
1250 __get_str(addr), __entry->status
1254 #define DEFINE_ACCEPT_EVENT(name) \
1255 DEFINE_EVENT(svcrdma_accept_class, svcrdma_##name##_err, \
1256 TP_PROTO( \
1257 const struct svcxprt_rdma *rdma, \
1258 long status \
1259 ), \
1260 TP_ARGS(rdma, status))
1262 DEFINE_ACCEPT_EVENT(pd);
1263 DEFINE_ACCEPT_EVENT(qp);
1264 DEFINE_ACCEPT_EVENT(fabric);
1265 DEFINE_ACCEPT_EVENT(initdepth);
1266 DEFINE_ACCEPT_EVENT(accept);
1268 TRACE_DEFINE_ENUM(RDMA_MSG);
1269 TRACE_DEFINE_ENUM(RDMA_NOMSG);
1270 TRACE_DEFINE_ENUM(RDMA_MSGP);
1271 TRACE_DEFINE_ENUM(RDMA_DONE);
1272 TRACE_DEFINE_ENUM(RDMA_ERROR);
1274 #define show_rpcrdma_proc(x) \
1275 __print_symbolic(x, \
1276 { RDMA_MSG, "RDMA_MSG" }, \
1277 { RDMA_NOMSG, "RDMA_NOMSG" }, \
1278 { RDMA_MSGP, "RDMA_MSGP" }, \
1279 { RDMA_DONE, "RDMA_DONE" }, \
1280 { RDMA_ERROR, "RDMA_ERROR" })
1282 TRACE_EVENT(svcrdma_decode_rqst,
1283 TP_PROTO(
1284 const struct svc_rdma_recv_ctxt *ctxt,
1285 __be32 *p,
1286 unsigned int hdrlen
1289 TP_ARGS(ctxt, p, hdrlen),
1291 TP_STRUCT__entry(
1292 __field(u32, cq_id)
1293 __field(int, completion_id)
1294 __field(u32, xid)
1295 __field(u32, vers)
1296 __field(u32, proc)
1297 __field(u32, credits)
1298 __field(unsigned int, hdrlen)
1301 TP_fast_assign(
1302 __entry->cq_id = ctxt->rc_cid.ci_queue_id;
1303 __entry->completion_id = ctxt->rc_cid.ci_completion_id;
1304 __entry->xid = be32_to_cpup(p++);
1305 __entry->vers = be32_to_cpup(p++);
1306 __entry->credits = be32_to_cpup(p++);
1307 __entry->proc = be32_to_cpup(p);
1308 __entry->hdrlen = hdrlen;
1311 TP_printk("cq.id=%u cid=%d xid=0x%08x vers=%u credits=%u proc=%s hdrlen=%u",
1312 __entry->cq_id, __entry->completion_id,
1313 __entry->xid, __entry->vers, __entry->credits,
1314 show_rpcrdma_proc(__entry->proc), __entry->hdrlen)
1317 TRACE_EVENT(svcrdma_decode_short_err,
1318 TP_PROTO(
1319 const struct svc_rdma_recv_ctxt *ctxt,
1320 unsigned int hdrlen
1323 TP_ARGS(ctxt, hdrlen),
1325 TP_STRUCT__entry(
1326 __field(u32, cq_id)
1327 __field(int, completion_id)
1328 __field(unsigned int, hdrlen)
1331 TP_fast_assign(
1332 __entry->cq_id = ctxt->rc_cid.ci_queue_id;
1333 __entry->completion_id = ctxt->rc_cid.ci_completion_id;
1334 __entry->hdrlen = hdrlen;
1337 TP_printk("cq.id=%u cid=%d hdrlen=%u",
1338 __entry->cq_id, __entry->completion_id,
1339 __entry->hdrlen)
1342 DECLARE_EVENT_CLASS(svcrdma_badreq_event,
1343 TP_PROTO(
1344 const struct svc_rdma_recv_ctxt *ctxt,
1345 __be32 *p
1348 TP_ARGS(ctxt, p),
1350 TP_STRUCT__entry(
1351 __field(u32, cq_id)
1352 __field(int, completion_id)
1353 __field(u32, xid)
1354 __field(u32, vers)
1355 __field(u32, proc)
1356 __field(u32, credits)
1359 TP_fast_assign(
1360 __entry->cq_id = ctxt->rc_cid.ci_queue_id;
1361 __entry->completion_id = ctxt->rc_cid.ci_completion_id;
1362 __entry->xid = be32_to_cpup(p++);
1363 __entry->vers = be32_to_cpup(p++);
1364 __entry->credits = be32_to_cpup(p++);
1365 __entry->proc = be32_to_cpup(p);
1368 TP_printk("cq.id=%u cid=%d xid=0x%08x vers=%u credits=%u proc=%u",
1369 __entry->cq_id, __entry->completion_id,
1370 __entry->xid, __entry->vers, __entry->credits, __entry->proc)
1373 #define DEFINE_BADREQ_EVENT(name) \
1374 DEFINE_EVENT(svcrdma_badreq_event, \
1375 svcrdma_decode_##name##_err, \
1376 TP_PROTO( \
1377 const struct svc_rdma_recv_ctxt *ctxt, \
1378 __be32 *p \
1379 ), \
1380 TP_ARGS(ctxt, p))
1382 DEFINE_BADREQ_EVENT(badvers);
1383 DEFINE_BADREQ_EVENT(drop);
1384 DEFINE_BADREQ_EVENT(badproc);
1385 DEFINE_BADREQ_EVENT(parse);
1387 TRACE_EVENT(svcrdma_encode_wseg,
1388 TP_PROTO(
1389 const struct svc_rdma_send_ctxt *ctxt,
1390 u32 segno,
1391 u32 handle,
1392 u32 length,
1393 u64 offset
1396 TP_ARGS(ctxt, segno, handle, length, offset),
1398 TP_STRUCT__entry(
1399 __field(u32, cq_id)
1400 __field(int, completion_id)
1401 __field(u32, segno)
1402 __field(u32, handle)
1403 __field(u32, length)
1404 __field(u64, offset)
1407 TP_fast_assign(
1408 __entry->cq_id = ctxt->sc_cid.ci_queue_id;
1409 __entry->completion_id = ctxt->sc_cid.ci_completion_id;
1410 __entry->segno = segno;
1411 __entry->handle = handle;
1412 __entry->length = length;
1413 __entry->offset = offset;
1416 TP_printk("cq_id=%u cid=%d segno=%u %u@0x%016llx:0x%08x",
1417 __entry->cq_id, __entry->completion_id,
1418 __entry->segno, __entry->length,
1419 (unsigned long long)__entry->offset, __entry->handle
1423 TRACE_EVENT(svcrdma_decode_rseg,
1424 TP_PROTO(
1425 const struct rpc_rdma_cid *cid,
1426 const struct svc_rdma_chunk *chunk,
1427 const struct svc_rdma_segment *segment
1430 TP_ARGS(cid, chunk, segment),
1432 TP_STRUCT__entry(
1433 __field(u32, cq_id)
1434 __field(int, completion_id)
1435 __field(u32, segno)
1436 __field(u32, position)
1437 __field(u32, handle)
1438 __field(u32, length)
1439 __field(u64, offset)
1442 TP_fast_assign(
1443 __entry->cq_id = cid->ci_queue_id;
1444 __entry->completion_id = cid->ci_completion_id;
1445 __entry->segno = chunk->ch_segcount;
1446 __entry->position = chunk->ch_position;
1447 __entry->handle = segment->rs_handle;
1448 __entry->length = segment->rs_length;
1449 __entry->offset = segment->rs_offset;
1452 TP_printk("cq_id=%u cid=%d segno=%u position=%u %u@0x%016llx:0x%08x",
1453 __entry->cq_id, __entry->completion_id,
1454 __entry->segno, __entry->position, __entry->length,
1455 (unsigned long long)__entry->offset, __entry->handle
1459 TRACE_EVENT(svcrdma_decode_wseg,
1460 TP_PROTO(
1461 const struct rpc_rdma_cid *cid,
1462 const struct svc_rdma_chunk *chunk,
1463 u32 segno
1466 TP_ARGS(cid, chunk, segno),
1468 TP_STRUCT__entry(
1469 __field(u32, cq_id)
1470 __field(int, completion_id)
1471 __field(u32, segno)
1472 __field(u32, handle)
1473 __field(u32, length)
1474 __field(u64, offset)
1477 TP_fast_assign(
1478 const struct svc_rdma_segment *segment =
1479 &chunk->ch_segments[segno];
1481 __entry->cq_id = cid->ci_queue_id;
1482 __entry->completion_id = cid->ci_completion_id;
1483 __entry->segno = segno;
1484 __entry->handle = segment->rs_handle;
1485 __entry->length = segment->rs_length;
1486 __entry->offset = segment->rs_offset;
1489 TP_printk("cq_id=%u cid=%d segno=%u %u@0x%016llx:0x%08x",
1490 __entry->cq_id, __entry->completion_id,
1491 __entry->segno, __entry->length,
1492 (unsigned long long)__entry->offset, __entry->handle
1496 DECLARE_EVENT_CLASS(svcrdma_error_event,
1497 TP_PROTO(
1498 __be32 xid
1501 TP_ARGS(xid),
1503 TP_STRUCT__entry(
1504 __field(u32, xid)
1507 TP_fast_assign(
1508 __entry->xid = be32_to_cpu(xid);
1511 TP_printk("xid=0x%08x",
1512 __entry->xid
1516 #define DEFINE_ERROR_EVENT(name) \
1517 DEFINE_EVENT(svcrdma_error_event, svcrdma_err_##name, \
1518 TP_PROTO( \
1519 __be32 xid \
1520 ), \
1521 TP_ARGS(xid))
1523 DEFINE_ERROR_EVENT(vers);
1524 DEFINE_ERROR_EVENT(chunk);
1527 ** Server-side RDMA API events
1530 DECLARE_EVENT_CLASS(svcrdma_dma_map_class,
1531 TP_PROTO(
1532 const struct svcxprt_rdma *rdma,
1533 u64 dma_addr,
1534 u32 length
1537 TP_ARGS(rdma, dma_addr, length),
1539 TP_STRUCT__entry(
1540 __field(u64, dma_addr)
1541 __field(u32, length)
1542 __string(device, rdma->sc_cm_id->device->name)
1543 __string(addr, rdma->sc_xprt.xpt_remotebuf)
1546 TP_fast_assign(
1547 __entry->dma_addr = dma_addr;
1548 __entry->length = length;
1549 __assign_str(device, rdma->sc_cm_id->device->name);
1550 __assign_str(addr, rdma->sc_xprt.xpt_remotebuf);
1553 TP_printk("addr=%s device=%s dma_addr=%llu length=%u",
1554 __get_str(addr), __get_str(device),
1555 __entry->dma_addr, __entry->length
1559 #define DEFINE_SVC_DMA_EVENT(name) \
1560 DEFINE_EVENT(svcrdma_dma_map_class, svcrdma_##name, \
1561 TP_PROTO( \
1562 const struct svcxprt_rdma *rdma,\
1563 u64 dma_addr, \
1564 u32 length \
1565 ), \
1566 TP_ARGS(rdma, dma_addr, length))
1568 DEFINE_SVC_DMA_EVENT(dma_map_page);
1569 DEFINE_SVC_DMA_EVENT(dma_map_err);
1570 DEFINE_SVC_DMA_EVENT(dma_unmap_page);
1572 TRACE_EVENT(svcrdma_dma_map_rw_err,
1573 TP_PROTO(
1574 const struct svcxprt_rdma *rdma,
1575 unsigned int nents,
1576 int status
1579 TP_ARGS(rdma, nents, status),
1581 TP_STRUCT__entry(
1582 __field(int, status)
1583 __field(unsigned int, nents)
1584 __string(device, rdma->sc_cm_id->device->name)
1585 __string(addr, rdma->sc_xprt.xpt_remotebuf)
1588 TP_fast_assign(
1589 __entry->status = status;
1590 __entry->nents = nents;
1591 __assign_str(device, rdma->sc_cm_id->device->name);
1592 __assign_str(addr, rdma->sc_xprt.xpt_remotebuf);
1595 TP_printk("addr=%s device=%s nents=%u status=%d",
1596 __get_str(addr), __get_str(device), __entry->nents,
1597 __entry->status
1601 TRACE_EVENT(svcrdma_no_rwctx_err,
1602 TP_PROTO(
1603 const struct svcxprt_rdma *rdma,
1604 unsigned int num_sges
1607 TP_ARGS(rdma, num_sges),
1609 TP_STRUCT__entry(
1610 __field(unsigned int, num_sges)
1611 __string(device, rdma->sc_cm_id->device->name)
1612 __string(addr, rdma->sc_xprt.xpt_remotebuf)
1615 TP_fast_assign(
1616 __entry->num_sges = num_sges;
1617 __assign_str(device, rdma->sc_cm_id->device->name);
1618 __assign_str(addr, rdma->sc_xprt.xpt_remotebuf);
1621 TP_printk("addr=%s device=%s num_sges=%d",
1622 __get_str(addr), __get_str(device), __entry->num_sges
1626 TRACE_EVENT(svcrdma_page_overrun_err,
1627 TP_PROTO(
1628 const struct svcxprt_rdma *rdma,
1629 const struct svc_rqst *rqst,
1630 unsigned int pageno
1633 TP_ARGS(rdma, rqst, pageno),
1635 TP_STRUCT__entry(
1636 __field(unsigned int, pageno)
1637 __field(u32, xid)
1638 __string(device, rdma->sc_cm_id->device->name)
1639 __string(addr, rdma->sc_xprt.xpt_remotebuf)
1642 TP_fast_assign(
1643 __entry->pageno = pageno;
1644 __entry->xid = __be32_to_cpu(rqst->rq_xid);
1645 __assign_str(device, rdma->sc_cm_id->device->name);
1646 __assign_str(addr, rdma->sc_xprt.xpt_remotebuf);
1649 TP_printk("addr=%s device=%s xid=0x%08x pageno=%u", __get_str(addr),
1650 __get_str(device), __entry->xid, __entry->pageno
1654 TRACE_EVENT(svcrdma_small_wrch_err,
1655 TP_PROTO(
1656 const struct svcxprt_rdma *rdma,
1657 unsigned int remaining,
1658 unsigned int seg_no,
1659 unsigned int num_segs
1662 TP_ARGS(rdma, remaining, seg_no, num_segs),
1664 TP_STRUCT__entry(
1665 __field(unsigned int, remaining)
1666 __field(unsigned int, seg_no)
1667 __field(unsigned int, num_segs)
1668 __string(device, rdma->sc_cm_id->device->name)
1669 __string(addr, rdma->sc_xprt.xpt_remotebuf)
1672 TP_fast_assign(
1673 __entry->remaining = remaining;
1674 __entry->seg_no = seg_no;
1675 __entry->num_segs = num_segs;
1676 __assign_str(device, rdma->sc_cm_id->device->name);
1677 __assign_str(addr, rdma->sc_xprt.xpt_remotebuf);
1680 TP_printk("addr=%s device=%s remaining=%u seg_no=%u num_segs=%u",
1681 __get_str(addr), __get_str(device), __entry->remaining,
1682 __entry->seg_no, __entry->num_segs
1686 TRACE_EVENT(svcrdma_send_pullup,
1687 TP_PROTO(
1688 const struct svc_rdma_send_ctxt *ctxt,
1689 unsigned int msglen
1692 TP_ARGS(ctxt, msglen),
1694 TP_STRUCT__entry(
1695 __field(u32, cq_id)
1696 __field(int, completion_id)
1697 __field(unsigned int, hdrlen)
1698 __field(unsigned int, msglen)
1701 TP_fast_assign(
1702 __entry->cq_id = ctxt->sc_cid.ci_queue_id;
1703 __entry->completion_id = ctxt->sc_cid.ci_completion_id;
1704 __entry->hdrlen = ctxt->sc_hdrbuf.len,
1705 __entry->msglen = msglen;
1708 TP_printk("cq_id=%u cid=%d hdr=%u msg=%u (total %u)",
1709 __entry->cq_id, __entry->completion_id,
1710 __entry->hdrlen, __entry->msglen,
1711 __entry->hdrlen + __entry->msglen)
1714 TRACE_EVENT(svcrdma_send_err,
1715 TP_PROTO(
1716 const struct svc_rqst *rqst,
1717 int status
1720 TP_ARGS(rqst, status),
1722 TP_STRUCT__entry(
1723 __field(int, status)
1724 __field(u32, xid)
1725 __string(addr, rqst->rq_xprt->xpt_remotebuf)
1728 TP_fast_assign(
1729 __entry->status = status;
1730 __entry->xid = __be32_to_cpu(rqst->rq_xid);
1731 __assign_str(addr, rqst->rq_xprt->xpt_remotebuf);
1734 TP_printk("addr=%s xid=0x%08x status=%d", __get_str(addr),
1735 __entry->xid, __entry->status
1739 TRACE_EVENT(svcrdma_post_send,
1740 TP_PROTO(
1741 const struct svc_rdma_send_ctxt *ctxt
1744 TP_ARGS(ctxt),
1746 TP_STRUCT__entry(
1747 __field(u32, cq_id)
1748 __field(int, completion_id)
1749 __field(unsigned int, num_sge)
1750 __field(u32, inv_rkey)
1753 TP_fast_assign(
1754 const struct ib_send_wr *wr = &ctxt->sc_send_wr;
1756 __entry->cq_id = ctxt->sc_cid.ci_queue_id;
1757 __entry->completion_id = ctxt->sc_cid.ci_completion_id;
1758 __entry->num_sge = wr->num_sge;
1759 __entry->inv_rkey = (wr->opcode == IB_WR_SEND_WITH_INV) ?
1760 wr->ex.invalidate_rkey : 0;
1763 TP_printk("cq_id=%u cid=%d num_sge=%u inv_rkey=0x%08x",
1764 __entry->cq_id, __entry->completion_id,
1765 __entry->num_sge, __entry->inv_rkey
1769 DEFINE_COMPLETION_EVENT(svcrdma_wc_send);
1771 TRACE_EVENT(svcrdma_post_recv,
1772 TP_PROTO(
1773 const struct svc_rdma_recv_ctxt *ctxt
1776 TP_ARGS(ctxt),
1778 TP_STRUCT__entry(
1779 __field(u32, cq_id)
1780 __field(int, completion_id)
1783 TP_fast_assign(
1784 __entry->cq_id = ctxt->rc_cid.ci_queue_id;
1785 __entry->completion_id = ctxt->rc_cid.ci_completion_id;
1788 TP_printk("cq.id=%d cid=%d",
1789 __entry->cq_id, __entry->completion_id
1793 DEFINE_COMPLETION_EVENT(svcrdma_wc_receive);
1795 TRACE_EVENT(svcrdma_rq_post_err,
1796 TP_PROTO(
1797 const struct svcxprt_rdma *rdma,
1798 int status
1801 TP_ARGS(rdma, status),
1803 TP_STRUCT__entry(
1804 __field(int, status)
1805 __string(addr, rdma->sc_xprt.xpt_remotebuf)
1808 TP_fast_assign(
1809 __entry->status = status;
1810 __assign_str(addr, rdma->sc_xprt.xpt_remotebuf);
1813 TP_printk("addr=%s status=%d",
1814 __get_str(addr), __entry->status
1818 DECLARE_EVENT_CLASS(svcrdma_post_chunk_class,
1819 TP_PROTO(
1820 const struct rpc_rdma_cid *cid,
1821 int sqecount
1824 TP_ARGS(cid, sqecount),
1826 TP_STRUCT__entry(
1827 __field(u32, cq_id)
1828 __field(int, completion_id)
1829 __field(int, sqecount)
1832 TP_fast_assign(
1833 __entry->cq_id = cid->ci_queue_id;
1834 __entry->completion_id = cid->ci_completion_id;
1835 __entry->sqecount = sqecount;
1838 TP_printk("cq.id=%u cid=%d sqecount=%d",
1839 __entry->cq_id, __entry->completion_id,
1840 __entry->sqecount
1844 #define DEFINE_POST_CHUNK_EVENT(name) \
1845 DEFINE_EVENT(svcrdma_post_chunk_class, \
1846 svcrdma_post_##name##_chunk, \
1847 TP_PROTO( \
1848 const struct rpc_rdma_cid *cid, \
1849 int sqecount \
1850 ), \
1851 TP_ARGS(cid, sqecount))
1853 DEFINE_POST_CHUNK_EVENT(read);
1854 DEFINE_POST_CHUNK_EVENT(write);
1855 DEFINE_POST_CHUNK_EVENT(reply);
1857 DEFINE_COMPLETION_EVENT(svcrdma_wc_read);
1858 DEFINE_COMPLETION_EVENT(svcrdma_wc_write);
1860 TRACE_EVENT(svcrdma_qp_error,
1861 TP_PROTO(
1862 const struct ib_event *event,
1863 const struct sockaddr *sap
1866 TP_ARGS(event, sap),
1868 TP_STRUCT__entry(
1869 __field(unsigned int, event)
1870 __string(device, event->device->name)
1871 __array(__u8, addr, INET6_ADDRSTRLEN + 10)
1874 TP_fast_assign(
1875 __entry->event = event->event;
1876 __assign_str(device, event->device->name);
1877 snprintf(__entry->addr, sizeof(__entry->addr) - 1,
1878 "%pISpc", sap);
1881 TP_printk("addr=%s dev=%s event=%s (%u)",
1882 __entry->addr, __get_str(device),
1883 rdma_show_ib_event(__entry->event), __entry->event
1887 DECLARE_EVENT_CLASS(svcrdma_sendqueue_event,
1888 TP_PROTO(
1889 const struct svcxprt_rdma *rdma
1892 TP_ARGS(rdma),
1894 TP_STRUCT__entry(
1895 __field(int, avail)
1896 __field(int, depth)
1897 __string(addr, rdma->sc_xprt.xpt_remotebuf)
1900 TP_fast_assign(
1901 __entry->avail = atomic_read(&rdma->sc_sq_avail);
1902 __entry->depth = rdma->sc_sq_depth;
1903 __assign_str(addr, rdma->sc_xprt.xpt_remotebuf);
1906 TP_printk("addr=%s sc_sq_avail=%d/%d",
1907 __get_str(addr), __entry->avail, __entry->depth
1911 #define DEFINE_SQ_EVENT(name) \
1912 DEFINE_EVENT(svcrdma_sendqueue_event, svcrdma_sq_##name,\
1913 TP_PROTO( \
1914 const struct svcxprt_rdma *rdma \
1915 ), \
1916 TP_ARGS(rdma))
1918 DEFINE_SQ_EVENT(full);
1919 DEFINE_SQ_EVENT(retry);
1921 TRACE_EVENT(svcrdma_sq_post_err,
1922 TP_PROTO(
1923 const struct svcxprt_rdma *rdma,
1924 int status
1927 TP_ARGS(rdma, status),
1929 TP_STRUCT__entry(
1930 __field(int, avail)
1931 __field(int, depth)
1932 __field(int, status)
1933 __string(addr, rdma->sc_xprt.xpt_remotebuf)
1936 TP_fast_assign(
1937 __entry->avail = atomic_read(&rdma->sc_sq_avail);
1938 __entry->depth = rdma->sc_sq_depth;
1939 __entry->status = status;
1940 __assign_str(addr, rdma->sc_xprt.xpt_remotebuf);
1943 TP_printk("addr=%s sc_sq_avail=%d/%d status=%d",
1944 __get_str(addr), __entry->avail, __entry->depth,
1945 __entry->status
1949 #endif /* _TRACE_RPCRDMA_H */
1951 #include <trace/define_trace.h>