Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[cris-mirror.git] / include / trace / events / sunrpc.h
blob970c91a8317396b8c7fdd378e4f52a07e756e0a7
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #undef TRACE_SYSTEM
3 #define TRACE_SYSTEM sunrpc
5 #if !defined(_TRACE_SUNRPC_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define _TRACE_SUNRPC_H
8 #include <linux/sunrpc/sched.h>
9 #include <linux/sunrpc/clnt.h>
10 #include <linux/sunrpc/svc.h>
11 #include <linux/sunrpc/xprtsock.h>
12 #include <linux/sunrpc/svc_xprt.h>
13 #include <net/tcp_states.h>
14 #include <linux/net.h>
15 #include <linux/tracepoint.h>
17 DECLARE_EVENT_CLASS(rpc_task_status,
19 TP_PROTO(struct rpc_task *task),
21 TP_ARGS(task),
23 TP_STRUCT__entry(
24 __field(unsigned int, task_id)
25 __field(unsigned int, client_id)
26 __field(int, status)
29 TP_fast_assign(
30 __entry->task_id = task->tk_pid;
31 __entry->client_id = task->tk_client->cl_clid;
32 __entry->status = task->tk_status;
35 TP_printk("task:%u@%u status=%d",
36 __entry->task_id, __entry->client_id,
37 __entry->status)
40 DEFINE_EVENT(rpc_task_status, rpc_call_status,
41 TP_PROTO(struct rpc_task *task),
43 TP_ARGS(task)
46 DEFINE_EVENT(rpc_task_status, rpc_bind_status,
47 TP_PROTO(struct rpc_task *task),
49 TP_ARGS(task)
52 TRACE_EVENT(rpc_connect_status,
53 TP_PROTO(struct rpc_task *task, int status),
55 TP_ARGS(task, status),
57 TP_STRUCT__entry(
58 __field(unsigned int, task_id)
59 __field(unsigned int, client_id)
60 __field(int, status)
63 TP_fast_assign(
64 __entry->task_id = task->tk_pid;
65 __entry->client_id = task->tk_client->cl_clid;
66 __entry->status = status;
69 TP_printk("task:%u@%u status=%d",
70 __entry->task_id, __entry->client_id,
71 __entry->status)
74 TRACE_EVENT(rpc_request,
75 TP_PROTO(const struct rpc_task *task),
77 TP_ARGS(task),
79 TP_STRUCT__entry(
80 __field(unsigned int, task_id)
81 __field(unsigned int, client_id)
82 __field(int, version)
83 __field(bool, async)
84 __string(progname, task->tk_client->cl_program->name)
85 __string(procname, rpc_proc_name(task))
88 TP_fast_assign(
89 __entry->task_id = task->tk_pid;
90 __entry->client_id = task->tk_client->cl_clid;
91 __entry->version = task->tk_client->cl_vers;
92 __entry->async = RPC_IS_ASYNC(task);
93 __assign_str(progname, task->tk_client->cl_program->name)
94 __assign_str(procname, rpc_proc_name(task))
97 TP_printk("task:%u@%u %sv%d %s (%ssync)",
98 __entry->task_id, __entry->client_id,
99 __get_str(progname), __entry->version,
100 __get_str(procname), __entry->async ? "a": ""
104 DECLARE_EVENT_CLASS(rpc_task_running,
106 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action),
108 TP_ARGS(clnt, task, action),
110 TP_STRUCT__entry(
111 __field(unsigned int, task_id)
112 __field(unsigned int, client_id)
113 __field(const void *, action)
114 __field(unsigned long, runstate)
115 __field(int, status)
116 __field(unsigned short, flags)
119 TP_fast_assign(
120 __entry->client_id = clnt ? clnt->cl_clid : -1;
121 __entry->task_id = task->tk_pid;
122 __entry->action = action;
123 __entry->runstate = task->tk_runstate;
124 __entry->status = task->tk_status;
125 __entry->flags = task->tk_flags;
128 TP_printk("task:%u@%d flags=%4.4x state=%4.4lx status=%d action=%pf",
129 __entry->task_id, __entry->client_id,
130 __entry->flags,
131 __entry->runstate,
132 __entry->status,
133 __entry->action
137 DEFINE_EVENT(rpc_task_running, rpc_task_begin,
139 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action),
141 TP_ARGS(clnt, task, action)
145 DEFINE_EVENT(rpc_task_running, rpc_task_run_action,
147 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action),
149 TP_ARGS(clnt, task, action)
153 DEFINE_EVENT(rpc_task_running, rpc_task_complete,
155 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action),
157 TP_ARGS(clnt, task, action)
161 DECLARE_EVENT_CLASS(rpc_task_queued,
163 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q),
165 TP_ARGS(clnt, task, q),
167 TP_STRUCT__entry(
168 __field(unsigned int, task_id)
169 __field(unsigned int, client_id)
170 __field(unsigned long, timeout)
171 __field(unsigned long, runstate)
172 __field(int, status)
173 __field(unsigned short, flags)
174 __string(q_name, rpc_qname(q))
177 TP_fast_assign(
178 __entry->client_id = clnt ? clnt->cl_clid : -1;
179 __entry->task_id = task->tk_pid;
180 __entry->timeout = task->tk_timeout;
181 __entry->runstate = task->tk_runstate;
182 __entry->status = task->tk_status;
183 __entry->flags = task->tk_flags;
184 __assign_str(q_name, rpc_qname(q));
187 TP_printk("task:%u@%d flags=%4.4x state=%4.4lx status=%d timeout=%lu queue=%s",
188 __entry->task_id, __entry->client_id,
189 __entry->flags,
190 __entry->runstate,
191 __entry->status,
192 __entry->timeout,
193 __get_str(q_name)
197 DEFINE_EVENT(rpc_task_queued, rpc_task_sleep,
199 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q),
201 TP_ARGS(clnt, task, q)
205 DEFINE_EVENT(rpc_task_queued, rpc_task_wakeup,
207 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q),
209 TP_ARGS(clnt, task, q)
214 * First define the enums in the below macros to be exported to userspace
215 * via TRACE_DEFINE_ENUM().
217 #undef EM
218 #undef EMe
219 #define EM(a, b) TRACE_DEFINE_ENUM(a);
220 #define EMe(a, b) TRACE_DEFINE_ENUM(a);
222 #define RPC_SHOW_SOCKET \
223 EM( SS_FREE, "FREE" ) \
224 EM( SS_UNCONNECTED, "UNCONNECTED" ) \
225 EM( SS_CONNECTING, "CONNECTING," ) \
226 EM( SS_CONNECTED, "CONNECTED," ) \
227 EMe(SS_DISCONNECTING, "DISCONNECTING" )
229 #define rpc_show_socket_state(state) \
230 __print_symbolic(state, RPC_SHOW_SOCKET)
232 RPC_SHOW_SOCKET
234 #define RPC_SHOW_SOCK \
235 EM( TCP_ESTABLISHED, "ESTABLISHED" ) \
236 EM( TCP_SYN_SENT, "SYN_SENT" ) \
237 EM( TCP_SYN_RECV, "SYN_RECV" ) \
238 EM( TCP_FIN_WAIT1, "FIN_WAIT1" ) \
239 EM( TCP_FIN_WAIT2, "FIN_WAIT2" ) \
240 EM( TCP_TIME_WAIT, "TIME_WAIT" ) \
241 EM( TCP_CLOSE, "CLOSE" ) \
242 EM( TCP_CLOSE_WAIT, "CLOSE_WAIT" ) \
243 EM( TCP_LAST_ACK, "LAST_ACK" ) \
244 EM( TCP_LISTEN, "LISTEN" ) \
245 EMe( TCP_CLOSING, "CLOSING" )
247 #define rpc_show_sock_state(state) \
248 __print_symbolic(state, RPC_SHOW_SOCK)
250 RPC_SHOW_SOCK
253 * Now redefine the EM() and EMe() macros to map the enums to the strings
254 * that will be printed in the output.
256 #undef EM
257 #undef EMe
258 #define EM(a, b) {a, b},
259 #define EMe(a, b) {a, b}
261 DECLARE_EVENT_CLASS(xs_socket_event,
263 TP_PROTO(
264 struct rpc_xprt *xprt,
265 struct socket *socket
268 TP_ARGS(xprt, socket),
270 TP_STRUCT__entry(
271 __field(unsigned int, socket_state)
272 __field(unsigned int, sock_state)
273 __field(unsigned long long, ino)
274 __string(dstaddr,
275 xprt->address_strings[RPC_DISPLAY_ADDR])
276 __string(dstport,
277 xprt->address_strings[RPC_DISPLAY_PORT])
280 TP_fast_assign(
281 struct inode *inode = SOCK_INODE(socket);
282 __entry->socket_state = socket->state;
283 __entry->sock_state = socket->sk->sk_state;
284 __entry->ino = (unsigned long long)inode->i_ino;
285 __assign_str(dstaddr,
286 xprt->address_strings[RPC_DISPLAY_ADDR]);
287 __assign_str(dstport,
288 xprt->address_strings[RPC_DISPLAY_PORT]);
291 TP_printk(
292 "socket:[%llu] dstaddr=%s/%s "
293 "state=%u (%s) sk_state=%u (%s)",
294 __entry->ino, __get_str(dstaddr), __get_str(dstport),
295 __entry->socket_state,
296 rpc_show_socket_state(__entry->socket_state),
297 __entry->sock_state,
298 rpc_show_sock_state(__entry->sock_state)
301 #define DEFINE_RPC_SOCKET_EVENT(name) \
302 DEFINE_EVENT(xs_socket_event, name, \
303 TP_PROTO( \
304 struct rpc_xprt *xprt, \
305 struct socket *socket \
306 ), \
307 TP_ARGS(xprt, socket))
309 DECLARE_EVENT_CLASS(xs_socket_event_done,
311 TP_PROTO(
312 struct rpc_xprt *xprt,
313 struct socket *socket,
314 int error
317 TP_ARGS(xprt, socket, error),
319 TP_STRUCT__entry(
320 __field(int, error)
321 __field(unsigned int, socket_state)
322 __field(unsigned int, sock_state)
323 __field(unsigned long long, ino)
324 __string(dstaddr,
325 xprt->address_strings[RPC_DISPLAY_ADDR])
326 __string(dstport,
327 xprt->address_strings[RPC_DISPLAY_PORT])
330 TP_fast_assign(
331 struct inode *inode = SOCK_INODE(socket);
332 __entry->socket_state = socket->state;
333 __entry->sock_state = socket->sk->sk_state;
334 __entry->ino = (unsigned long long)inode->i_ino;
335 __entry->error = error;
336 __assign_str(dstaddr,
337 xprt->address_strings[RPC_DISPLAY_ADDR]);
338 __assign_str(dstport,
339 xprt->address_strings[RPC_DISPLAY_PORT]);
342 TP_printk(
343 "error=%d socket:[%llu] dstaddr=%s/%s "
344 "state=%u (%s) sk_state=%u (%s)",
345 __entry->error,
346 __entry->ino, __get_str(dstaddr), __get_str(dstport),
347 __entry->socket_state,
348 rpc_show_socket_state(__entry->socket_state),
349 __entry->sock_state,
350 rpc_show_sock_state(__entry->sock_state)
353 #define DEFINE_RPC_SOCKET_EVENT_DONE(name) \
354 DEFINE_EVENT(xs_socket_event_done, name, \
355 TP_PROTO( \
356 struct rpc_xprt *xprt, \
357 struct socket *socket, \
358 int error \
359 ), \
360 TP_ARGS(xprt, socket, error))
362 DEFINE_RPC_SOCKET_EVENT(rpc_socket_state_change);
363 DEFINE_RPC_SOCKET_EVENT_DONE(rpc_socket_connect);
364 DEFINE_RPC_SOCKET_EVENT_DONE(rpc_socket_error);
365 DEFINE_RPC_SOCKET_EVENT_DONE(rpc_socket_reset_connection);
366 DEFINE_RPC_SOCKET_EVENT(rpc_socket_close);
367 DEFINE_RPC_SOCKET_EVENT(rpc_socket_shutdown);
369 DECLARE_EVENT_CLASS(rpc_xprt_event,
370 TP_PROTO(struct rpc_xprt *xprt, __be32 xid, int status),
372 TP_ARGS(xprt, xid, status),
374 TP_STRUCT__entry(
375 __field(u32, xid)
376 __field(int, status)
377 __string(addr, xprt->address_strings[RPC_DISPLAY_ADDR])
378 __string(port, xprt->address_strings[RPC_DISPLAY_PORT])
381 TP_fast_assign(
382 __entry->xid = be32_to_cpu(xid);
383 __entry->status = status;
384 __assign_str(addr, xprt->address_strings[RPC_DISPLAY_ADDR]);
385 __assign_str(port, xprt->address_strings[RPC_DISPLAY_PORT]);
388 TP_printk("peer=[%s]:%s xid=0x%08x status=%d", __get_str(addr),
389 __get_str(port), __entry->xid,
390 __entry->status)
393 DEFINE_EVENT(rpc_xprt_event, xprt_timer,
394 TP_PROTO(struct rpc_xprt *xprt, __be32 xid, int status),
395 TP_ARGS(xprt, xid, status));
397 DEFINE_EVENT(rpc_xprt_event, xprt_lookup_rqst,
398 TP_PROTO(struct rpc_xprt *xprt, __be32 xid, int status),
399 TP_ARGS(xprt, xid, status));
401 DEFINE_EVENT(rpc_xprt_event, xprt_transmit,
402 TP_PROTO(struct rpc_xprt *xprt, __be32 xid, int status),
403 TP_ARGS(xprt, xid, status));
405 DEFINE_EVENT(rpc_xprt_event, xprt_complete_rqst,
406 TP_PROTO(struct rpc_xprt *xprt, __be32 xid, int status),
407 TP_ARGS(xprt, xid, status));
409 TRACE_EVENT(xs_tcp_data_ready,
410 TP_PROTO(struct rpc_xprt *xprt, int err, unsigned int total),
412 TP_ARGS(xprt, err, total),
414 TP_STRUCT__entry(
415 __field(int, err)
416 __field(unsigned int, total)
417 __string(addr, xprt ? xprt->address_strings[RPC_DISPLAY_ADDR] :
418 "(null)")
419 __string(port, xprt ? xprt->address_strings[RPC_DISPLAY_PORT] :
420 "(null)")
423 TP_fast_assign(
424 __entry->err = err;
425 __entry->total = total;
426 __assign_str(addr, xprt ?
427 xprt->address_strings[RPC_DISPLAY_ADDR] : "(null)");
428 __assign_str(port, xprt ?
429 xprt->address_strings[RPC_DISPLAY_PORT] : "(null)");
432 TP_printk("peer=[%s]:%s err=%d total=%u", __get_str(addr),
433 __get_str(port), __entry->err, __entry->total)
436 #define rpc_show_sock_xprt_flags(flags) \
437 __print_flags(flags, "|", \
438 { TCP_RCV_LAST_FRAG, "TCP_RCV_LAST_FRAG" }, \
439 { TCP_RCV_COPY_FRAGHDR, "TCP_RCV_COPY_FRAGHDR" }, \
440 { TCP_RCV_COPY_XID, "TCP_RCV_COPY_XID" }, \
441 { TCP_RCV_COPY_DATA, "TCP_RCV_COPY_DATA" }, \
442 { TCP_RCV_READ_CALLDIR, "TCP_RCV_READ_CALLDIR" }, \
443 { TCP_RCV_COPY_CALLDIR, "TCP_RCV_COPY_CALLDIR" }, \
444 { TCP_RPC_REPLY, "TCP_RPC_REPLY" })
446 TRACE_EVENT(xs_tcp_data_recv,
447 TP_PROTO(struct sock_xprt *xs),
449 TP_ARGS(xs),
451 TP_STRUCT__entry(
452 __string(addr, xs->xprt.address_strings[RPC_DISPLAY_ADDR])
453 __string(port, xs->xprt.address_strings[RPC_DISPLAY_PORT])
454 __field(u32, xid)
455 __field(unsigned long, flags)
456 __field(unsigned long, copied)
457 __field(unsigned int, reclen)
458 __field(unsigned long, offset)
461 TP_fast_assign(
462 __assign_str(addr, xs->xprt.address_strings[RPC_DISPLAY_ADDR]);
463 __assign_str(port, xs->xprt.address_strings[RPC_DISPLAY_PORT]);
464 __entry->xid = be32_to_cpu(xs->tcp_xid);
465 __entry->flags = xs->tcp_flags;
466 __entry->copied = xs->tcp_copied;
467 __entry->reclen = xs->tcp_reclen;
468 __entry->offset = xs->tcp_offset;
471 TP_printk("peer=[%s]:%s xid=0x%08x flags=%s copied=%lu reclen=%u offset=%lu",
472 __get_str(addr), __get_str(port), __entry->xid,
473 rpc_show_sock_xprt_flags(__entry->flags),
474 __entry->copied, __entry->reclen, __entry->offset)
477 #define show_rqstp_flags(flags) \
478 __print_flags(flags, "|", \
479 { (1UL << RQ_SECURE), "RQ_SECURE"}, \
480 { (1UL << RQ_LOCAL), "RQ_LOCAL"}, \
481 { (1UL << RQ_USEDEFERRAL), "RQ_USEDEFERRAL"}, \
482 { (1UL << RQ_DROPME), "RQ_DROPME"}, \
483 { (1UL << RQ_SPLICE_OK), "RQ_SPLICE_OK"}, \
484 { (1UL << RQ_VICTIM), "RQ_VICTIM"}, \
485 { (1UL << RQ_BUSY), "RQ_BUSY"})
487 TRACE_EVENT(svc_recv,
488 TP_PROTO(struct svc_rqst *rqst, int status),
490 TP_ARGS(rqst, status),
492 TP_STRUCT__entry(
493 __field(u32, xid)
494 __field(int, status)
495 __field(unsigned long, flags)
496 __dynamic_array(unsigned char, addr, rqst->rq_addrlen)
499 TP_fast_assign(
500 __entry->xid = status > 0 ? be32_to_cpu(rqst->rq_xid) : 0;
501 __entry->status = status;
502 __entry->flags = rqst->rq_flags;
503 memcpy(__get_dynamic_array(addr),
504 &rqst->rq_addr, rqst->rq_addrlen);
507 TP_printk("addr=%pIScp xid=0x%08x status=%d flags=%s",
508 (struct sockaddr *)__get_dynamic_array(addr),
509 __entry->xid, __entry->status,
510 show_rqstp_flags(__entry->flags))
513 DECLARE_EVENT_CLASS(svc_rqst_event,
515 TP_PROTO(struct svc_rqst *rqst),
517 TP_ARGS(rqst),
519 TP_STRUCT__entry(
520 __field(u32, xid)
521 __field(unsigned long, flags)
522 __dynamic_array(unsigned char, addr, rqst->rq_addrlen)
525 TP_fast_assign(
526 __entry->xid = be32_to_cpu(rqst->rq_xid);
527 __entry->flags = rqst->rq_flags;
528 memcpy(__get_dynamic_array(addr),
529 &rqst->rq_addr, rqst->rq_addrlen);
532 TP_printk("addr=%pIScp rq_xid=0x%08x flags=%s",
533 (struct sockaddr *)__get_dynamic_array(addr),
534 __entry->xid,
535 show_rqstp_flags(__entry->flags))
538 DEFINE_EVENT(svc_rqst_event, svc_defer,
539 TP_PROTO(struct svc_rqst *rqst),
540 TP_ARGS(rqst));
542 DEFINE_EVENT(svc_rqst_event, svc_drop,
543 TP_PROTO(struct svc_rqst *rqst),
544 TP_ARGS(rqst));
546 DECLARE_EVENT_CLASS(svc_rqst_status,
548 TP_PROTO(struct svc_rqst *rqst, int status),
550 TP_ARGS(rqst, status),
552 TP_STRUCT__entry(
553 __field(u32, xid)
554 __field(int, status)
555 __field(unsigned long, flags)
556 __dynamic_array(unsigned char, addr, rqst->rq_addrlen)
559 TP_fast_assign(
560 __entry->xid = be32_to_cpu(rqst->rq_xid);
561 __entry->status = status;
562 __entry->flags = rqst->rq_flags;
563 memcpy(__get_dynamic_array(addr),
564 &rqst->rq_addr, rqst->rq_addrlen);
567 TP_printk("addr=%pIScp rq_xid=0x%08x status=%d flags=%s",
568 (struct sockaddr *)__get_dynamic_array(addr),
569 __entry->xid,
570 __entry->status, show_rqstp_flags(__entry->flags))
573 DEFINE_EVENT(svc_rqst_status, svc_process,
574 TP_PROTO(struct svc_rqst *rqst, int status),
575 TP_ARGS(rqst, status));
577 DEFINE_EVENT(svc_rqst_status, svc_send,
578 TP_PROTO(struct svc_rqst *rqst, int status),
579 TP_ARGS(rqst, status));
581 #define show_svc_xprt_flags(flags) \
582 __print_flags(flags, "|", \
583 { (1UL << XPT_BUSY), "XPT_BUSY"}, \
584 { (1UL << XPT_CONN), "XPT_CONN"}, \
585 { (1UL << XPT_CLOSE), "XPT_CLOSE"}, \
586 { (1UL << XPT_DATA), "XPT_DATA"}, \
587 { (1UL << XPT_TEMP), "XPT_TEMP"}, \
588 { (1UL << XPT_DEAD), "XPT_DEAD"}, \
589 { (1UL << XPT_CHNGBUF), "XPT_CHNGBUF"}, \
590 { (1UL << XPT_DEFERRED), "XPT_DEFERRED"}, \
591 { (1UL << XPT_OLD), "XPT_OLD"}, \
592 { (1UL << XPT_LISTENER), "XPT_LISTENER"}, \
593 { (1UL << XPT_CACHE_AUTH), "XPT_CACHE_AUTH"}, \
594 { (1UL << XPT_LOCAL), "XPT_LOCAL"})
596 TRACE_EVENT(svc_xprt_do_enqueue,
597 TP_PROTO(struct svc_xprt *xprt, struct svc_rqst *rqst),
599 TP_ARGS(xprt, rqst),
601 TP_STRUCT__entry(
602 __field(struct svc_xprt *, xprt)
603 __field(int, pid)
604 __field(unsigned long, flags)
605 __dynamic_array(unsigned char, addr, xprt != NULL ?
606 xprt->xpt_remotelen : 0)
609 TP_fast_assign(
610 __entry->xprt = xprt;
611 __entry->pid = rqst? rqst->rq_task->pid : 0;
612 if (xprt) {
613 memcpy(__get_dynamic_array(addr),
614 &xprt->xpt_remote,
615 xprt->xpt_remotelen);
616 __entry->flags = xprt->xpt_flags;
617 } else
618 __entry->flags = 0;
621 TP_printk("xprt=0x%p addr=%pIScp pid=%d flags=%s", __entry->xprt,
622 __get_dynamic_array_len(addr) != 0 ?
623 (struct sockaddr *)__get_dynamic_array(addr) : NULL,
624 __entry->pid, show_svc_xprt_flags(__entry->flags))
627 DECLARE_EVENT_CLASS(svc_xprt_event,
628 TP_PROTO(struct svc_xprt *xprt),
630 TP_ARGS(xprt),
632 TP_STRUCT__entry(
633 __field(struct svc_xprt *, xprt)
634 __field(unsigned long, flags)
635 __dynamic_array(unsigned char, addr, xprt != NULL ?
636 xprt->xpt_remotelen : 0)
639 TP_fast_assign(
640 __entry->xprt = xprt;
641 if (xprt) {
642 memcpy(__get_dynamic_array(addr),
643 &xprt->xpt_remote,
644 xprt->xpt_remotelen);
645 __entry->flags = xprt->xpt_flags;
646 } else
647 __entry->flags = 0;
650 TP_printk("xprt=0x%p addr=%pIScp flags=%s", __entry->xprt,
651 __get_dynamic_array_len(addr) != 0 ?
652 (struct sockaddr *)__get_dynamic_array(addr) : NULL,
653 show_svc_xprt_flags(__entry->flags))
656 DEFINE_EVENT(svc_xprt_event, svc_xprt_dequeue,
657 TP_PROTO(struct svc_xprt *xprt),
658 TP_ARGS(xprt));
660 DEFINE_EVENT(svc_xprt_event, svc_xprt_no_write_space,
661 TP_PROTO(struct svc_xprt *xprt),
662 TP_ARGS(xprt));
664 TRACE_EVENT(svc_wake_up,
665 TP_PROTO(int pid),
667 TP_ARGS(pid),
669 TP_STRUCT__entry(
670 __field(int, pid)
673 TP_fast_assign(
674 __entry->pid = pid;
677 TP_printk("pid=%d", __entry->pid)
680 TRACE_EVENT(svc_handle_xprt,
681 TP_PROTO(struct svc_xprt *xprt, int len),
683 TP_ARGS(xprt, len),
685 TP_STRUCT__entry(
686 __field(struct svc_xprt *, xprt)
687 __field(int, len)
688 __field(unsigned long, flags)
689 __dynamic_array(unsigned char, addr, xprt != NULL ?
690 xprt->xpt_remotelen : 0)
693 TP_fast_assign(
694 __entry->xprt = xprt;
695 __entry->len = len;
696 if (xprt) {
697 memcpy(__get_dynamic_array(addr),
698 &xprt->xpt_remote,
699 xprt->xpt_remotelen);
700 __entry->flags = xprt->xpt_flags;
701 } else
702 __entry->flags = 0;
705 TP_printk("xprt=0x%p addr=%pIScp len=%d flags=%s", __entry->xprt,
706 __get_dynamic_array_len(addr) != 0 ?
707 (struct sockaddr *)__get_dynamic_array(addr) : NULL,
708 __entry->len, show_svc_xprt_flags(__entry->flags))
712 DECLARE_EVENT_CLASS(svc_deferred_event,
713 TP_PROTO(struct svc_deferred_req *dr),
715 TP_ARGS(dr),
717 TP_STRUCT__entry(
718 __field(u32, xid)
719 __dynamic_array(unsigned char, addr, dr->addrlen)
722 TP_fast_assign(
723 __entry->xid = be32_to_cpu(*(__be32 *)(dr->args +
724 (dr->xprt_hlen>>2)));
725 memcpy(__get_dynamic_array(addr), &dr->addr, dr->addrlen);
728 TP_printk("addr=%pIScp xid=0x%08x",
729 (struct sockaddr *)__get_dynamic_array(addr),
730 __entry->xid)
733 DEFINE_EVENT(svc_deferred_event, svc_drop_deferred,
734 TP_PROTO(struct svc_deferred_req *dr),
735 TP_ARGS(dr));
736 DEFINE_EVENT(svc_deferred_event, svc_revisit_deferred,
737 TP_PROTO(struct svc_deferred_req *dr),
738 TP_ARGS(dr));
739 #endif /* _TRACE_SUNRPC_H */
741 #include <trace/define_trace.h>