Linux 4.18.10
[linux/fpc-iii.git] / include / trace / events / sunrpc.h
blobbbb08a3ef5ccce100d2551580b35f6b42fa1fa9e
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(const struct rpc_task *task),
55 TP_ARGS(task),
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 = task->tk_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_task *task, const void *action),
108 TP_ARGS(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 = task->tk_client ?
121 task->tk_client->cl_clid : -1;
122 __entry->task_id = task->tk_pid;
123 __entry->action = action;
124 __entry->runstate = task->tk_runstate;
125 __entry->status = task->tk_status;
126 __entry->flags = task->tk_flags;
129 TP_printk("task:%u@%d flags=%4.4x state=%4.4lx status=%d action=%pf",
130 __entry->task_id, __entry->client_id,
131 __entry->flags,
132 __entry->runstate,
133 __entry->status,
134 __entry->action
138 DEFINE_EVENT(rpc_task_running, rpc_task_begin,
140 TP_PROTO(const struct rpc_task *task, const void *action),
142 TP_ARGS(task, action)
146 DEFINE_EVENT(rpc_task_running, rpc_task_run_action,
148 TP_PROTO(const struct rpc_task *task, const void *action),
150 TP_ARGS(task, action)
154 DEFINE_EVENT(rpc_task_running, rpc_task_complete,
156 TP_PROTO(const struct rpc_task *task, const void *action),
158 TP_ARGS(task, action)
162 DECLARE_EVENT_CLASS(rpc_task_queued,
164 TP_PROTO(const struct rpc_task *task, const struct rpc_wait_queue *q),
166 TP_ARGS(task, q),
168 TP_STRUCT__entry(
169 __field(unsigned int, task_id)
170 __field(unsigned int, client_id)
171 __field(unsigned long, timeout)
172 __field(unsigned long, runstate)
173 __field(int, status)
174 __field(unsigned short, flags)
175 __string(q_name, rpc_qname(q))
178 TP_fast_assign(
179 __entry->client_id = task->tk_client ?
180 task->tk_client->cl_clid : -1;
181 __entry->task_id = task->tk_pid;
182 __entry->timeout = task->tk_timeout;
183 __entry->runstate = task->tk_runstate;
184 __entry->status = task->tk_status;
185 __entry->flags = task->tk_flags;
186 __assign_str(q_name, rpc_qname(q));
189 TP_printk("task:%u@%d flags=%4.4x state=%4.4lx status=%d timeout=%lu queue=%s",
190 __entry->task_id, __entry->client_id,
191 __entry->flags,
192 __entry->runstate,
193 __entry->status,
194 __entry->timeout,
195 __get_str(q_name)
199 DEFINE_EVENT(rpc_task_queued, rpc_task_sleep,
201 TP_PROTO(const struct rpc_task *task, const struct rpc_wait_queue *q),
203 TP_ARGS(task, q)
207 DEFINE_EVENT(rpc_task_queued, rpc_task_wakeup,
209 TP_PROTO(const struct rpc_task *task, const struct rpc_wait_queue *q),
211 TP_ARGS(task, q)
215 TRACE_EVENT(rpc_stats_latency,
217 TP_PROTO(
218 const struct rpc_task *task,
219 ktime_t backlog,
220 ktime_t rtt,
221 ktime_t execute
224 TP_ARGS(task, backlog, rtt, execute),
226 TP_STRUCT__entry(
227 __field(unsigned int, task_id)
228 __field(unsigned int, client_id)
229 __field(u32, xid)
230 __field(int, version)
231 __string(progname, task->tk_client->cl_program->name)
232 __string(procname, rpc_proc_name(task))
233 __field(unsigned long, backlog)
234 __field(unsigned long, rtt)
235 __field(unsigned long, execute)
238 TP_fast_assign(
239 __entry->client_id = task->tk_client->cl_clid;
240 __entry->task_id = task->tk_pid;
241 __entry->xid = be32_to_cpu(task->tk_rqstp->rq_xid);
242 __entry->version = task->tk_client->cl_vers;
243 __assign_str(progname, task->tk_client->cl_program->name)
244 __assign_str(procname, rpc_proc_name(task))
245 __entry->backlog = ktime_to_us(backlog);
246 __entry->rtt = ktime_to_us(rtt);
247 __entry->execute = ktime_to_us(execute);
250 TP_printk("task:%u@%d xid=0x%08x %sv%d %s backlog=%lu rtt=%lu execute=%lu",
251 __entry->task_id, __entry->client_id, __entry->xid,
252 __get_str(progname), __entry->version, __get_str(procname),
253 __entry->backlog, __entry->rtt, __entry->execute)
257 * First define the enums in the below macros to be exported to userspace
258 * via TRACE_DEFINE_ENUM().
260 #undef EM
261 #undef EMe
262 #define EM(a, b) TRACE_DEFINE_ENUM(a);
263 #define EMe(a, b) TRACE_DEFINE_ENUM(a);
265 #define RPC_SHOW_SOCKET \
266 EM( SS_FREE, "FREE" ) \
267 EM( SS_UNCONNECTED, "UNCONNECTED" ) \
268 EM( SS_CONNECTING, "CONNECTING," ) \
269 EM( SS_CONNECTED, "CONNECTED," ) \
270 EMe(SS_DISCONNECTING, "DISCONNECTING" )
272 #define rpc_show_socket_state(state) \
273 __print_symbolic(state, RPC_SHOW_SOCKET)
275 RPC_SHOW_SOCKET
277 #define RPC_SHOW_SOCK \
278 EM( TCP_ESTABLISHED, "ESTABLISHED" ) \
279 EM( TCP_SYN_SENT, "SYN_SENT" ) \
280 EM( TCP_SYN_RECV, "SYN_RECV" ) \
281 EM( TCP_FIN_WAIT1, "FIN_WAIT1" ) \
282 EM( TCP_FIN_WAIT2, "FIN_WAIT2" ) \
283 EM( TCP_TIME_WAIT, "TIME_WAIT" ) \
284 EM( TCP_CLOSE, "CLOSE" ) \
285 EM( TCP_CLOSE_WAIT, "CLOSE_WAIT" ) \
286 EM( TCP_LAST_ACK, "LAST_ACK" ) \
287 EM( TCP_LISTEN, "LISTEN" ) \
288 EMe( TCP_CLOSING, "CLOSING" )
290 #define rpc_show_sock_state(state) \
291 __print_symbolic(state, RPC_SHOW_SOCK)
293 RPC_SHOW_SOCK
296 * Now redefine the EM() and EMe() macros to map the enums to the strings
297 * that will be printed in the output.
299 #undef EM
300 #undef EMe
301 #define EM(a, b) {a, b},
302 #define EMe(a, b) {a, b}
304 DECLARE_EVENT_CLASS(xs_socket_event,
306 TP_PROTO(
307 struct rpc_xprt *xprt,
308 struct socket *socket
311 TP_ARGS(xprt, socket),
313 TP_STRUCT__entry(
314 __field(unsigned int, socket_state)
315 __field(unsigned int, sock_state)
316 __field(unsigned long long, ino)
317 __string(dstaddr,
318 xprt->address_strings[RPC_DISPLAY_ADDR])
319 __string(dstport,
320 xprt->address_strings[RPC_DISPLAY_PORT])
323 TP_fast_assign(
324 struct inode *inode = SOCK_INODE(socket);
325 __entry->socket_state = socket->state;
326 __entry->sock_state = socket->sk->sk_state;
327 __entry->ino = (unsigned long long)inode->i_ino;
328 __assign_str(dstaddr,
329 xprt->address_strings[RPC_DISPLAY_ADDR]);
330 __assign_str(dstport,
331 xprt->address_strings[RPC_DISPLAY_PORT]);
334 TP_printk(
335 "socket:[%llu] dstaddr=%s/%s "
336 "state=%u (%s) sk_state=%u (%s)",
337 __entry->ino, __get_str(dstaddr), __get_str(dstport),
338 __entry->socket_state,
339 rpc_show_socket_state(__entry->socket_state),
340 __entry->sock_state,
341 rpc_show_sock_state(__entry->sock_state)
344 #define DEFINE_RPC_SOCKET_EVENT(name) \
345 DEFINE_EVENT(xs_socket_event, name, \
346 TP_PROTO( \
347 struct rpc_xprt *xprt, \
348 struct socket *socket \
349 ), \
350 TP_ARGS(xprt, socket))
352 DECLARE_EVENT_CLASS(xs_socket_event_done,
354 TP_PROTO(
355 struct rpc_xprt *xprt,
356 struct socket *socket,
357 int error
360 TP_ARGS(xprt, socket, error),
362 TP_STRUCT__entry(
363 __field(int, error)
364 __field(unsigned int, socket_state)
365 __field(unsigned int, sock_state)
366 __field(unsigned long long, ino)
367 __string(dstaddr,
368 xprt->address_strings[RPC_DISPLAY_ADDR])
369 __string(dstport,
370 xprt->address_strings[RPC_DISPLAY_PORT])
373 TP_fast_assign(
374 struct inode *inode = SOCK_INODE(socket);
375 __entry->socket_state = socket->state;
376 __entry->sock_state = socket->sk->sk_state;
377 __entry->ino = (unsigned long long)inode->i_ino;
378 __entry->error = error;
379 __assign_str(dstaddr,
380 xprt->address_strings[RPC_DISPLAY_ADDR]);
381 __assign_str(dstport,
382 xprt->address_strings[RPC_DISPLAY_PORT]);
385 TP_printk(
386 "error=%d socket:[%llu] dstaddr=%s/%s "
387 "state=%u (%s) sk_state=%u (%s)",
388 __entry->error,
389 __entry->ino, __get_str(dstaddr), __get_str(dstport),
390 __entry->socket_state,
391 rpc_show_socket_state(__entry->socket_state),
392 __entry->sock_state,
393 rpc_show_sock_state(__entry->sock_state)
396 #define DEFINE_RPC_SOCKET_EVENT_DONE(name) \
397 DEFINE_EVENT(xs_socket_event_done, name, \
398 TP_PROTO( \
399 struct rpc_xprt *xprt, \
400 struct socket *socket, \
401 int error \
402 ), \
403 TP_ARGS(xprt, socket, error))
405 DEFINE_RPC_SOCKET_EVENT(rpc_socket_state_change);
406 DEFINE_RPC_SOCKET_EVENT_DONE(rpc_socket_connect);
407 DEFINE_RPC_SOCKET_EVENT_DONE(rpc_socket_error);
408 DEFINE_RPC_SOCKET_EVENT_DONE(rpc_socket_reset_connection);
409 DEFINE_RPC_SOCKET_EVENT(rpc_socket_close);
410 DEFINE_RPC_SOCKET_EVENT(rpc_socket_shutdown);
412 DECLARE_EVENT_CLASS(rpc_xprt_event,
413 TP_PROTO(struct rpc_xprt *xprt, __be32 xid, int status),
415 TP_ARGS(xprt, xid, status),
417 TP_STRUCT__entry(
418 __field(u32, xid)
419 __field(int, status)
420 __string(addr, xprt->address_strings[RPC_DISPLAY_ADDR])
421 __string(port, xprt->address_strings[RPC_DISPLAY_PORT])
424 TP_fast_assign(
425 __entry->xid = be32_to_cpu(xid);
426 __entry->status = status;
427 __assign_str(addr, xprt->address_strings[RPC_DISPLAY_ADDR]);
428 __assign_str(port, xprt->address_strings[RPC_DISPLAY_PORT]);
431 TP_printk("peer=[%s]:%s xid=0x%08x status=%d", __get_str(addr),
432 __get_str(port), __entry->xid,
433 __entry->status)
436 DEFINE_EVENT(rpc_xprt_event, xprt_timer,
437 TP_PROTO(struct rpc_xprt *xprt, __be32 xid, int status),
438 TP_ARGS(xprt, xid, status));
440 DEFINE_EVENT(rpc_xprt_event, xprt_lookup_rqst,
441 TP_PROTO(struct rpc_xprt *xprt, __be32 xid, int status),
442 TP_ARGS(xprt, xid, status));
444 DEFINE_EVENT(rpc_xprt_event, xprt_transmit,
445 TP_PROTO(struct rpc_xprt *xprt, __be32 xid, int status),
446 TP_ARGS(xprt, xid, status));
448 DEFINE_EVENT(rpc_xprt_event, xprt_complete_rqst,
449 TP_PROTO(struct rpc_xprt *xprt, __be32 xid, int status),
450 TP_ARGS(xprt, xid, status));
452 TRACE_EVENT(xprt_ping,
453 TP_PROTO(const struct rpc_xprt *xprt, int status),
455 TP_ARGS(xprt, status),
457 TP_STRUCT__entry(
458 __field(int, status)
459 __string(addr, xprt->address_strings[RPC_DISPLAY_ADDR])
460 __string(port, xprt->address_strings[RPC_DISPLAY_PORT])
463 TP_fast_assign(
464 __entry->status = status;
465 __assign_str(addr, xprt->address_strings[RPC_DISPLAY_ADDR]);
466 __assign_str(port, xprt->address_strings[RPC_DISPLAY_PORT]);
469 TP_printk("peer=[%s]:%s status=%d",
470 __get_str(addr), __get_str(port), __entry->status)
473 TRACE_EVENT(xs_tcp_data_ready,
474 TP_PROTO(struct rpc_xprt *xprt, int err, unsigned int total),
476 TP_ARGS(xprt, err, total),
478 TP_STRUCT__entry(
479 __field(int, err)
480 __field(unsigned int, total)
481 __string(addr, xprt ? xprt->address_strings[RPC_DISPLAY_ADDR] :
482 "(null)")
483 __string(port, xprt ? xprt->address_strings[RPC_DISPLAY_PORT] :
484 "(null)")
487 TP_fast_assign(
488 __entry->err = err;
489 __entry->total = total;
490 __assign_str(addr, xprt ?
491 xprt->address_strings[RPC_DISPLAY_ADDR] : "(null)");
492 __assign_str(port, xprt ?
493 xprt->address_strings[RPC_DISPLAY_PORT] : "(null)");
496 TP_printk("peer=[%s]:%s err=%d total=%u", __get_str(addr),
497 __get_str(port), __entry->err, __entry->total)
500 #define rpc_show_sock_xprt_flags(flags) \
501 __print_flags(flags, "|", \
502 { TCP_RCV_LAST_FRAG, "TCP_RCV_LAST_FRAG" }, \
503 { TCP_RCV_COPY_FRAGHDR, "TCP_RCV_COPY_FRAGHDR" }, \
504 { TCP_RCV_COPY_XID, "TCP_RCV_COPY_XID" }, \
505 { TCP_RCV_COPY_DATA, "TCP_RCV_COPY_DATA" }, \
506 { TCP_RCV_READ_CALLDIR, "TCP_RCV_READ_CALLDIR" }, \
507 { TCP_RCV_COPY_CALLDIR, "TCP_RCV_COPY_CALLDIR" }, \
508 { TCP_RPC_REPLY, "TCP_RPC_REPLY" })
510 TRACE_EVENT(xs_tcp_data_recv,
511 TP_PROTO(struct sock_xprt *xs),
513 TP_ARGS(xs),
515 TP_STRUCT__entry(
516 __string(addr, xs->xprt.address_strings[RPC_DISPLAY_ADDR])
517 __string(port, xs->xprt.address_strings[RPC_DISPLAY_PORT])
518 __field(u32, xid)
519 __field(unsigned long, flags)
520 __field(unsigned long, copied)
521 __field(unsigned int, reclen)
522 __field(unsigned long, offset)
525 TP_fast_assign(
526 __assign_str(addr, xs->xprt.address_strings[RPC_DISPLAY_ADDR]);
527 __assign_str(port, xs->xprt.address_strings[RPC_DISPLAY_PORT]);
528 __entry->xid = be32_to_cpu(xs->tcp_xid);
529 __entry->flags = xs->tcp_flags;
530 __entry->copied = xs->tcp_copied;
531 __entry->reclen = xs->tcp_reclen;
532 __entry->offset = xs->tcp_offset;
535 TP_printk("peer=[%s]:%s xid=0x%08x flags=%s copied=%lu reclen=%u offset=%lu",
536 __get_str(addr), __get_str(port), __entry->xid,
537 rpc_show_sock_xprt_flags(__entry->flags),
538 __entry->copied, __entry->reclen, __entry->offset)
541 #define show_rqstp_flags(flags) \
542 __print_flags(flags, "|", \
543 { (1UL << RQ_SECURE), "RQ_SECURE"}, \
544 { (1UL << RQ_LOCAL), "RQ_LOCAL"}, \
545 { (1UL << RQ_USEDEFERRAL), "RQ_USEDEFERRAL"}, \
546 { (1UL << RQ_DROPME), "RQ_DROPME"}, \
547 { (1UL << RQ_SPLICE_OK), "RQ_SPLICE_OK"}, \
548 { (1UL << RQ_VICTIM), "RQ_VICTIM"}, \
549 { (1UL << RQ_BUSY), "RQ_BUSY"})
551 TRACE_EVENT(svc_recv,
552 TP_PROTO(struct svc_rqst *rqst, int len),
554 TP_ARGS(rqst, len),
556 TP_STRUCT__entry(
557 __field(u32, xid)
558 __field(int, len)
559 __field(unsigned long, flags)
560 __string(addr, rqst->rq_xprt->xpt_remotebuf)
563 TP_fast_assign(
564 __entry->xid = be32_to_cpu(rqst->rq_xid);
565 __entry->len = len;
566 __entry->flags = rqst->rq_flags;
567 __assign_str(addr, rqst->rq_xprt->xpt_remotebuf);
570 TP_printk("addr=%s xid=0x%08x len=%d flags=%s",
571 __get_str(addr), __entry->xid, __entry->len,
572 show_rqstp_flags(__entry->flags))
575 TRACE_EVENT(svc_process,
576 TP_PROTO(const struct svc_rqst *rqst, const char *name),
578 TP_ARGS(rqst, name),
580 TP_STRUCT__entry(
581 __field(u32, xid)
582 __field(u32, vers)
583 __field(u32, proc)
584 __string(service, name)
585 __string(addr, rqst->rq_xprt->xpt_remotebuf)
588 TP_fast_assign(
589 __entry->xid = be32_to_cpu(rqst->rq_xid);
590 __entry->vers = rqst->rq_vers;
591 __entry->proc = rqst->rq_proc;
592 __assign_str(service, name);
593 __assign_str(addr, rqst->rq_xprt->xpt_remotebuf);
596 TP_printk("addr=%s xid=0x%08x service=%s vers=%u proc=%u",
597 __get_str(addr), __entry->xid,
598 __get_str(service), __entry->vers, __entry->proc)
601 DECLARE_EVENT_CLASS(svc_rqst_event,
603 TP_PROTO(struct svc_rqst *rqst),
605 TP_ARGS(rqst),
607 TP_STRUCT__entry(
608 __field(u32, xid)
609 __field(unsigned long, flags)
610 __string(addr, rqst->rq_xprt->xpt_remotebuf)
613 TP_fast_assign(
614 __entry->xid = be32_to_cpu(rqst->rq_xid);
615 __entry->flags = rqst->rq_flags;
616 __assign_str(addr, rqst->rq_xprt->xpt_remotebuf);
619 TP_printk("addr=%s xid=0x%08x flags=%s",
620 __get_str(addr), __entry->xid,
621 show_rqstp_flags(__entry->flags))
624 DEFINE_EVENT(svc_rqst_event, svc_defer,
625 TP_PROTO(struct svc_rqst *rqst),
626 TP_ARGS(rqst));
628 DEFINE_EVENT(svc_rqst_event, svc_drop,
629 TP_PROTO(struct svc_rqst *rqst),
630 TP_ARGS(rqst));
632 DECLARE_EVENT_CLASS(svc_rqst_status,
634 TP_PROTO(struct svc_rqst *rqst, int status),
636 TP_ARGS(rqst, status),
638 TP_STRUCT__entry(
639 __field(u32, xid)
640 __field(int, status)
641 __field(unsigned long, flags)
642 __string(addr, rqst->rq_xprt->xpt_remotebuf)
645 TP_fast_assign(
646 __entry->xid = be32_to_cpu(rqst->rq_xid);
647 __entry->status = status;
648 __entry->flags = rqst->rq_flags;
649 __assign_str(addr, rqst->rq_xprt->xpt_remotebuf);
652 TP_printk("addr=%s xid=0x%08x status=%d flags=%s",
653 __get_str(addr), __entry->xid,
654 __entry->status, show_rqstp_flags(__entry->flags))
657 DEFINE_EVENT(svc_rqst_status, svc_send,
658 TP_PROTO(struct svc_rqst *rqst, int status),
659 TP_ARGS(rqst, status));
661 #define show_svc_xprt_flags(flags) \
662 __print_flags(flags, "|", \
663 { (1UL << XPT_BUSY), "XPT_BUSY"}, \
664 { (1UL << XPT_CONN), "XPT_CONN"}, \
665 { (1UL << XPT_CLOSE), "XPT_CLOSE"}, \
666 { (1UL << XPT_DATA), "XPT_DATA"}, \
667 { (1UL << XPT_TEMP), "XPT_TEMP"}, \
668 { (1UL << XPT_DEAD), "XPT_DEAD"}, \
669 { (1UL << XPT_CHNGBUF), "XPT_CHNGBUF"}, \
670 { (1UL << XPT_DEFERRED), "XPT_DEFERRED"}, \
671 { (1UL << XPT_OLD), "XPT_OLD"}, \
672 { (1UL << XPT_LISTENER), "XPT_LISTENER"}, \
673 { (1UL << XPT_CACHE_AUTH), "XPT_CACHE_AUTH"}, \
674 { (1UL << XPT_LOCAL), "XPT_LOCAL"}, \
675 { (1UL << XPT_KILL_TEMP), "XPT_KILL_TEMP"}, \
676 { (1UL << XPT_CONG_CTRL), "XPT_CONG_CTRL"})
678 TRACE_EVENT(svc_xprt_do_enqueue,
679 TP_PROTO(struct svc_xprt *xprt, struct svc_rqst *rqst),
681 TP_ARGS(xprt, rqst),
683 TP_STRUCT__entry(
684 __field(struct svc_xprt *, xprt)
685 __field(int, pid)
686 __field(unsigned long, flags)
687 __string(addr, xprt->xpt_remotebuf)
690 TP_fast_assign(
691 __entry->xprt = xprt;
692 __entry->pid = rqst? rqst->rq_task->pid : 0;
693 __entry->flags = xprt->xpt_flags;
694 __assign_str(addr, xprt->xpt_remotebuf);
697 TP_printk("xprt=%p addr=%s pid=%d flags=%s",
698 __entry->xprt, __get_str(addr),
699 __entry->pid, show_svc_xprt_flags(__entry->flags))
702 DECLARE_EVENT_CLASS(svc_xprt_event,
703 TP_PROTO(struct svc_xprt *xprt),
705 TP_ARGS(xprt),
707 TP_STRUCT__entry(
708 __field(struct svc_xprt *, xprt)
709 __field(unsigned long, flags)
710 __string(addr, xprt->xpt_remotebuf)
713 TP_fast_assign(
714 __entry->xprt = xprt;
715 __entry->flags = xprt->xpt_flags;
716 __assign_str(addr, xprt->xpt_remotebuf);
719 TP_printk("xprt=%p addr=%s flags=%s",
720 __entry->xprt, __get_str(addr),
721 show_svc_xprt_flags(__entry->flags))
724 DEFINE_EVENT(svc_xprt_event, svc_xprt_no_write_space,
725 TP_PROTO(struct svc_xprt *xprt),
726 TP_ARGS(xprt));
728 TRACE_EVENT(svc_xprt_dequeue,
729 TP_PROTO(struct svc_rqst *rqst),
731 TP_ARGS(rqst),
733 TP_STRUCT__entry(
734 __field(struct svc_xprt *, xprt)
735 __field(unsigned long, flags)
736 __field(unsigned long, wakeup)
737 __string(addr, rqst->rq_xprt->xpt_remotebuf)
740 TP_fast_assign(
741 __entry->xprt = rqst->rq_xprt;
742 __entry->flags = rqst->rq_xprt->xpt_flags;
743 __entry->wakeup = ktime_to_us(ktime_sub(ktime_get(),
744 rqst->rq_qtime));
745 __assign_str(addr, rqst->rq_xprt->xpt_remotebuf);
748 TP_printk("xprt=%p addr=%s flags=%s wakeup-us=%lu",
749 __entry->xprt, __get_str(addr),
750 show_svc_xprt_flags(__entry->flags),
751 __entry->wakeup)
754 TRACE_EVENT(svc_wake_up,
755 TP_PROTO(int pid),
757 TP_ARGS(pid),
759 TP_STRUCT__entry(
760 __field(int, pid)
763 TP_fast_assign(
764 __entry->pid = pid;
767 TP_printk("pid=%d", __entry->pid)
770 TRACE_EVENT(svc_handle_xprt,
771 TP_PROTO(struct svc_xprt *xprt, int len),
773 TP_ARGS(xprt, len),
775 TP_STRUCT__entry(
776 __field(struct svc_xprt *, xprt)
777 __field(int, len)
778 __field(unsigned long, flags)
779 __string(addr, xprt->xpt_remotebuf)
782 TP_fast_assign(
783 __entry->xprt = xprt;
784 __entry->len = len;
785 __entry->flags = xprt->xpt_flags;
786 __assign_str(addr, xprt->xpt_remotebuf);
789 TP_printk("xprt=%p addr=%s len=%d flags=%s",
790 __entry->xprt, __get_str(addr),
791 __entry->len, show_svc_xprt_flags(__entry->flags))
794 TRACE_EVENT(svc_stats_latency,
795 TP_PROTO(const struct svc_rqst *rqst),
797 TP_ARGS(rqst),
799 TP_STRUCT__entry(
800 __field(u32, xid)
801 __field(unsigned long, execute)
802 __string(addr, rqst->rq_xprt->xpt_remotebuf)
805 TP_fast_assign(
806 __entry->xid = be32_to_cpu(rqst->rq_xid);
807 __entry->execute = ktime_to_us(ktime_sub(ktime_get(),
808 rqst->rq_stime));
809 __assign_str(addr, rqst->rq_xprt->xpt_remotebuf);
812 TP_printk("addr=%s xid=0x%08x execute-us=%lu",
813 __get_str(addr), __entry->xid, __entry->execute)
816 DECLARE_EVENT_CLASS(svc_deferred_event,
817 TP_PROTO(struct svc_deferred_req *dr),
819 TP_ARGS(dr),
821 TP_STRUCT__entry(
822 __field(u32, xid)
823 __string(addr, dr->xprt->xpt_remotebuf)
826 TP_fast_assign(
827 __entry->xid = be32_to_cpu(*(__be32 *)(dr->args +
828 (dr->xprt_hlen>>2)));
829 __assign_str(addr, dr->xprt->xpt_remotebuf);
832 TP_printk("addr=%s xid=0x%08x", __get_str(addr), __entry->xid)
835 DEFINE_EVENT(svc_deferred_event, svc_drop_deferred,
836 TP_PROTO(struct svc_deferred_req *dr),
837 TP_ARGS(dr));
838 DEFINE_EVENT(svc_deferred_event, svc_revisit_deferred,
839 TP_PROTO(struct svc_deferred_req *dr),
840 TP_ARGS(dr));
841 #endif /* _TRACE_SUNRPC_H */
843 #include <trace/define_trace.h>