drm/panfrost: Remove set but not used variable 'bo'
[linux/fpc-iii.git] / include / trace / events / rpcrdma.h
blobc0e4c93324f57ab40b3cf0986c06d05cd6c0fb02
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_connect_class,
89 TP_PROTO(
90 const struct rpcrdma_xprt *r_xprt,
91 int rc
94 TP_ARGS(r_xprt, rc),
96 TP_STRUCT__entry(
97 __field(const void *, r_xprt)
98 __field(int, rc)
99 __field(int, connect_status)
100 __string(addr, rpcrdma_addrstr(r_xprt))
101 __string(port, rpcrdma_portstr(r_xprt))
104 TP_fast_assign(
105 __entry->r_xprt = r_xprt;
106 __entry->rc = rc;
107 __entry->connect_status = r_xprt->rx_ep.rep_connected;
108 __assign_str(addr, rpcrdma_addrstr(r_xprt));
109 __assign_str(port, rpcrdma_portstr(r_xprt));
112 TP_printk("peer=[%s]:%s r_xprt=%p: rc=%d connect status=%d",
113 __get_str(addr), __get_str(port), __entry->r_xprt,
114 __entry->rc, __entry->connect_status
118 #define DEFINE_CONN_EVENT(name) \
119 DEFINE_EVENT(xprtrdma_connect_class, xprtrdma_##name, \
120 TP_PROTO( \
121 const struct rpcrdma_xprt *r_xprt, \
122 int rc \
123 ), \
124 TP_ARGS(r_xprt, rc))
126 DECLARE_EVENT_CLASS(xprtrdma_rdch_event,
127 TP_PROTO(
128 const struct rpc_task *task,
129 unsigned int pos,
130 struct rpcrdma_mr *mr,
131 int nsegs
134 TP_ARGS(task, pos, mr, nsegs),
136 TP_STRUCT__entry(
137 __field(unsigned int, task_id)
138 __field(unsigned int, client_id)
139 __field(unsigned int, pos)
140 __field(int, nents)
141 __field(u32, handle)
142 __field(u32, length)
143 __field(u64, offset)
144 __field(int, nsegs)
147 TP_fast_assign(
148 __entry->task_id = task->tk_pid;
149 __entry->client_id = task->tk_client->cl_clid;
150 __entry->pos = pos;
151 __entry->nents = mr->mr_nents;
152 __entry->handle = mr->mr_handle;
153 __entry->length = mr->mr_length;
154 __entry->offset = mr->mr_offset;
155 __entry->nsegs = nsegs;
158 TP_printk("task:%u@%u pos=%u %u@0x%016llx:0x%08x (%s)",
159 __entry->task_id, __entry->client_id,
160 __entry->pos, __entry->length,
161 (unsigned long long)__entry->offset, __entry->handle,
162 __entry->nents < __entry->nsegs ? "more" : "last"
166 #define DEFINE_RDCH_EVENT(name) \
167 DEFINE_EVENT(xprtrdma_rdch_event, xprtrdma_chunk_##name,\
168 TP_PROTO( \
169 const struct rpc_task *task, \
170 unsigned int pos, \
171 struct rpcrdma_mr *mr, \
172 int nsegs \
173 ), \
174 TP_ARGS(task, pos, mr, nsegs))
176 DECLARE_EVENT_CLASS(xprtrdma_wrch_event,
177 TP_PROTO(
178 const struct rpc_task *task,
179 struct rpcrdma_mr *mr,
180 int nsegs
183 TP_ARGS(task, mr, nsegs),
185 TP_STRUCT__entry(
186 __field(unsigned int, task_id)
187 __field(unsigned int, client_id)
188 __field(int, nents)
189 __field(u32, handle)
190 __field(u32, length)
191 __field(u64, offset)
192 __field(int, nsegs)
195 TP_fast_assign(
196 __entry->task_id = task->tk_pid;
197 __entry->client_id = task->tk_client->cl_clid;
198 __entry->nents = mr->mr_nents;
199 __entry->handle = mr->mr_handle;
200 __entry->length = mr->mr_length;
201 __entry->offset = mr->mr_offset;
202 __entry->nsegs = nsegs;
205 TP_printk("task:%u@%u %u@0x%016llx:0x%08x (%s)",
206 __entry->task_id, __entry->client_id,
207 __entry->length, (unsigned long long)__entry->offset,
208 __entry->handle,
209 __entry->nents < __entry->nsegs ? "more" : "last"
213 #define DEFINE_WRCH_EVENT(name) \
214 DEFINE_EVENT(xprtrdma_wrch_event, xprtrdma_chunk_##name,\
215 TP_PROTO( \
216 const struct rpc_task *task, \
217 struct rpcrdma_mr *mr, \
218 int nsegs \
219 ), \
220 TP_ARGS(task, mr, nsegs))
222 DECLARE_EVENT_CLASS(xprtrdma_frwr_done,
223 TP_PROTO(
224 const struct ib_wc *wc,
225 const struct rpcrdma_frwr *frwr
228 TP_ARGS(wc, frwr),
230 TP_STRUCT__entry(
231 __field(const void *, mr)
232 __field(unsigned int, status)
233 __field(unsigned int, vendor_err)
236 TP_fast_assign(
237 __entry->mr = container_of(frwr, struct rpcrdma_mr, frwr);
238 __entry->status = wc->status;
239 __entry->vendor_err = __entry->status ? wc->vendor_err : 0;
242 TP_printk(
243 "mr=%p: %s (%u/0x%x)",
244 __entry->mr, rdma_show_wc_status(__entry->status),
245 __entry->status, __entry->vendor_err
249 #define DEFINE_FRWR_DONE_EVENT(name) \
250 DEFINE_EVENT(xprtrdma_frwr_done, name, \
251 TP_PROTO( \
252 const struct ib_wc *wc, \
253 const struct rpcrdma_frwr *frwr \
254 ), \
255 TP_ARGS(wc, frwr))
257 TRACE_DEFINE_ENUM(DMA_BIDIRECTIONAL);
258 TRACE_DEFINE_ENUM(DMA_TO_DEVICE);
259 TRACE_DEFINE_ENUM(DMA_FROM_DEVICE);
260 TRACE_DEFINE_ENUM(DMA_NONE);
262 #define xprtrdma_show_direction(x) \
263 __print_symbolic(x, \
264 { DMA_BIDIRECTIONAL, "BIDIR" }, \
265 { DMA_TO_DEVICE, "TO_DEVICE" }, \
266 { DMA_FROM_DEVICE, "FROM_DEVICE" }, \
267 { DMA_NONE, "NONE" })
269 DECLARE_EVENT_CLASS(xprtrdma_mr,
270 TP_PROTO(
271 const struct rpcrdma_mr *mr
274 TP_ARGS(mr),
276 TP_STRUCT__entry(
277 __field(const void *, mr)
278 __field(u32, handle)
279 __field(u32, length)
280 __field(u64, offset)
281 __field(u32, dir)
284 TP_fast_assign(
285 __entry->mr = mr;
286 __entry->handle = mr->mr_handle;
287 __entry->length = mr->mr_length;
288 __entry->offset = mr->mr_offset;
289 __entry->dir = mr->mr_dir;
292 TP_printk("mr=%p %u@0x%016llx:0x%08x (%s)",
293 __entry->mr, __entry->length,
294 (unsigned long long)__entry->offset, __entry->handle,
295 xprtrdma_show_direction(__entry->dir)
299 #define DEFINE_MR_EVENT(name) \
300 DEFINE_EVENT(xprtrdma_mr, xprtrdma_mr_##name, \
301 TP_PROTO( \
302 const struct rpcrdma_mr *mr \
303 ), \
304 TP_ARGS(mr))
306 DECLARE_EVENT_CLASS(xprtrdma_cb_event,
307 TP_PROTO(
308 const struct rpc_rqst *rqst
311 TP_ARGS(rqst),
313 TP_STRUCT__entry(
314 __field(const void *, rqst)
315 __field(const void *, rep)
316 __field(const void *, req)
317 __field(u32, xid)
320 TP_fast_assign(
321 __entry->rqst = rqst;
322 __entry->req = rpcr_to_rdmar(rqst);
323 __entry->rep = rpcr_to_rdmar(rqst)->rl_reply;
324 __entry->xid = be32_to_cpu(rqst->rq_xid);
327 TP_printk("xid=0x%08x, rqst=%p req=%p rep=%p",
328 __entry->xid, __entry->rqst, __entry->req, __entry->rep
332 #define DEFINE_CB_EVENT(name) \
333 DEFINE_EVENT(xprtrdma_cb_event, name, \
334 TP_PROTO( \
335 const struct rpc_rqst *rqst \
336 ), \
337 TP_ARGS(rqst))
340 ** Connection events
343 TRACE_EVENT(xprtrdma_cm_event,
344 TP_PROTO(
345 const struct rpcrdma_xprt *r_xprt,
346 struct rdma_cm_event *event
349 TP_ARGS(r_xprt, event),
351 TP_STRUCT__entry(
352 __field(const void *, r_xprt)
353 __field(unsigned int, event)
354 __field(int, status)
355 __string(addr, rpcrdma_addrstr(r_xprt))
356 __string(port, rpcrdma_portstr(r_xprt))
359 TP_fast_assign(
360 __entry->r_xprt = r_xprt;
361 __entry->event = event->event;
362 __entry->status = event->status;
363 __assign_str(addr, rpcrdma_addrstr(r_xprt));
364 __assign_str(port, rpcrdma_portstr(r_xprt));
367 TP_printk("peer=[%s]:%s r_xprt=%p: %s (%u/%d)",
368 __get_str(addr), __get_str(port),
369 __entry->r_xprt, rdma_show_cm_event(__entry->event),
370 __entry->event, __entry->status
374 TRACE_EVENT(xprtrdma_inline_thresh,
375 TP_PROTO(
376 const struct rpcrdma_xprt *r_xprt
379 TP_ARGS(r_xprt),
381 TP_STRUCT__entry(
382 __field(const void *, r_xprt)
383 __field(unsigned int, inline_send)
384 __field(unsigned int, inline_recv)
385 __field(unsigned int, max_send)
386 __field(unsigned int, max_recv)
387 __string(addr, rpcrdma_addrstr(r_xprt))
388 __string(port, rpcrdma_portstr(r_xprt))
391 TP_fast_assign(
392 const struct rpcrdma_ep *ep = &r_xprt->rx_ep;
394 __entry->r_xprt = r_xprt;
395 __entry->inline_send = ep->rep_inline_send;
396 __entry->inline_recv = ep->rep_inline_recv;
397 __entry->max_send = ep->rep_max_inline_send;
398 __entry->max_recv = ep->rep_max_inline_recv;
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 neg send/recv=%u/%u, calc send/recv=%u/%u",
404 __get_str(addr), __get_str(port), __entry->r_xprt,
405 __entry->inline_send, __entry->inline_recv,
406 __entry->max_send, __entry->max_recv
410 DEFINE_CONN_EVENT(connect);
411 DEFINE_CONN_EVENT(disconnect);
413 DEFINE_RXPRT_EVENT(xprtrdma_create);
414 DEFINE_RXPRT_EVENT(xprtrdma_op_destroy);
415 DEFINE_RXPRT_EVENT(xprtrdma_remove);
416 DEFINE_RXPRT_EVENT(xprtrdma_reinsert);
417 DEFINE_RXPRT_EVENT(xprtrdma_op_inject_dsc);
418 DEFINE_RXPRT_EVENT(xprtrdma_op_close);
419 DEFINE_RXPRT_EVENT(xprtrdma_op_setport);
421 TRACE_EVENT(xprtrdma_op_connect,
422 TP_PROTO(
423 const struct rpcrdma_xprt *r_xprt,
424 unsigned long delay
427 TP_ARGS(r_xprt, delay),
429 TP_STRUCT__entry(
430 __field(const void *, r_xprt)
431 __field(unsigned long, delay)
432 __string(addr, rpcrdma_addrstr(r_xprt))
433 __string(port, rpcrdma_portstr(r_xprt))
436 TP_fast_assign(
437 __entry->r_xprt = r_xprt;
438 __entry->delay = delay;
439 __assign_str(addr, rpcrdma_addrstr(r_xprt));
440 __assign_str(port, rpcrdma_portstr(r_xprt));
443 TP_printk("peer=[%s]:%s r_xprt=%p delay=%lu",
444 __get_str(addr), __get_str(port), __entry->r_xprt,
445 __entry->delay
450 TRACE_EVENT(xprtrdma_op_set_cto,
451 TP_PROTO(
452 const struct rpcrdma_xprt *r_xprt,
453 unsigned long connect,
454 unsigned long reconnect
457 TP_ARGS(r_xprt, connect, reconnect),
459 TP_STRUCT__entry(
460 __field(const void *, r_xprt)
461 __field(unsigned long, connect)
462 __field(unsigned long, reconnect)
463 __string(addr, rpcrdma_addrstr(r_xprt))
464 __string(port, rpcrdma_portstr(r_xprt))
467 TP_fast_assign(
468 __entry->r_xprt = r_xprt;
469 __entry->connect = connect;
470 __entry->reconnect = reconnect;
471 __assign_str(addr, rpcrdma_addrstr(r_xprt));
472 __assign_str(port, rpcrdma_portstr(r_xprt));
475 TP_printk("peer=[%s]:%s r_xprt=%p: connect=%lu reconnect=%lu",
476 __get_str(addr), __get_str(port), __entry->r_xprt,
477 __entry->connect / HZ, __entry->reconnect / HZ
481 TRACE_EVENT(xprtrdma_qp_event,
482 TP_PROTO(
483 const struct rpcrdma_xprt *r_xprt,
484 const struct ib_event *event
487 TP_ARGS(r_xprt, event),
489 TP_STRUCT__entry(
490 __field(const void *, r_xprt)
491 __field(unsigned int, event)
492 __string(name, event->device->name)
493 __string(addr, rpcrdma_addrstr(r_xprt))
494 __string(port, rpcrdma_portstr(r_xprt))
497 TP_fast_assign(
498 __entry->r_xprt = r_xprt;
499 __entry->event = event->event;
500 __assign_str(name, event->device->name);
501 __assign_str(addr, rpcrdma_addrstr(r_xprt));
502 __assign_str(port, rpcrdma_portstr(r_xprt));
505 TP_printk("peer=[%s]:%s r_xprt=%p: dev %s: %s (%u)",
506 __get_str(addr), __get_str(port), __entry->r_xprt,
507 __get_str(name), rdma_show_ib_event(__entry->event),
508 __entry->event
513 ** Call events
516 TRACE_EVENT(xprtrdma_createmrs,
517 TP_PROTO(
518 const struct rpcrdma_xprt *r_xprt,
519 unsigned int count
522 TP_ARGS(r_xprt, count),
524 TP_STRUCT__entry(
525 __field(const void *, r_xprt)
526 __string(addr, rpcrdma_addrstr(r_xprt))
527 __string(port, rpcrdma_portstr(r_xprt))
528 __field(unsigned int, count)
531 TP_fast_assign(
532 __entry->r_xprt = r_xprt;
533 __entry->count = count;
534 __assign_str(addr, rpcrdma_addrstr(r_xprt));
535 __assign_str(port, rpcrdma_portstr(r_xprt));
538 TP_printk("peer=[%s]:%s r_xprt=%p: created %u MRs",
539 __get_str(addr), __get_str(port), __entry->r_xprt,
540 __entry->count
544 TRACE_EVENT(xprtrdma_mr_get,
545 TP_PROTO(
546 const struct rpcrdma_req *req
549 TP_ARGS(req),
551 TP_STRUCT__entry(
552 __field(const void *, req)
553 __field(unsigned int, task_id)
554 __field(unsigned int, client_id)
555 __field(u32, xid)
558 TP_fast_assign(
559 const struct rpc_rqst *rqst = &req->rl_slot;
561 __entry->req = req;
562 __entry->task_id = rqst->rq_task->tk_pid;
563 __entry->client_id = rqst->rq_task->tk_client->cl_clid;
564 __entry->xid = be32_to_cpu(rqst->rq_xid);
567 TP_printk("task:%u@%u xid=0x%08x req=%p",
568 __entry->task_id, __entry->client_id, __entry->xid,
569 __entry->req
573 TRACE_EVENT(xprtrdma_nomrs,
574 TP_PROTO(
575 const struct rpcrdma_req *req
578 TP_ARGS(req),
580 TP_STRUCT__entry(
581 __field(const void *, req)
582 __field(unsigned int, task_id)
583 __field(unsigned int, client_id)
584 __field(u32, xid)
587 TP_fast_assign(
588 const struct rpc_rqst *rqst = &req->rl_slot;
590 __entry->req = req;
591 __entry->task_id = rqst->rq_task->tk_pid;
592 __entry->client_id = rqst->rq_task->tk_client->cl_clid;
593 __entry->xid = be32_to_cpu(rqst->rq_xid);
596 TP_printk("task:%u@%u xid=0x%08x req=%p",
597 __entry->task_id, __entry->client_id, __entry->xid,
598 __entry->req
602 DEFINE_RDCH_EVENT(read);
603 DEFINE_WRCH_EVENT(write);
604 DEFINE_WRCH_EVENT(reply);
606 TRACE_DEFINE_ENUM(rpcrdma_noch);
607 TRACE_DEFINE_ENUM(rpcrdma_noch_pullup);
608 TRACE_DEFINE_ENUM(rpcrdma_noch_mapped);
609 TRACE_DEFINE_ENUM(rpcrdma_readch);
610 TRACE_DEFINE_ENUM(rpcrdma_areadch);
611 TRACE_DEFINE_ENUM(rpcrdma_writech);
612 TRACE_DEFINE_ENUM(rpcrdma_replych);
614 #define xprtrdma_show_chunktype(x) \
615 __print_symbolic(x, \
616 { rpcrdma_noch, "inline" }, \
617 { rpcrdma_noch_pullup, "pullup" }, \
618 { rpcrdma_noch_mapped, "mapped" }, \
619 { rpcrdma_readch, "read list" }, \
620 { rpcrdma_areadch, "*read list" }, \
621 { rpcrdma_writech, "write list" }, \
622 { rpcrdma_replych, "reply chunk" })
624 TRACE_EVENT(xprtrdma_marshal,
625 TP_PROTO(
626 const struct rpcrdma_req *req,
627 unsigned int rtype,
628 unsigned int wtype
631 TP_ARGS(req, rtype, wtype),
633 TP_STRUCT__entry(
634 __field(unsigned int, task_id)
635 __field(unsigned int, client_id)
636 __field(u32, xid)
637 __field(unsigned int, hdrlen)
638 __field(unsigned int, headlen)
639 __field(unsigned int, pagelen)
640 __field(unsigned int, taillen)
641 __field(unsigned int, rtype)
642 __field(unsigned int, wtype)
645 TP_fast_assign(
646 const struct rpc_rqst *rqst = &req->rl_slot;
648 __entry->task_id = rqst->rq_task->tk_pid;
649 __entry->client_id = rqst->rq_task->tk_client->cl_clid;
650 __entry->xid = be32_to_cpu(rqst->rq_xid);
651 __entry->hdrlen = req->rl_hdrbuf.len;
652 __entry->headlen = rqst->rq_snd_buf.head[0].iov_len;
653 __entry->pagelen = rqst->rq_snd_buf.page_len;
654 __entry->taillen = rqst->rq_snd_buf.tail[0].iov_len;
655 __entry->rtype = rtype;
656 __entry->wtype = wtype;
659 TP_printk("task:%u@%u xid=0x%08x: hdr=%u xdr=%u/%u/%u %s/%s",
660 __entry->task_id, __entry->client_id, __entry->xid,
661 __entry->hdrlen,
662 __entry->headlen, __entry->pagelen, __entry->taillen,
663 xprtrdma_show_chunktype(__entry->rtype),
664 xprtrdma_show_chunktype(__entry->wtype)
668 TRACE_EVENT(xprtrdma_marshal_failed,
669 TP_PROTO(const struct rpc_rqst *rqst,
670 int ret
673 TP_ARGS(rqst, ret),
675 TP_STRUCT__entry(
676 __field(unsigned int, task_id)
677 __field(unsigned int, client_id)
678 __field(u32, xid)
679 __field(int, ret)
682 TP_fast_assign(
683 __entry->task_id = rqst->rq_task->tk_pid;
684 __entry->client_id = rqst->rq_task->tk_client->cl_clid;
685 __entry->xid = be32_to_cpu(rqst->rq_xid);
686 __entry->ret = ret;
689 TP_printk("task:%u@%u xid=0x%08x: ret=%d",
690 __entry->task_id, __entry->client_id, __entry->xid,
691 __entry->ret
695 TRACE_EVENT(xprtrdma_prepsend_failed,
696 TP_PROTO(const struct rpc_rqst *rqst,
697 int ret
700 TP_ARGS(rqst, ret),
702 TP_STRUCT__entry(
703 __field(unsigned int, task_id)
704 __field(unsigned int, client_id)
705 __field(u32, xid)
706 __field(int, ret)
709 TP_fast_assign(
710 __entry->task_id = rqst->rq_task->tk_pid;
711 __entry->client_id = rqst->rq_task->tk_client->cl_clid;
712 __entry->xid = be32_to_cpu(rqst->rq_xid);
713 __entry->ret = ret;
716 TP_printk("task:%u@%u xid=0x%08x: ret=%d",
717 __entry->task_id, __entry->client_id, __entry->xid,
718 __entry->ret
722 TRACE_EVENT(xprtrdma_post_send,
723 TP_PROTO(
724 const struct rpcrdma_req *req,
725 int status
728 TP_ARGS(req, status),
730 TP_STRUCT__entry(
731 __field(const void *, req)
732 __field(const void *, sc)
733 __field(unsigned int, task_id)
734 __field(unsigned int, client_id)
735 __field(int, num_sge)
736 __field(int, signaled)
737 __field(int, status)
740 TP_fast_assign(
741 const struct rpc_rqst *rqst = &req->rl_slot;
743 __entry->task_id = rqst->rq_task->tk_pid;
744 __entry->client_id = rqst->rq_task->tk_client ?
745 rqst->rq_task->tk_client->cl_clid : -1;
746 __entry->req = req;
747 __entry->sc = req->rl_sendctx;
748 __entry->num_sge = req->rl_wr.num_sge;
749 __entry->signaled = req->rl_wr.send_flags & IB_SEND_SIGNALED;
750 __entry->status = status;
753 TP_printk("task:%u@%u req=%p sc=%p (%d SGE%s) %sstatus=%d",
754 __entry->task_id, __entry->client_id,
755 __entry->req, __entry->sc, __entry->num_sge,
756 (__entry->num_sge == 1 ? "" : "s"),
757 (__entry->signaled ? "signaled " : ""),
758 __entry->status
762 TRACE_EVENT(xprtrdma_post_recv,
763 TP_PROTO(
764 const struct rpcrdma_rep *rep
767 TP_ARGS(rep),
769 TP_STRUCT__entry(
770 __field(const void *, rep)
773 TP_fast_assign(
774 __entry->rep = rep;
777 TP_printk("rep=%p",
778 __entry->rep
782 TRACE_EVENT(xprtrdma_post_recvs,
783 TP_PROTO(
784 const struct rpcrdma_xprt *r_xprt,
785 unsigned int count,
786 int status
789 TP_ARGS(r_xprt, count, status),
791 TP_STRUCT__entry(
792 __field(const void *, r_xprt)
793 __field(unsigned int, count)
794 __field(int, status)
795 __field(int, posted)
796 __string(addr, rpcrdma_addrstr(r_xprt))
797 __string(port, rpcrdma_portstr(r_xprt))
800 TP_fast_assign(
801 __entry->r_xprt = r_xprt;
802 __entry->count = count;
803 __entry->status = status;
804 __entry->posted = r_xprt->rx_ep.rep_receive_count;
805 __assign_str(addr, rpcrdma_addrstr(r_xprt));
806 __assign_str(port, rpcrdma_portstr(r_xprt));
809 TP_printk("peer=[%s]:%s r_xprt=%p: %u new recvs, %d active (rc %d)",
810 __get_str(addr), __get_str(port), __entry->r_xprt,
811 __entry->count, __entry->posted, __entry->status
815 TRACE_EVENT(xprtrdma_post_linv,
816 TP_PROTO(
817 const struct rpcrdma_req *req,
818 int status
821 TP_ARGS(req, status),
823 TP_STRUCT__entry(
824 __field(const void *, req)
825 __field(int, status)
826 __field(u32, xid)
829 TP_fast_assign(
830 __entry->req = req;
831 __entry->status = status;
832 __entry->xid = be32_to_cpu(req->rl_slot.rq_xid);
835 TP_printk("req=%p xid=0x%08x status=%d",
836 __entry->req, __entry->xid, __entry->status
841 ** Completion events
844 TRACE_EVENT(xprtrdma_wc_send,
845 TP_PROTO(
846 const struct rpcrdma_sendctx *sc,
847 const struct ib_wc *wc
850 TP_ARGS(sc, wc),
852 TP_STRUCT__entry(
853 __field(const void *, req)
854 __field(const void *, sc)
855 __field(unsigned int, unmap_count)
856 __field(unsigned int, status)
857 __field(unsigned int, vendor_err)
860 TP_fast_assign(
861 __entry->req = sc->sc_req;
862 __entry->sc = sc;
863 __entry->unmap_count = sc->sc_unmap_count;
864 __entry->status = wc->status;
865 __entry->vendor_err = __entry->status ? wc->vendor_err : 0;
868 TP_printk("req=%p sc=%p unmapped=%u: %s (%u/0x%x)",
869 __entry->req, __entry->sc, __entry->unmap_count,
870 rdma_show_wc_status(__entry->status),
871 __entry->status, __entry->vendor_err
875 TRACE_EVENT(xprtrdma_wc_receive,
876 TP_PROTO(
877 const struct ib_wc *wc
880 TP_ARGS(wc),
882 TP_STRUCT__entry(
883 __field(const void *, rep)
884 __field(u32, byte_len)
885 __field(unsigned int, status)
886 __field(u32, vendor_err)
889 TP_fast_assign(
890 __entry->rep = container_of(wc->wr_cqe, struct rpcrdma_rep,
891 rr_cqe);
892 __entry->status = wc->status;
893 if (wc->status) {
894 __entry->byte_len = 0;
895 __entry->vendor_err = wc->vendor_err;
896 } else {
897 __entry->byte_len = wc->byte_len;
898 __entry->vendor_err = 0;
902 TP_printk("rep=%p %u bytes: %s (%u/0x%x)",
903 __entry->rep, __entry->byte_len,
904 rdma_show_wc_status(__entry->status),
905 __entry->status, __entry->vendor_err
909 DEFINE_FRWR_DONE_EVENT(xprtrdma_wc_fastreg);
910 DEFINE_FRWR_DONE_EVENT(xprtrdma_wc_li);
911 DEFINE_FRWR_DONE_EVENT(xprtrdma_wc_li_wake);
912 DEFINE_FRWR_DONE_EVENT(xprtrdma_wc_li_done);
914 TRACE_EVENT(xprtrdma_frwr_alloc,
915 TP_PROTO(
916 const struct rpcrdma_mr *mr,
917 int rc
920 TP_ARGS(mr, rc),
922 TP_STRUCT__entry(
923 __field(const void *, mr)
924 __field(int, rc)
927 TP_fast_assign(
928 __entry->mr = mr;
929 __entry->rc = rc;
932 TP_printk("mr=%p: rc=%d",
933 __entry->mr, __entry->rc
937 TRACE_EVENT(xprtrdma_frwr_dereg,
938 TP_PROTO(
939 const struct rpcrdma_mr *mr,
940 int rc
943 TP_ARGS(mr, rc),
945 TP_STRUCT__entry(
946 __field(const void *, mr)
947 __field(u32, handle)
948 __field(u32, length)
949 __field(u64, offset)
950 __field(u32, dir)
951 __field(int, rc)
954 TP_fast_assign(
955 __entry->mr = mr;
956 __entry->handle = mr->mr_handle;
957 __entry->length = mr->mr_length;
958 __entry->offset = mr->mr_offset;
959 __entry->dir = mr->mr_dir;
960 __entry->rc = rc;
963 TP_printk("mr=%p %u@0x%016llx:0x%08x (%s): rc=%d",
964 __entry->mr, __entry->length,
965 (unsigned long long)__entry->offset, __entry->handle,
966 xprtrdma_show_direction(__entry->dir),
967 __entry->rc
971 TRACE_EVENT(xprtrdma_frwr_sgerr,
972 TP_PROTO(
973 const struct rpcrdma_mr *mr,
974 int sg_nents
977 TP_ARGS(mr, sg_nents),
979 TP_STRUCT__entry(
980 __field(const void *, mr)
981 __field(u64, addr)
982 __field(u32, dir)
983 __field(int, nents)
986 TP_fast_assign(
987 __entry->mr = mr;
988 __entry->addr = mr->mr_sg->dma_address;
989 __entry->dir = mr->mr_dir;
990 __entry->nents = sg_nents;
993 TP_printk("mr=%p dma addr=0x%llx (%s) sg_nents=%d",
994 __entry->mr, __entry->addr,
995 xprtrdma_show_direction(__entry->dir),
996 __entry->nents
1000 TRACE_EVENT(xprtrdma_frwr_maperr,
1001 TP_PROTO(
1002 const struct rpcrdma_mr *mr,
1003 int num_mapped
1006 TP_ARGS(mr, num_mapped),
1008 TP_STRUCT__entry(
1009 __field(const void *, mr)
1010 __field(u64, addr)
1011 __field(u32, dir)
1012 __field(int, num_mapped)
1013 __field(int, nents)
1016 TP_fast_assign(
1017 __entry->mr = mr;
1018 __entry->addr = mr->mr_sg->dma_address;
1019 __entry->dir = mr->mr_dir;
1020 __entry->num_mapped = num_mapped;
1021 __entry->nents = mr->mr_nents;
1024 TP_printk("mr=%p dma addr=0x%llx (%s) nents=%d of %d",
1025 __entry->mr, __entry->addr,
1026 xprtrdma_show_direction(__entry->dir),
1027 __entry->num_mapped, __entry->nents
1031 DEFINE_MR_EVENT(localinv);
1032 DEFINE_MR_EVENT(map);
1033 DEFINE_MR_EVENT(unmap);
1034 DEFINE_MR_EVENT(remoteinv);
1035 DEFINE_MR_EVENT(recycle);
1037 TRACE_EVENT(xprtrdma_dma_maperr,
1038 TP_PROTO(
1039 u64 addr
1042 TP_ARGS(addr),
1044 TP_STRUCT__entry(
1045 __field(u64, addr)
1048 TP_fast_assign(
1049 __entry->addr = addr;
1052 TP_printk("dma addr=0x%llx\n", __entry->addr)
1056 ** Reply events
1059 TRACE_EVENT(xprtrdma_reply,
1060 TP_PROTO(
1061 const struct rpc_task *task,
1062 const struct rpcrdma_rep *rep,
1063 const struct rpcrdma_req *req,
1064 unsigned int credits
1067 TP_ARGS(task, rep, req, credits),
1069 TP_STRUCT__entry(
1070 __field(unsigned int, task_id)
1071 __field(unsigned int, client_id)
1072 __field(const void *, rep)
1073 __field(const void *, req)
1074 __field(u32, xid)
1075 __field(unsigned int, credits)
1078 TP_fast_assign(
1079 __entry->task_id = task->tk_pid;
1080 __entry->client_id = task->tk_client->cl_clid;
1081 __entry->rep = rep;
1082 __entry->req = req;
1083 __entry->xid = be32_to_cpu(rep->rr_xid);
1084 __entry->credits = credits;
1087 TP_printk("task:%u@%u xid=0x%08x, %u credits, rep=%p -> req=%p",
1088 __entry->task_id, __entry->client_id, __entry->xid,
1089 __entry->credits, __entry->rep, __entry->req
1093 TRACE_EVENT(xprtrdma_defer_cmp,
1094 TP_PROTO(
1095 const struct rpcrdma_rep *rep
1098 TP_ARGS(rep),
1100 TP_STRUCT__entry(
1101 __field(unsigned int, task_id)
1102 __field(unsigned int, client_id)
1103 __field(const void *, rep)
1104 __field(u32, xid)
1107 TP_fast_assign(
1108 __entry->task_id = rep->rr_rqst->rq_task->tk_pid;
1109 __entry->client_id = rep->rr_rqst->rq_task->tk_client->cl_clid;
1110 __entry->rep = rep;
1111 __entry->xid = be32_to_cpu(rep->rr_xid);
1114 TP_printk("task:%u@%u xid=0x%08x rep=%p",
1115 __entry->task_id, __entry->client_id, __entry->xid,
1116 __entry->rep
1120 DEFINE_REPLY_EVENT(xprtrdma_reply_vers);
1121 DEFINE_REPLY_EVENT(xprtrdma_reply_rqst);
1122 DEFINE_REPLY_EVENT(xprtrdma_reply_short);
1123 DEFINE_REPLY_EVENT(xprtrdma_reply_hdr);
1125 TRACE_EVENT(xprtrdma_fixup,
1126 TP_PROTO(
1127 const struct rpc_rqst *rqst,
1128 unsigned long fixup
1131 TP_ARGS(rqst, fixup),
1133 TP_STRUCT__entry(
1134 __field(unsigned int, task_id)
1135 __field(unsigned int, client_id)
1136 __field(unsigned long, fixup)
1137 __field(size_t, headlen)
1138 __field(unsigned int, pagelen)
1139 __field(size_t, taillen)
1142 TP_fast_assign(
1143 __entry->task_id = rqst->rq_task->tk_pid;
1144 __entry->client_id = rqst->rq_task->tk_client->cl_clid;
1145 __entry->fixup = fixup;
1146 __entry->headlen = rqst->rq_rcv_buf.head[0].iov_len;
1147 __entry->pagelen = rqst->rq_rcv_buf.page_len;
1148 __entry->taillen = rqst->rq_rcv_buf.tail[0].iov_len;
1151 TP_printk("task:%u@%u fixup=%lu xdr=%zu/%u/%zu",
1152 __entry->task_id, __entry->client_id, __entry->fixup,
1153 __entry->headlen, __entry->pagelen, __entry->taillen
1157 TRACE_EVENT(xprtrdma_decode_seg,
1158 TP_PROTO(
1159 u32 handle,
1160 u32 length,
1161 u64 offset
1164 TP_ARGS(handle, length, offset),
1166 TP_STRUCT__entry(
1167 __field(u32, handle)
1168 __field(u32, length)
1169 __field(u64, offset)
1172 TP_fast_assign(
1173 __entry->handle = handle;
1174 __entry->length = length;
1175 __entry->offset = offset;
1178 TP_printk("%u@0x%016llx:0x%08x",
1179 __entry->length, (unsigned long long)__entry->offset,
1180 __entry->handle
1185 ** Allocation/release of rpcrdma_reqs and rpcrdma_reps
1188 TRACE_EVENT(xprtrdma_op_allocate,
1189 TP_PROTO(
1190 const struct rpc_task *task,
1191 const struct rpcrdma_req *req
1194 TP_ARGS(task, req),
1196 TP_STRUCT__entry(
1197 __field(unsigned int, task_id)
1198 __field(unsigned int, client_id)
1199 __field(const void *, req)
1200 __field(size_t, callsize)
1201 __field(size_t, rcvsize)
1204 TP_fast_assign(
1205 __entry->task_id = task->tk_pid;
1206 __entry->client_id = task->tk_client->cl_clid;
1207 __entry->req = req;
1208 __entry->callsize = task->tk_rqstp->rq_callsize;
1209 __entry->rcvsize = task->tk_rqstp->rq_rcvsize;
1212 TP_printk("task:%u@%u req=%p (%zu, %zu)",
1213 __entry->task_id, __entry->client_id,
1214 __entry->req, __entry->callsize, __entry->rcvsize
1218 TRACE_EVENT(xprtrdma_op_free,
1219 TP_PROTO(
1220 const struct rpc_task *task,
1221 const struct rpcrdma_req *req
1224 TP_ARGS(task, req),
1226 TP_STRUCT__entry(
1227 __field(unsigned int, task_id)
1228 __field(unsigned int, client_id)
1229 __field(const void *, req)
1230 __field(const void *, rep)
1233 TP_fast_assign(
1234 __entry->task_id = task->tk_pid;
1235 __entry->client_id = task->tk_client->cl_clid;
1236 __entry->req = req;
1237 __entry->rep = req->rl_reply;
1240 TP_printk("task:%u@%u req=%p rep=%p",
1241 __entry->task_id, __entry->client_id,
1242 __entry->req, __entry->rep
1247 ** Callback events
1250 TRACE_EVENT(xprtrdma_cb_setup,
1251 TP_PROTO(
1252 const struct rpcrdma_xprt *r_xprt,
1253 unsigned int reqs
1256 TP_ARGS(r_xprt, reqs),
1258 TP_STRUCT__entry(
1259 __field(const void *, r_xprt)
1260 __field(unsigned int, reqs)
1261 __string(addr, rpcrdma_addrstr(r_xprt))
1262 __string(port, rpcrdma_portstr(r_xprt))
1265 TP_fast_assign(
1266 __entry->r_xprt = r_xprt;
1267 __entry->reqs = reqs;
1268 __assign_str(addr, rpcrdma_addrstr(r_xprt));
1269 __assign_str(port, rpcrdma_portstr(r_xprt));
1272 TP_printk("peer=[%s]:%s r_xprt=%p: %u reqs",
1273 __get_str(addr), __get_str(port),
1274 __entry->r_xprt, __entry->reqs
1278 DEFINE_CB_EVENT(xprtrdma_cb_call);
1279 DEFINE_CB_EVENT(xprtrdma_cb_reply);
1281 TRACE_EVENT(xprtrdma_leaked_rep,
1282 TP_PROTO(
1283 const struct rpc_rqst *rqst,
1284 const struct rpcrdma_rep *rep
1287 TP_ARGS(rqst, rep),
1289 TP_STRUCT__entry(
1290 __field(unsigned int, task_id)
1291 __field(unsigned int, client_id)
1292 __field(u32, xid)
1293 __field(const void *, rep)
1296 TP_fast_assign(
1297 __entry->task_id = rqst->rq_task->tk_pid;
1298 __entry->client_id = rqst->rq_task->tk_client->cl_clid;
1299 __entry->xid = be32_to_cpu(rqst->rq_xid);
1300 __entry->rep = rep;
1303 TP_printk("task:%u@%u xid=0x%08x rep=%p",
1304 __entry->task_id, __entry->client_id, __entry->xid,
1305 __entry->rep
1310 ** Server-side RPC/RDMA events
1313 DECLARE_EVENT_CLASS(svcrdma_xprt_event,
1314 TP_PROTO(
1315 const struct svc_xprt *xprt
1318 TP_ARGS(xprt),
1320 TP_STRUCT__entry(
1321 __field(const void *, xprt)
1322 __string(addr, xprt->xpt_remotebuf)
1325 TP_fast_assign(
1326 __entry->xprt = xprt;
1327 __assign_str(addr, xprt->xpt_remotebuf);
1330 TP_printk("xprt=%p addr=%s",
1331 __entry->xprt, __get_str(addr)
1335 #define DEFINE_XPRT_EVENT(name) \
1336 DEFINE_EVENT(svcrdma_xprt_event, svcrdma_xprt_##name, \
1337 TP_PROTO( \
1338 const struct svc_xprt *xprt \
1339 ), \
1340 TP_ARGS(xprt))
1342 DEFINE_XPRT_EVENT(accept);
1343 DEFINE_XPRT_EVENT(fail);
1344 DEFINE_XPRT_EVENT(free);
1346 TRACE_DEFINE_ENUM(RDMA_MSG);
1347 TRACE_DEFINE_ENUM(RDMA_NOMSG);
1348 TRACE_DEFINE_ENUM(RDMA_MSGP);
1349 TRACE_DEFINE_ENUM(RDMA_DONE);
1350 TRACE_DEFINE_ENUM(RDMA_ERROR);
1352 #define show_rpcrdma_proc(x) \
1353 __print_symbolic(x, \
1354 { RDMA_MSG, "RDMA_MSG" }, \
1355 { RDMA_NOMSG, "RDMA_NOMSG" }, \
1356 { RDMA_MSGP, "RDMA_MSGP" }, \
1357 { RDMA_DONE, "RDMA_DONE" }, \
1358 { RDMA_ERROR, "RDMA_ERROR" })
1360 TRACE_EVENT(svcrdma_decode_rqst,
1361 TP_PROTO(
1362 __be32 *p,
1363 unsigned int hdrlen
1366 TP_ARGS(p, hdrlen),
1368 TP_STRUCT__entry(
1369 __field(u32, xid)
1370 __field(u32, vers)
1371 __field(u32, proc)
1372 __field(u32, credits)
1373 __field(unsigned int, hdrlen)
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);
1381 __entry->hdrlen = hdrlen;
1384 TP_printk("xid=0x%08x vers=%u credits=%u proc=%s hdrlen=%u",
1385 __entry->xid, __entry->vers, __entry->credits,
1386 show_rpcrdma_proc(__entry->proc), __entry->hdrlen)
1389 TRACE_EVENT(svcrdma_decode_short,
1390 TP_PROTO(
1391 unsigned int hdrlen
1394 TP_ARGS(hdrlen),
1396 TP_STRUCT__entry(
1397 __field(unsigned int, hdrlen)
1400 TP_fast_assign(
1401 __entry->hdrlen = hdrlen;
1404 TP_printk("hdrlen=%u", __entry->hdrlen)
1407 DECLARE_EVENT_CLASS(svcrdma_badreq_event,
1408 TP_PROTO(
1409 __be32 *p
1412 TP_ARGS(p),
1414 TP_STRUCT__entry(
1415 __field(u32, xid)
1416 __field(u32, vers)
1417 __field(u32, proc)
1418 __field(u32, credits)
1421 TP_fast_assign(
1422 __entry->xid = be32_to_cpup(p++);
1423 __entry->vers = be32_to_cpup(p++);
1424 __entry->credits = be32_to_cpup(p++);
1425 __entry->proc = be32_to_cpup(p);
1428 TP_printk("xid=0x%08x vers=%u credits=%u proc=%u",
1429 __entry->xid, __entry->vers, __entry->credits, __entry->proc)
1432 #define DEFINE_BADREQ_EVENT(name) \
1433 DEFINE_EVENT(svcrdma_badreq_event, svcrdma_decode_##name,\
1434 TP_PROTO( \
1435 __be32 *p \
1436 ), \
1437 TP_ARGS(p))
1439 DEFINE_BADREQ_EVENT(badvers);
1440 DEFINE_BADREQ_EVENT(drop);
1441 DEFINE_BADREQ_EVENT(badproc);
1442 DEFINE_BADREQ_EVENT(parse);
1444 DECLARE_EVENT_CLASS(svcrdma_segment_event,
1445 TP_PROTO(
1446 u32 handle,
1447 u32 length,
1448 u64 offset
1451 TP_ARGS(handle, length, offset),
1453 TP_STRUCT__entry(
1454 __field(u32, handle)
1455 __field(u32, length)
1456 __field(u64, offset)
1459 TP_fast_assign(
1460 __entry->handle = handle;
1461 __entry->length = length;
1462 __entry->offset = offset;
1465 TP_printk("%u@0x%016llx:0x%08x",
1466 __entry->length, (unsigned long long)__entry->offset,
1467 __entry->handle
1471 #define DEFINE_SEGMENT_EVENT(name) \
1472 DEFINE_EVENT(svcrdma_segment_event, svcrdma_encode_##name,\
1473 TP_PROTO( \
1474 u32 handle, \
1475 u32 length, \
1476 u64 offset \
1477 ), \
1478 TP_ARGS(handle, length, offset))
1480 DEFINE_SEGMENT_EVENT(rseg);
1481 DEFINE_SEGMENT_EVENT(wseg);
1483 DECLARE_EVENT_CLASS(svcrdma_chunk_event,
1484 TP_PROTO(
1485 u32 length
1488 TP_ARGS(length),
1490 TP_STRUCT__entry(
1491 __field(u32, length)
1494 TP_fast_assign(
1495 __entry->length = length;
1498 TP_printk("length=%u",
1499 __entry->length
1503 #define DEFINE_CHUNK_EVENT(name) \
1504 DEFINE_EVENT(svcrdma_chunk_event, svcrdma_encode_##name,\
1505 TP_PROTO( \
1506 u32 length \
1507 ), \
1508 TP_ARGS(length))
1510 DEFINE_CHUNK_EVENT(pzr);
1511 DEFINE_CHUNK_EVENT(write);
1512 DEFINE_CHUNK_EVENT(reply);
1514 TRACE_EVENT(svcrdma_encode_read,
1515 TP_PROTO(
1516 u32 length,
1517 u32 position
1520 TP_ARGS(length, position),
1522 TP_STRUCT__entry(
1523 __field(u32, length)
1524 __field(u32, position)
1527 TP_fast_assign(
1528 __entry->length = length;
1529 __entry->position = position;
1532 TP_printk("length=%u position=%u",
1533 __entry->length, __entry->position
1537 DECLARE_EVENT_CLASS(svcrdma_error_event,
1538 TP_PROTO(
1539 __be32 xid
1542 TP_ARGS(xid),
1544 TP_STRUCT__entry(
1545 __field(u32, xid)
1548 TP_fast_assign(
1549 __entry->xid = be32_to_cpu(xid);
1552 TP_printk("xid=0x%08x",
1553 __entry->xid
1557 #define DEFINE_ERROR_EVENT(name) \
1558 DEFINE_EVENT(svcrdma_error_event, svcrdma_err_##name, \
1559 TP_PROTO( \
1560 __be32 xid \
1561 ), \
1562 TP_ARGS(xid))
1564 DEFINE_ERROR_EVENT(vers);
1565 DEFINE_ERROR_EVENT(chunk);
1568 ** Server-side RDMA API events
1571 DECLARE_EVENT_CLASS(svcrdma_dma_map_class,
1572 TP_PROTO(
1573 const struct svcxprt_rdma *rdma,
1574 u64 dma_addr,
1575 u32 length
1578 TP_ARGS(rdma, dma_addr, length),
1580 TP_STRUCT__entry(
1581 __field(u64, dma_addr)
1582 __field(u32, length)
1583 __string(device, rdma->sc_cm_id->device->name)
1584 __string(addr, rdma->sc_xprt.xpt_remotebuf)
1587 TP_fast_assign(
1588 __entry->dma_addr = dma_addr;
1589 __entry->length = length;
1590 __assign_str(device, rdma->sc_cm_id->device->name);
1591 __assign_str(addr, rdma->sc_xprt.xpt_remotebuf);
1594 TP_printk("addr=%s device=%s dma_addr=%llu length=%u",
1595 __get_str(addr), __get_str(device),
1596 __entry->dma_addr, __entry->length
1600 #define DEFINE_SVC_DMA_EVENT(name) \
1601 DEFINE_EVENT(svcrdma_dma_map_class, svcrdma_##name, \
1602 TP_PROTO( \
1603 const struct svcxprt_rdma *rdma,\
1604 u64 dma_addr, \
1605 u32 length \
1606 ), \
1607 TP_ARGS(rdma, dma_addr, length))
1609 DEFINE_SVC_DMA_EVENT(dma_map_page);
1610 DEFINE_SVC_DMA_EVENT(dma_unmap_page);
1612 TRACE_EVENT(svcrdma_dma_map_rwctx,
1613 TP_PROTO(
1614 const struct svcxprt_rdma *rdma,
1615 int status
1618 TP_ARGS(rdma, status),
1620 TP_STRUCT__entry(
1621 __field(int, status)
1622 __string(device, rdma->sc_cm_id->device->name)
1623 __string(addr, rdma->sc_xprt.xpt_remotebuf)
1626 TP_fast_assign(
1627 __entry->status = status;
1628 __assign_str(device, rdma->sc_cm_id->device->name);
1629 __assign_str(addr, rdma->sc_xprt.xpt_remotebuf);
1632 TP_printk("addr=%s device=%s status=%d",
1633 __get_str(addr), __get_str(device), __entry->status
1637 TRACE_EVENT(svcrdma_send_failed,
1638 TP_PROTO(
1639 const struct svc_rqst *rqst,
1640 int status
1643 TP_ARGS(rqst, status),
1645 TP_STRUCT__entry(
1646 __field(int, status)
1647 __field(u32, xid)
1648 __field(const void *, xprt)
1649 __string(addr, rqst->rq_xprt->xpt_remotebuf)
1652 TP_fast_assign(
1653 __entry->status = status;
1654 __entry->xid = __be32_to_cpu(rqst->rq_xid);
1655 __entry->xprt = rqst->rq_xprt;
1656 __assign_str(addr, rqst->rq_xprt->xpt_remotebuf);
1659 TP_printk("xprt=%p addr=%s xid=0x%08x status=%d",
1660 __entry->xprt, __get_str(addr),
1661 __entry->xid, __entry->status
1665 DECLARE_EVENT_CLASS(svcrdma_sendcomp_event,
1666 TP_PROTO(
1667 const struct ib_wc *wc
1670 TP_ARGS(wc),
1672 TP_STRUCT__entry(
1673 __field(const void *, cqe)
1674 __field(unsigned int, status)
1675 __field(unsigned int, vendor_err)
1678 TP_fast_assign(
1679 __entry->cqe = wc->wr_cqe;
1680 __entry->status = wc->status;
1681 if (wc->status)
1682 __entry->vendor_err = wc->vendor_err;
1683 else
1684 __entry->vendor_err = 0;
1687 TP_printk("cqe=%p status=%s (%u/0x%x)",
1688 __entry->cqe, rdma_show_wc_status(__entry->status),
1689 __entry->status, __entry->vendor_err
1693 #define DEFINE_SENDCOMP_EVENT(name) \
1694 DEFINE_EVENT(svcrdma_sendcomp_event, svcrdma_wc_##name, \
1695 TP_PROTO( \
1696 const struct ib_wc *wc \
1697 ), \
1698 TP_ARGS(wc))
1700 TRACE_EVENT(svcrdma_post_send,
1701 TP_PROTO(
1702 const struct ib_send_wr *wr,
1703 int status
1706 TP_ARGS(wr, status),
1708 TP_STRUCT__entry(
1709 __field(const void *, cqe)
1710 __field(unsigned int, num_sge)
1711 __field(u32, inv_rkey)
1712 __field(int, status)
1715 TP_fast_assign(
1716 __entry->cqe = wr->wr_cqe;
1717 __entry->num_sge = wr->num_sge;
1718 __entry->inv_rkey = (wr->opcode == IB_WR_SEND_WITH_INV) ?
1719 wr->ex.invalidate_rkey : 0;
1720 __entry->status = status;
1723 TP_printk("cqe=%p num_sge=%u inv_rkey=0x%08x status=%d",
1724 __entry->cqe, __entry->num_sge,
1725 __entry->inv_rkey, __entry->status
1729 DEFINE_SENDCOMP_EVENT(send);
1731 TRACE_EVENT(svcrdma_post_recv,
1732 TP_PROTO(
1733 const struct ib_recv_wr *wr,
1734 int status
1737 TP_ARGS(wr, status),
1739 TP_STRUCT__entry(
1740 __field(const void *, cqe)
1741 __field(int, status)
1744 TP_fast_assign(
1745 __entry->cqe = wr->wr_cqe;
1746 __entry->status = status;
1749 TP_printk("cqe=%p status=%d",
1750 __entry->cqe, __entry->status
1754 TRACE_EVENT(svcrdma_wc_receive,
1755 TP_PROTO(
1756 const struct ib_wc *wc
1759 TP_ARGS(wc),
1761 TP_STRUCT__entry(
1762 __field(const void *, cqe)
1763 __field(u32, byte_len)
1764 __field(unsigned int, status)
1765 __field(u32, vendor_err)
1768 TP_fast_assign(
1769 __entry->cqe = wc->wr_cqe;
1770 __entry->status = wc->status;
1771 if (wc->status) {
1772 __entry->byte_len = 0;
1773 __entry->vendor_err = wc->vendor_err;
1774 } else {
1775 __entry->byte_len = wc->byte_len;
1776 __entry->vendor_err = 0;
1780 TP_printk("cqe=%p byte_len=%u status=%s (%u/0x%x)",
1781 __entry->cqe, __entry->byte_len,
1782 rdma_show_wc_status(__entry->status),
1783 __entry->status, __entry->vendor_err
1787 TRACE_EVENT(svcrdma_post_rw,
1788 TP_PROTO(
1789 const void *cqe,
1790 int sqecount,
1791 int status
1794 TP_ARGS(cqe, sqecount, status),
1796 TP_STRUCT__entry(
1797 __field(const void *, cqe)
1798 __field(int, sqecount)
1799 __field(int, status)
1802 TP_fast_assign(
1803 __entry->cqe = cqe;
1804 __entry->sqecount = sqecount;
1805 __entry->status = status;
1808 TP_printk("cqe=%p sqecount=%d status=%d",
1809 __entry->cqe, __entry->sqecount, __entry->status
1813 DEFINE_SENDCOMP_EVENT(read);
1814 DEFINE_SENDCOMP_EVENT(write);
1816 TRACE_EVENT(svcrdma_cm_event,
1817 TP_PROTO(
1818 const struct rdma_cm_event *event,
1819 const struct sockaddr *sap
1822 TP_ARGS(event, sap),
1824 TP_STRUCT__entry(
1825 __field(unsigned int, event)
1826 __field(int, status)
1827 __array(__u8, addr, INET6_ADDRSTRLEN + 10)
1830 TP_fast_assign(
1831 __entry->event = event->event;
1832 __entry->status = event->status;
1833 snprintf(__entry->addr, sizeof(__entry->addr) - 1,
1834 "%pISpc", sap);
1837 TP_printk("addr=%s event=%s (%u/%d)",
1838 __entry->addr,
1839 rdma_show_cm_event(__entry->event),
1840 __entry->event, __entry->status
1844 TRACE_EVENT(svcrdma_qp_error,
1845 TP_PROTO(
1846 const struct ib_event *event,
1847 const struct sockaddr *sap
1850 TP_ARGS(event, sap),
1852 TP_STRUCT__entry(
1853 __field(unsigned int, event)
1854 __string(device, event->device->name)
1855 __array(__u8, addr, INET6_ADDRSTRLEN + 10)
1858 TP_fast_assign(
1859 __entry->event = event->event;
1860 __assign_str(device, event->device->name);
1861 snprintf(__entry->addr, sizeof(__entry->addr) - 1,
1862 "%pISpc", sap);
1865 TP_printk("addr=%s dev=%s event=%s (%u)",
1866 __entry->addr, __get_str(device),
1867 rdma_show_ib_event(__entry->event), __entry->event
1871 DECLARE_EVENT_CLASS(svcrdma_sendqueue_event,
1872 TP_PROTO(
1873 const struct svcxprt_rdma *rdma
1876 TP_ARGS(rdma),
1878 TP_STRUCT__entry(
1879 __field(int, avail)
1880 __field(int, depth)
1881 __string(addr, rdma->sc_xprt.xpt_remotebuf)
1884 TP_fast_assign(
1885 __entry->avail = atomic_read(&rdma->sc_sq_avail);
1886 __entry->depth = rdma->sc_sq_depth;
1887 __assign_str(addr, rdma->sc_xprt.xpt_remotebuf);
1890 TP_printk("addr=%s sc_sq_avail=%d/%d",
1891 __get_str(addr), __entry->avail, __entry->depth
1895 #define DEFINE_SQ_EVENT(name) \
1896 DEFINE_EVENT(svcrdma_sendqueue_event, svcrdma_sq_##name,\
1897 TP_PROTO( \
1898 const struct svcxprt_rdma *rdma \
1899 ), \
1900 TP_ARGS(rdma))
1902 DEFINE_SQ_EVENT(full);
1903 DEFINE_SQ_EVENT(retry);
1905 #endif /* _TRACE_RPCRDMA_H */
1907 #include <trace/define_trace.h>