diff options
author | Jeff Layton <jlayton@primarydata.com> | 2014-11-21 14:19:31 -0500 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2014-12-09 11:29:14 -0500 |
commit | 83a712e0afefaf68555f816ea78ecd2862c6cf30 (patch) | |
tree | 05e25469b98a7f437209ea0a50580d7f291c3d90 /include/trace | |
parent | b1691bc03d4eddb959234409167bef9be9e62d74 (diff) |
sunrpc: add some tracepoints around enqueue and dequeue of svc_xprt
These were useful when I was tracking down a race condition between
svc_xprt_do_enqueue and svc_get_next_xprt.
Signed-off-by: Jeff Layton <jlayton@primarydata.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'include/trace')
-rw-r--r-- | include/trace/events/sunrpc.h | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/include/trace/events/sunrpc.h b/include/trace/events/sunrpc.h index ee4438a63a48..b9c1dc6c825a 100644 --- a/include/trace/events/sunrpc.h +++ b/include/trace/events/sunrpc.h | |||
@@ -8,6 +8,7 @@ | |||
8 | #include <linux/sunrpc/clnt.h> | 8 | #include <linux/sunrpc/clnt.h> |
9 | #include <linux/sunrpc/svc.h> | 9 | #include <linux/sunrpc/svc.h> |
10 | #include <linux/sunrpc/xprtsock.h> | 10 | #include <linux/sunrpc/xprtsock.h> |
11 | #include <linux/sunrpc/svc_xprt.h> | ||
11 | #include <net/tcp_states.h> | 12 | #include <net/tcp_states.h> |
12 | #include <linux/net.h> | 13 | #include <linux/net.h> |
13 | #include <linux/tracepoint.h> | 14 | #include <linux/tracepoint.h> |
@@ -480,6 +481,99 @@ DEFINE_EVENT(svc_rqst_status, svc_send, | |||
480 | TP_PROTO(struct svc_rqst *rqst, int status), | 481 | TP_PROTO(struct svc_rqst *rqst, int status), |
481 | TP_ARGS(rqst, status)); | 482 | TP_ARGS(rqst, status)); |
482 | 483 | ||
484 | #define show_svc_xprt_flags(flags) \ | ||
485 | __print_flags(flags, "|", \ | ||
486 | { (1UL << XPT_BUSY), "XPT_BUSY"}, \ | ||
487 | { (1UL << XPT_CONN), "XPT_CONN"}, \ | ||
488 | { (1UL << XPT_CLOSE), "XPT_CLOSE"}, \ | ||
489 | { (1UL << XPT_DATA), "XPT_DATA"}, \ | ||
490 | { (1UL << XPT_TEMP), "XPT_TEMP"}, \ | ||
491 | { (1UL << XPT_DEAD), "XPT_DEAD"}, \ | ||
492 | { (1UL << XPT_CHNGBUF), "XPT_CHNGBUF"}, \ | ||
493 | { (1UL << XPT_DEFERRED), "XPT_DEFERRED"}, \ | ||
494 | { (1UL << XPT_OLD), "XPT_OLD"}, \ | ||
495 | { (1UL << XPT_LISTENER), "XPT_LISTENER"}, \ | ||
496 | { (1UL << XPT_CACHE_AUTH), "XPT_CACHE_AUTH"}, \ | ||
497 | { (1UL << XPT_LOCAL), "XPT_LOCAL"}) | ||
498 | |||
499 | TRACE_EVENT(svc_xprt_do_enqueue, | ||
500 | TP_PROTO(struct svc_xprt *xprt, struct svc_rqst *rqst), | ||
501 | |||
502 | TP_ARGS(xprt, rqst), | ||
503 | |||
504 | TP_STRUCT__entry( | ||
505 | __field(struct svc_xprt *, xprt) | ||
506 | __field(struct svc_rqst *, rqst) | ||
507 | ), | ||
508 | |||
509 | TP_fast_assign( | ||
510 | __entry->xprt = xprt; | ||
511 | __entry->rqst = rqst; | ||
512 | ), | ||
513 | |||
514 | TP_printk("xprt=0x%p addr=%pIScp pid=%d flags=%s", __entry->xprt, | ||
515 | (struct sockaddr *)&__entry->xprt->xpt_remote, | ||
516 | __entry->rqst ? __entry->rqst->rq_task->pid : 0, | ||
517 | show_svc_xprt_flags(__entry->xprt->xpt_flags)) | ||
518 | ); | ||
519 | |||
520 | TRACE_EVENT(svc_xprt_dequeue, | ||
521 | TP_PROTO(struct svc_xprt *xprt), | ||
522 | |||
523 | TP_ARGS(xprt), | ||
524 | |||
525 | TP_STRUCT__entry( | ||
526 | __field(struct svc_xprt *, xprt) | ||
527 | __field_struct(struct sockaddr_storage, ss) | ||
528 | __field(unsigned long, flags) | ||
529 | ), | ||
530 | |||
531 | TP_fast_assign( | ||
532 | __entry->xprt = xprt, | ||
533 | xprt ? memcpy(&__entry->ss, &xprt->xpt_remote, sizeof(__entry->ss)) : memset(&__entry->ss, 0, sizeof(__entry->ss)); | ||
534 | __entry->flags = xprt ? xprt->xpt_flags : 0; | ||
535 | ), | ||
536 | |||
537 | TP_printk("xprt=0x%p addr=%pIScp flags=%s", __entry->xprt, | ||
538 | (struct sockaddr *)&__entry->ss, | ||
539 | show_svc_xprt_flags(__entry->flags)) | ||
540 | ); | ||
541 | |||
542 | TRACE_EVENT(svc_wake_up, | ||
543 | TP_PROTO(int pid), | ||
544 | |||
545 | TP_ARGS(pid), | ||
546 | |||
547 | TP_STRUCT__entry( | ||
548 | __field(int, pid) | ||
549 | ), | ||
550 | |||
551 | TP_fast_assign( | ||
552 | __entry->pid = pid; | ||
553 | ), | ||
554 | |||
555 | TP_printk("pid=%d", __entry->pid) | ||
556 | ); | ||
557 | |||
558 | TRACE_EVENT(svc_handle_xprt, | ||
559 | TP_PROTO(struct svc_xprt *xprt, int len), | ||
560 | |||
561 | TP_ARGS(xprt, len), | ||
562 | |||
563 | TP_STRUCT__entry( | ||
564 | __field(struct svc_xprt *, xprt) | ||
565 | __field(int, len) | ||
566 | ), | ||
567 | |||
568 | TP_fast_assign( | ||
569 | __entry->xprt = xprt; | ||
570 | __entry->len = len; | ||
571 | ), | ||
572 | |||
573 | TP_printk("xprt=0x%p addr=%pIScp len=%d flags=%s", __entry->xprt, | ||
574 | (struct sockaddr *)&__entry->xprt->xpt_remote, __entry->len, | ||
575 | show_svc_xprt_flags(__entry->xprt->xpt_flags)) | ||
576 | ); | ||
483 | #endif /* _TRACE_SUNRPC_H */ | 577 | #endif /* _TRACE_SUNRPC_H */ |
484 | 578 | ||
485 | #include <trace/define_trace.h> | 579 | #include <trace/define_trace.h> |