1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */ 282b0a4c3STrond Myklebust #undef TRACE_SYSTEM 382b0a4c3STrond Myklebust #define TRACE_SYSTEM sunrpc 482b0a4c3STrond Myklebust 582b0a4c3STrond Myklebust #if !defined(_TRACE_SUNRPC_H) || defined(TRACE_HEADER_MULTI_READ) 682b0a4c3STrond Myklebust #define _TRACE_SUNRPC_H 782b0a4c3STrond Myklebust 882b0a4c3STrond Myklebust #include <linux/sunrpc/sched.h> 982b0a4c3STrond Myklebust #include <linux/sunrpc/clnt.h> 10860a0d9eSJeff Layton #include <linux/sunrpc/svc.h> 111a867a08SJeff Layton #include <linux/sunrpc/xprtsock.h> 1283a712e0SJeff Layton #include <linux/sunrpc/svc_xprt.h> 1340b5ea0cSTrond Myklebust #include <net/tcp_states.h> 1440b5ea0cSTrond Myklebust #include <linux/net.h> 1582b0a4c3STrond Myklebust #include <linux/tracepoint.h> 1682b0a4c3STrond Myklebust 17247c01ffSChuck Lever #include <trace/misc/sunrpc.h> 18b4776a34SChuck Lever 19998024deSChuck Lever TRACE_DEFINE_ENUM(SOCK_STREAM); 20998024deSChuck Lever TRACE_DEFINE_ENUM(SOCK_DGRAM); 21998024deSChuck Lever TRACE_DEFINE_ENUM(SOCK_RAW); 22998024deSChuck Lever TRACE_DEFINE_ENUM(SOCK_RDM); 23998024deSChuck Lever TRACE_DEFINE_ENUM(SOCK_SEQPACKET); 24998024deSChuck Lever TRACE_DEFINE_ENUM(SOCK_DCCP); 25998024deSChuck Lever TRACE_DEFINE_ENUM(SOCK_PACKET); 26998024deSChuck Lever 27998024deSChuck Lever #define show_socket_type(type) \ 28998024deSChuck Lever __print_symbolic(type, \ 29998024deSChuck Lever { SOCK_STREAM, "STREAM" }, \ 30998024deSChuck Lever { SOCK_DGRAM, "DGRAM" }, \ 31998024deSChuck Lever { SOCK_RAW, "RAW" }, \ 32998024deSChuck Lever { SOCK_RDM, "RDM" }, \ 33998024deSChuck Lever { SOCK_SEQPACKET, "SEQPACKET" }, \ 34998024deSChuck Lever { SOCK_DCCP, "DCCP" }, \ 35998024deSChuck Lever { SOCK_PACKET, "PACKET" }) 36998024deSChuck Lever 37998024deSChuck Lever /* This list is known to be incomplete, add new enums as needed. */ 38998024deSChuck Lever TRACE_DEFINE_ENUM(AF_UNSPEC); 39998024deSChuck Lever TRACE_DEFINE_ENUM(AF_UNIX); 40998024deSChuck Lever TRACE_DEFINE_ENUM(AF_LOCAL); 41998024deSChuck Lever TRACE_DEFINE_ENUM(AF_INET); 42998024deSChuck Lever TRACE_DEFINE_ENUM(AF_INET6); 43998024deSChuck Lever 44998024deSChuck Lever #define rpc_show_address_family(family) \ 45998024deSChuck Lever __print_symbolic(family, \ 46998024deSChuck Lever { AF_UNSPEC, "AF_UNSPEC" }, \ 47998024deSChuck Lever { AF_UNIX, "AF_UNIX" }, \ 48998024deSChuck Lever { AF_LOCAL, "AF_LOCAL" }, \ 49998024deSChuck Lever { AF_INET, "AF_INET" }, \ 50998024deSChuck Lever { AF_INET6, "AF_INET6" }) 51998024deSChuck Lever 52c509f15aSChuck Lever DECLARE_EVENT_CLASS(rpc_xdr_buf_class, 53b20dfc3fSChuck Lever TP_PROTO( 54c509f15aSChuck Lever const struct rpc_task *task, 55b20dfc3fSChuck Lever const struct xdr_buf *xdr 56b20dfc3fSChuck Lever ), 57b20dfc3fSChuck Lever 58c509f15aSChuck Lever TP_ARGS(task, xdr), 59b20dfc3fSChuck Lever 60b20dfc3fSChuck Lever TP_STRUCT__entry( 61c509f15aSChuck Lever __field(unsigned int, task_id) 62c509f15aSChuck Lever __field(unsigned int, client_id) 63b20dfc3fSChuck Lever __field(const void *, head_base) 64b20dfc3fSChuck Lever __field(size_t, head_len) 65b20dfc3fSChuck Lever __field(const void *, tail_base) 66b20dfc3fSChuck Lever __field(size_t, tail_len) 6735940a58SChuck Lever __field(unsigned int, page_base) 68b20dfc3fSChuck Lever __field(unsigned int, page_len) 69b20dfc3fSChuck Lever __field(unsigned int, msg_len) 70b20dfc3fSChuck Lever ), 71b20dfc3fSChuck Lever 72b20dfc3fSChuck Lever TP_fast_assign( 73c509f15aSChuck Lever __entry->task_id = task->tk_pid; 74c3213d26SScott Mayhew __entry->client_id = task->tk_client ? 75c3213d26SScott Mayhew task->tk_client->cl_clid : -1; 76b20dfc3fSChuck Lever __entry->head_base = xdr->head[0].iov_base; 77b20dfc3fSChuck Lever __entry->head_len = xdr->head[0].iov_len; 78b20dfc3fSChuck Lever __entry->tail_base = xdr->tail[0].iov_base; 79b20dfc3fSChuck Lever __entry->tail_len = xdr->tail[0].iov_len; 8035940a58SChuck Lever __entry->page_base = xdr->page_base; 81b20dfc3fSChuck Lever __entry->page_len = xdr->page_len; 82b20dfc3fSChuck Lever __entry->msg_len = xdr->len; 83b20dfc3fSChuck Lever ), 84b20dfc3fSChuck Lever 85b4776a34SChuck Lever TP_printk(SUNRPC_TRACE_TASK_SPECIFIER 8638764c73SLinus Torvalds " head=[%p,%zu] page=%u(%u) tail=[%p,%zu] len=%u", 87c509f15aSChuck Lever __entry->task_id, __entry->client_id, 8835940a58SChuck Lever __entry->head_base, __entry->head_len, 8935940a58SChuck Lever __entry->page_len, __entry->page_base, 9035940a58SChuck Lever __entry->tail_base, __entry->tail_len, 9135940a58SChuck Lever __entry->msg_len 92b20dfc3fSChuck Lever ) 93b20dfc3fSChuck Lever ); 94b20dfc3fSChuck Lever 95c509f15aSChuck Lever #define DEFINE_RPCXDRBUF_EVENT(name) \ 96c509f15aSChuck Lever DEFINE_EVENT(rpc_xdr_buf_class, \ 97c509f15aSChuck Lever rpc_xdr_##name, \ 98b20dfc3fSChuck Lever TP_PROTO( \ 99c509f15aSChuck Lever const struct rpc_task *task, \ 100b20dfc3fSChuck Lever const struct xdr_buf *xdr \ 101b20dfc3fSChuck Lever ), \ 102c509f15aSChuck Lever TP_ARGS(task, xdr)) 103b20dfc3fSChuck Lever 104c509f15aSChuck Lever DEFINE_RPCXDRBUF_EVENT(sendto); 105c509f15aSChuck Lever DEFINE_RPCXDRBUF_EVENT(recvfrom); 106c509f15aSChuck Lever DEFINE_RPCXDRBUF_EVENT(reply_pages); 107c509f15aSChuck Lever 108b20dfc3fSChuck Lever 10942aad0d7SChuck Lever DECLARE_EVENT_CLASS(rpc_clnt_class, 11042aad0d7SChuck Lever TP_PROTO( 11142aad0d7SChuck Lever const struct rpc_clnt *clnt 11242aad0d7SChuck Lever ), 11342aad0d7SChuck Lever 11442aad0d7SChuck Lever TP_ARGS(clnt), 11542aad0d7SChuck Lever 11642aad0d7SChuck Lever TP_STRUCT__entry( 11742aad0d7SChuck Lever __field(unsigned int, client_id) 11842aad0d7SChuck Lever ), 11942aad0d7SChuck Lever 12042aad0d7SChuck Lever TP_fast_assign( 12142aad0d7SChuck Lever __entry->client_id = clnt->cl_clid; 12242aad0d7SChuck Lever ), 12342aad0d7SChuck Lever 124b4776a34SChuck Lever TP_printk("client=" SUNRPC_TRACE_CLID_SPECIFIER, __entry->client_id) 12542aad0d7SChuck Lever ); 12642aad0d7SChuck Lever 12742aad0d7SChuck Lever #define DEFINE_RPC_CLNT_EVENT(name) \ 12842aad0d7SChuck Lever DEFINE_EVENT(rpc_clnt_class, \ 12942aad0d7SChuck Lever rpc_clnt_##name, \ 13042aad0d7SChuck Lever TP_PROTO( \ 13142aad0d7SChuck Lever const struct rpc_clnt *clnt \ 13242aad0d7SChuck Lever ), \ 13342aad0d7SChuck Lever TP_ARGS(clnt)) 13442aad0d7SChuck Lever 13542aad0d7SChuck Lever DEFINE_RPC_CLNT_EVENT(free); 13642aad0d7SChuck Lever DEFINE_RPC_CLNT_EVENT(killall); 13742aad0d7SChuck Lever DEFINE_RPC_CLNT_EVENT(shutdown); 13842aad0d7SChuck Lever DEFINE_RPC_CLNT_EVENT(release); 13942aad0d7SChuck Lever DEFINE_RPC_CLNT_EVENT(replace_xprt); 14042aad0d7SChuck Lever DEFINE_RPC_CLNT_EVENT(replace_xprt_err); 14142aad0d7SChuck Lever 14297d1c83cSChuck Lever TRACE_DEFINE_ENUM(RPC_XPRTSEC_NONE); 14397d1c83cSChuck Lever TRACE_DEFINE_ENUM(RPC_XPRTSEC_TLS_X509); 14497d1c83cSChuck Lever 14597d1c83cSChuck Lever #define rpc_show_xprtsec_policy(policy) \ 14697d1c83cSChuck Lever __print_symbolic(policy, \ 14797d1c83cSChuck Lever { RPC_XPRTSEC_NONE, "none" }, \ 14897d1c83cSChuck Lever { RPC_XPRTSEC_TLS_ANON, "tls-anon" }, \ 14997d1c83cSChuck Lever { RPC_XPRTSEC_TLS_X509, "tls-x509" }) 15097d1c83cSChuck Lever 15197d1c83cSChuck Lever #define rpc_show_create_flags(flags) \ 15297d1c83cSChuck Lever __print_flags(flags, "|", \ 15397d1c83cSChuck Lever { RPC_CLNT_CREATE_HARDRTRY, "HARDRTRY" }, \ 15497d1c83cSChuck Lever { RPC_CLNT_CREATE_AUTOBIND, "AUTOBIND" }, \ 15597d1c83cSChuck Lever { RPC_CLNT_CREATE_NONPRIVPORT, "NONPRIVPORT" }, \ 15697d1c83cSChuck Lever { RPC_CLNT_CREATE_NOPING, "NOPING" }, \ 15797d1c83cSChuck Lever { RPC_CLNT_CREATE_DISCRTRY, "DISCRTRY" }, \ 15897d1c83cSChuck Lever { RPC_CLNT_CREATE_QUIET, "QUIET" }, \ 15997d1c83cSChuck Lever { RPC_CLNT_CREATE_INFINITE_SLOTS, \ 16097d1c83cSChuck Lever "INFINITE_SLOTS" }, \ 16197d1c83cSChuck Lever { RPC_CLNT_CREATE_NO_IDLE_TIMEOUT, \ 16297d1c83cSChuck Lever "NO_IDLE_TIMEOUT" }, \ 16397d1c83cSChuck Lever { RPC_CLNT_CREATE_NO_RETRANS_TIMEOUT, \ 16497d1c83cSChuck Lever "NO_RETRANS_TIMEOUT" }, \ 16597d1c83cSChuck Lever { RPC_CLNT_CREATE_SOFTERR, "SOFTERR" }, \ 16697d1c83cSChuck Lever { RPC_CLNT_CREATE_REUSEPORT, "REUSEPORT" }) 16797d1c83cSChuck Lever 16842aad0d7SChuck Lever TRACE_EVENT(rpc_clnt_new, 16942aad0d7SChuck Lever TP_PROTO( 17042aad0d7SChuck Lever const struct rpc_clnt *clnt, 17142aad0d7SChuck Lever const struct rpc_xprt *xprt, 17297d1c83cSChuck Lever const struct rpc_create_args *args 17342aad0d7SChuck Lever ), 17442aad0d7SChuck Lever 17597d1c83cSChuck Lever TP_ARGS(clnt, xprt, args), 17642aad0d7SChuck Lever 17742aad0d7SChuck Lever TP_STRUCT__entry( 17842aad0d7SChuck Lever __field(unsigned int, client_id) 17997d1c83cSChuck Lever __field(unsigned long, xprtsec) 18097d1c83cSChuck Lever __field(unsigned long, flags) 18197d1c83cSChuck Lever __string(program, clnt->cl_program->name) 18297d1c83cSChuck Lever __string(server, xprt->servername) 18342aad0d7SChuck Lever __string(addr, xprt->address_strings[RPC_DISPLAY_ADDR]) 18442aad0d7SChuck Lever __string(port, xprt->address_strings[RPC_DISPLAY_PORT]) 18542aad0d7SChuck Lever ), 18642aad0d7SChuck Lever 18742aad0d7SChuck Lever TP_fast_assign( 18842aad0d7SChuck Lever __entry->client_id = clnt->cl_clid; 18997d1c83cSChuck Lever __entry->xprtsec = args->xprtsec.policy; 19097d1c83cSChuck Lever __entry->flags = args->flags; 19197d1c83cSChuck Lever __assign_str(program, clnt->cl_program->name); 19297d1c83cSChuck Lever __assign_str(server, xprt->servername); 19342aad0d7SChuck Lever __assign_str(addr, xprt->address_strings[RPC_DISPLAY_ADDR]); 19442aad0d7SChuck Lever __assign_str(port, xprt->address_strings[RPC_DISPLAY_PORT]); 19542aad0d7SChuck Lever ), 19642aad0d7SChuck Lever 19797d1c83cSChuck Lever TP_printk("client=" SUNRPC_TRACE_CLID_SPECIFIER " peer=[%s]:%s" 19897d1c83cSChuck Lever " program=%s server=%s xprtsec=%s flags=%s", 19942aad0d7SChuck Lever __entry->client_id, __get_str(addr), __get_str(port), 20097d1c83cSChuck Lever __get_str(program), __get_str(server), 20197d1c83cSChuck Lever rpc_show_xprtsec_policy(__entry->xprtsec), 20297d1c83cSChuck Lever rpc_show_create_flags(__entry->flags) 20397d1c83cSChuck Lever ) 20442aad0d7SChuck Lever ); 20542aad0d7SChuck Lever 20642aad0d7SChuck Lever TRACE_EVENT(rpc_clnt_new_err, 20742aad0d7SChuck Lever TP_PROTO( 20842aad0d7SChuck Lever const char *program, 20942aad0d7SChuck Lever const char *server, 21042aad0d7SChuck Lever int error 21142aad0d7SChuck Lever ), 21242aad0d7SChuck Lever 21342aad0d7SChuck Lever TP_ARGS(program, server, error), 21442aad0d7SChuck Lever 21542aad0d7SChuck Lever TP_STRUCT__entry( 21642aad0d7SChuck Lever __field(int, error) 21742aad0d7SChuck Lever __string(program, program) 21842aad0d7SChuck Lever __string(server, server) 21942aad0d7SChuck Lever ), 22042aad0d7SChuck Lever 22142aad0d7SChuck Lever TP_fast_assign( 22242aad0d7SChuck Lever __entry->error = error; 22378c14b38SJoe Perches __assign_str(program, program); 22478c14b38SJoe Perches __assign_str(server, server); 22542aad0d7SChuck Lever ), 22642aad0d7SChuck Lever 22742aad0d7SChuck Lever TP_printk("program=%s server=%s error=%d", 22842aad0d7SChuck Lever __get_str(program), __get_str(server), __entry->error) 22942aad0d7SChuck Lever ); 23042aad0d7SChuck Lever 23142aad0d7SChuck Lever TRACE_EVENT(rpc_clnt_clone_err, 23242aad0d7SChuck Lever TP_PROTO( 23342aad0d7SChuck Lever const struct rpc_clnt *clnt, 23442aad0d7SChuck Lever int error 23542aad0d7SChuck Lever ), 23642aad0d7SChuck Lever 23742aad0d7SChuck Lever TP_ARGS(clnt, error), 23842aad0d7SChuck Lever 23942aad0d7SChuck Lever TP_STRUCT__entry( 24042aad0d7SChuck Lever __field(unsigned int, client_id) 24142aad0d7SChuck Lever __field(int, error) 24242aad0d7SChuck Lever ), 24342aad0d7SChuck Lever 24442aad0d7SChuck Lever TP_fast_assign( 24542aad0d7SChuck Lever __entry->client_id = clnt->cl_clid; 24642aad0d7SChuck Lever __entry->error = error; 24742aad0d7SChuck Lever ), 24842aad0d7SChuck Lever 249b4776a34SChuck Lever TP_printk("client=" SUNRPC_TRACE_CLID_SPECIFIER " error=%d", 250b4776a34SChuck Lever __entry->client_id, __entry->error) 25142aad0d7SChuck Lever ); 25242aad0d7SChuck Lever 253dc5820bdSChuck Lever 254dc5820bdSChuck Lever TRACE_DEFINE_ENUM(RPC_AUTH_OK); 255dc5820bdSChuck Lever TRACE_DEFINE_ENUM(RPC_AUTH_BADCRED); 256dc5820bdSChuck Lever TRACE_DEFINE_ENUM(RPC_AUTH_REJECTEDCRED); 257dc5820bdSChuck Lever TRACE_DEFINE_ENUM(RPC_AUTH_BADVERF); 258dc5820bdSChuck Lever TRACE_DEFINE_ENUM(RPC_AUTH_REJECTEDVERF); 259dc5820bdSChuck Lever TRACE_DEFINE_ENUM(RPC_AUTH_TOOWEAK); 260dc5820bdSChuck Lever TRACE_DEFINE_ENUM(RPCSEC_GSS_CREDPROBLEM); 261dc5820bdSChuck Lever TRACE_DEFINE_ENUM(RPCSEC_GSS_CTXPROBLEM); 262dc5820bdSChuck Lever 2635753cba1SSteve Dickson #define rpc_show_auth_stat(status) \ 264c435da68SChuck Lever __print_symbolic(status, \ 265c435da68SChuck Lever { RPC_AUTH_OK, "AUTH_OK" }, \ 266c435da68SChuck Lever { RPC_AUTH_BADCRED, "BADCRED" }, \ 267c435da68SChuck Lever { RPC_AUTH_REJECTEDCRED, "REJECTEDCRED" }, \ 268c435da68SChuck Lever { RPC_AUTH_BADVERF, "BADVERF" }, \ 269c435da68SChuck Lever { RPC_AUTH_REJECTEDVERF, "REJECTEDVERF" }, \ 270c435da68SChuck Lever { RPC_AUTH_TOOWEAK, "TOOWEAK" }, \ 271c435da68SChuck Lever { RPCSEC_GSS_CREDPROBLEM, "GSS_CREDPROBLEM" }, \ 272c435da68SChuck Lever { RPCSEC_GSS_CTXPROBLEM, "GSS_CTXPROBLEM" }) \ 273c435da68SChuck Lever 274c435da68SChuck Lever DECLARE_EVENT_CLASS(rpc_task_status, 275c435da68SChuck Lever 276c435da68SChuck Lever TP_PROTO(const struct rpc_task *task), 277c435da68SChuck Lever 278c435da68SChuck Lever TP_ARGS(task), 279c435da68SChuck Lever 280c435da68SChuck Lever TP_STRUCT__entry( 281c435da68SChuck Lever __field(unsigned int, task_id) 282c435da68SChuck Lever __field(unsigned int, client_id) 283c435da68SChuck Lever __field(int, status) 284c435da68SChuck Lever ), 285c435da68SChuck Lever 286c435da68SChuck Lever TP_fast_assign( 287c435da68SChuck Lever __entry->task_id = task->tk_pid; 288c435da68SChuck Lever __entry->client_id = task->tk_client->cl_clid; 289c435da68SChuck Lever __entry->status = task->tk_status; 290c435da68SChuck Lever ), 291c435da68SChuck Lever 292b4776a34SChuck Lever TP_printk(SUNRPC_TRACE_TASK_SPECIFIER " status=%d", 29382b0a4c3STrond Myklebust __entry->task_id, __entry->client_id, 29482b0a4c3STrond Myklebust __entry->status) 29582b0a4c3STrond Myklebust ); 29682b0a4c3STrond Myklebust #define DEFINE_RPC_STATUS_EVENT(name) \ 29782b0a4c3STrond Myklebust DEFINE_EVENT(rpc_task_status, rpc_##name##_status, \ 29882b0a4c3STrond Myklebust TP_PROTO( \ 29982b0a4c3STrond Myklebust const struct rpc_task *task \ 30082b0a4c3STrond Myklebust ), \ 30182b0a4c3STrond Myklebust TP_ARGS(task)) 30282b0a4c3STrond Myklebust 30382b0a4c3STrond Myklebust DEFINE_RPC_STATUS_EVENT(call); 30482b0a4c3STrond Myklebust DEFINE_RPC_STATUS_EVENT(connect); 305914cdcc7SChuck Lever DEFINE_RPC_STATUS_EVENT(timeout); 3067c8099f6SChuck Lever DEFINE_RPC_STATUS_EVENT(retry_refresh); 3077c8099f6SChuck Lever DEFINE_RPC_STATUS_EVENT(refresh); 30882b0a4c3STrond Myklebust 309c435da68SChuck Lever TRACE_EVENT(rpc_request, 310c435da68SChuck Lever TP_PROTO(const struct rpc_task *task), 311c435da68SChuck Lever 312c435da68SChuck Lever TP_ARGS(task), 313c435da68SChuck Lever 314c435da68SChuck Lever TP_STRUCT__entry( 315c435da68SChuck Lever __field(unsigned int, task_id) 316c435da68SChuck Lever __field(unsigned int, client_id) 317c435da68SChuck Lever __field(int, version) 318c435da68SChuck Lever __field(bool, async) 319c435da68SChuck Lever __string(progname, task->tk_client->cl_program->name) 320c435da68SChuck Lever __string(procname, rpc_proc_name(task)) 321c435da68SChuck Lever ), 322c435da68SChuck Lever 323c435da68SChuck Lever TP_fast_assign( 324c435da68SChuck Lever __entry->task_id = task->tk_pid; 325c435da68SChuck Lever __entry->client_id = task->tk_client->cl_clid; 326c435da68SChuck Lever __entry->version = task->tk_client->cl_vers; 327c435da68SChuck Lever __entry->async = RPC_IS_ASYNC(task); 32878c14b38SJoe Perches __assign_str(progname, task->tk_client->cl_program->name); 32978c14b38SJoe Perches __assign_str(procname, rpc_proc_name(task)); 330c435da68SChuck Lever ), 331c435da68SChuck Lever 332b4776a34SChuck Lever TP_printk(SUNRPC_TRACE_TASK_SPECIFIER " %sv%d %s (%ssync)", 333c435da68SChuck Lever __entry->task_id, __entry->client_id, 334c435da68SChuck Lever __get_str(progname), __entry->version, 335c435da68SChuck Lever __get_str(procname), __entry->async ? "a": "" 336c435da68SChuck Lever ) 337c435da68SChuck Lever ); 338c435da68SChuck Lever 3396f701383SChuck Lever #define rpc_show_task_flags(flags) \ 3406f701383SChuck Lever __print_flags(flags, "|", \ 3416f701383SChuck Lever { RPC_TASK_ASYNC, "ASYNC" }, \ 3426f701383SChuck Lever { RPC_TASK_SWAPPER, "SWAPPER" }, \ 343f9d091cfSChuck Lever { RPC_TASK_MOVEABLE, "MOVEABLE" }, \ 3447a34c8e0SChuck Lever { RPC_TASK_NULLCREDS, "NULLCREDS" }, \ 3456f701383SChuck Lever { RPC_CALL_MAJORSEEN, "MAJORSEEN" }, \ 3466f701383SChuck Lever { RPC_TASK_DYNAMIC, "DYNAMIC" }, \ 3477a34c8e0SChuck Lever { RPC_TASK_NO_ROUND_ROBIN, "NO_ROUND_ROBIN" }, \ 3486f701383SChuck Lever { RPC_TASK_SOFT, "SOFT" }, \ 3496f701383SChuck Lever { RPC_TASK_SOFTCONN, "SOFTCONN" }, \ 3506f701383SChuck Lever { RPC_TASK_SENT, "SENT" }, \ 3516f701383SChuck Lever { RPC_TASK_TIMEOUT, "TIMEOUT" }, \ 3526f701383SChuck Lever { RPC_TASK_NOCONNECT, "NOCONNECT" }, \ 3537a34c8e0SChuck Lever { RPC_TASK_NO_RETRANS_TIMEOUT, "NORTO" }, \ 3547a34c8e0SChuck Lever { RPC_TASK_CRED_NOREF, "CRED_NOREF" }) 3556f701383SChuck Lever 3566f701383SChuck Lever #define rpc_show_runstate(flags) \ 3576f701383SChuck Lever __print_flags(flags, "|", \ 3586f701383SChuck Lever { (1UL << RPC_TASK_RUNNING), "RUNNING" }, \ 3596f701383SChuck Lever { (1UL << RPC_TASK_QUEUED), "QUEUED" }, \ 3606f701383SChuck Lever { (1UL << RPC_TASK_ACTIVE), "ACTIVE" }, \ 3616f701383SChuck Lever { (1UL << RPC_TASK_NEED_XMIT), "NEED_XMIT" }, \ 3626f701383SChuck Lever { (1UL << RPC_TASK_NEED_RECV), "NEED_RECV" }, \ 363*c688d2d8STrond Myklebust { (1UL << RPC_TASK_MSG_PIN_WAIT), "MSG_PIN_WAIT" }) 3646f701383SChuck Lever 36582b0a4c3STrond Myklebust DECLARE_EVENT_CLASS(rpc_task_running, 36682b0a4c3STrond Myklebust 367e671edb9SChuck Lever TP_PROTO(const struct rpc_task *task, const void *action), 36882b0a4c3STrond Myklebust 369e671edb9SChuck Lever TP_ARGS(task, action), 37082b0a4c3STrond Myklebust 37182b0a4c3STrond Myklebust TP_STRUCT__entry( 37292cb6c5bSTrond Myklebust __field(unsigned int, task_id) 37392cb6c5bSTrond Myklebust __field(unsigned int, client_id) 37482b0a4c3STrond Myklebust __field(const void *, action) 37582b0a4c3STrond Myklebust __field(unsigned long, runstate) 37682b0a4c3STrond Myklebust __field(int, status) 37782b0a4c3STrond Myklebust __field(unsigned short, flags) 37882b0a4c3STrond Myklebust ), 37982b0a4c3STrond Myklebust 38082b0a4c3STrond Myklebust TP_fast_assign( 381e671edb9SChuck Lever __entry->client_id = task->tk_client ? 382e671edb9SChuck Lever task->tk_client->cl_clid : -1; 38392cb6c5bSTrond Myklebust __entry->task_id = task->tk_pid; 38482b0a4c3STrond Myklebust __entry->action = action; 38582b0a4c3STrond Myklebust __entry->runstate = task->tk_runstate; 38682b0a4c3STrond Myklebust __entry->status = task->tk_status; 38782b0a4c3STrond Myklebust __entry->flags = task->tk_flags; 38882b0a4c3STrond Myklebust ), 38982b0a4c3STrond Myklebust 390b4776a34SChuck Lever TP_printk(SUNRPC_TRACE_TASK_SPECIFIER 391b4776a34SChuck Lever " flags=%s runstate=%s status=%d action=%ps", 39292cb6c5bSTrond Myklebust __entry->task_id, __entry->client_id, 3936f701383SChuck Lever rpc_show_task_flags(__entry->flags), 3946f701383SChuck Lever rpc_show_runstate(__entry->runstate), 39582b0a4c3STrond Myklebust __entry->status, 39682b0a4c3STrond Myklebust __entry->action 39782b0a4c3STrond Myklebust ) 39882b0a4c3STrond Myklebust ); 399dc5820bdSChuck Lever #define DEFINE_RPC_RUNNING_EVENT(name) \ 400dc5820bdSChuck Lever DEFINE_EVENT(rpc_task_running, rpc_task_##name, \ 401dc5820bdSChuck Lever TP_PROTO( \ 402dc5820bdSChuck Lever const struct rpc_task *task, \ 403dc5820bdSChuck Lever const void *action \ 404dc5820bdSChuck Lever ), \ 405dc5820bdSChuck Lever TP_ARGS(task, action)) 40682b0a4c3STrond Myklebust 407dc5820bdSChuck Lever DEFINE_RPC_RUNNING_EVENT(begin); 408dc5820bdSChuck Lever DEFINE_RPC_RUNNING_EVENT(run_action); 4091466c221SChuck Lever DEFINE_RPC_RUNNING_EVENT(sync_sleep); 4101466c221SChuck Lever DEFINE_RPC_RUNNING_EVENT(sync_wake); 411dc5820bdSChuck Lever DEFINE_RPC_RUNNING_EVENT(complete); 412721a1d38SChuck Lever DEFINE_RPC_RUNNING_EVENT(timeout); 413abf8af78SChuck Lever DEFINE_RPC_RUNNING_EVENT(signalled); 414a264abadSChuck Lever DEFINE_RPC_RUNNING_EVENT(end); 415b40887e1SChuck Lever DEFINE_RPC_RUNNING_EVENT(call_done); 41682b0a4c3STrond Myklebust 41782b0a4c3STrond Myklebust DECLARE_EVENT_CLASS(rpc_task_queued, 41882b0a4c3STrond Myklebust 419e671edb9SChuck Lever TP_PROTO(const struct rpc_task *task, const struct rpc_wait_queue *q), 42082b0a4c3STrond Myklebust 421e671edb9SChuck Lever TP_ARGS(task, q), 42282b0a4c3STrond Myklebust 42382b0a4c3STrond Myklebust TP_STRUCT__entry( 42492cb6c5bSTrond Myklebust __field(unsigned int, task_id) 42592cb6c5bSTrond Myklebust __field(unsigned int, client_id) 42682b0a4c3STrond Myklebust __field(unsigned long, timeout) 42782b0a4c3STrond Myklebust __field(unsigned long, runstate) 42882b0a4c3STrond Myklebust __field(int, status) 42982b0a4c3STrond Myklebust __field(unsigned short, flags) 43085c0d24fSTrond Myklebust __string(q_name, rpc_qname(q)) 43182b0a4c3STrond Myklebust ), 43282b0a4c3STrond Myklebust 43382b0a4c3STrond Myklebust TP_fast_assign( 434e671edb9SChuck Lever __entry->client_id = task->tk_client ? 435e671edb9SChuck Lever task->tk_client->cl_clid : -1; 43692cb6c5bSTrond Myklebust __entry->task_id = task->tk_pid; 4375efd1876STrond Myklebust __entry->timeout = rpc_task_timeout(task); 43882b0a4c3STrond Myklebust __entry->runstate = task->tk_runstate; 43982b0a4c3STrond Myklebust __entry->status = task->tk_status; 44082b0a4c3STrond Myklebust __entry->flags = task->tk_flags; 44185c0d24fSTrond Myklebust __assign_str(q_name, rpc_qname(q)); 44282b0a4c3STrond Myklebust ), 44382b0a4c3STrond Myklebust 444b4776a34SChuck Lever TP_printk(SUNRPC_TRACE_TASK_SPECIFIER 445b4776a34SChuck Lever " flags=%s runstate=%s status=%d timeout=%lu queue=%s", 44692cb6c5bSTrond Myklebust __entry->task_id, __entry->client_id, 4476f701383SChuck Lever rpc_show_task_flags(__entry->flags), 4486f701383SChuck Lever rpc_show_runstate(__entry->runstate), 44982b0a4c3STrond Myklebust __entry->status, 45082b0a4c3STrond Myklebust __entry->timeout, 45185c0d24fSTrond Myklebust __get_str(q_name) 45282b0a4c3STrond Myklebust ) 45382b0a4c3STrond Myklebust ); 454dc5820bdSChuck Lever #define DEFINE_RPC_QUEUED_EVENT(name) \ 455dc5820bdSChuck Lever DEFINE_EVENT(rpc_task_queued, rpc_task_##name, \ 456dc5820bdSChuck Lever TP_PROTO( \ 457dc5820bdSChuck Lever const struct rpc_task *task, \ 458dc5820bdSChuck Lever const struct rpc_wait_queue *q \ 459dc5820bdSChuck Lever ), \ 460dc5820bdSChuck Lever TP_ARGS(task, q)) 46182b0a4c3STrond Myklebust 462dc5820bdSChuck Lever DEFINE_RPC_QUEUED_EVENT(sleep); 463dc5820bdSChuck Lever DEFINE_RPC_QUEUED_EVENT(wakeup); 46482b0a4c3STrond Myklebust 465e8680a24SChuck Lever DECLARE_EVENT_CLASS(rpc_failure, 466e8680a24SChuck Lever 467e8680a24SChuck Lever TP_PROTO(const struct rpc_task *task), 468e8680a24SChuck Lever 469e8680a24SChuck Lever TP_ARGS(task), 470e8680a24SChuck Lever 471e8680a24SChuck Lever TP_STRUCT__entry( 472e8680a24SChuck Lever __field(unsigned int, task_id) 473e8680a24SChuck Lever __field(unsigned int, client_id) 474e8680a24SChuck Lever ), 475e8680a24SChuck Lever 476e8680a24SChuck Lever TP_fast_assign( 477e8680a24SChuck Lever __entry->task_id = task->tk_pid; 478e8680a24SChuck Lever __entry->client_id = task->tk_client->cl_clid; 479e8680a24SChuck Lever ), 480e8680a24SChuck Lever 481b4776a34SChuck Lever TP_printk(SUNRPC_TRACE_TASK_SPECIFIER, 482e8680a24SChuck Lever __entry->task_id, __entry->client_id) 483e8680a24SChuck Lever ); 484e8680a24SChuck Lever 485e8680a24SChuck Lever #define DEFINE_RPC_FAILURE(name) \ 486e8680a24SChuck Lever DEFINE_EVENT(rpc_failure, rpc_bad_##name, \ 487e8680a24SChuck Lever TP_PROTO( \ 488e8680a24SChuck Lever const struct rpc_task *task \ 489e8680a24SChuck Lever ), \ 490e8680a24SChuck Lever TP_ARGS(task)) 491e8680a24SChuck Lever 492e8680a24SChuck Lever DEFINE_RPC_FAILURE(callhdr); 4937f5667a5SChuck Lever DEFINE_RPC_FAILURE(verifier); 4947f5667a5SChuck Lever 4957f5667a5SChuck Lever DECLARE_EVENT_CLASS(rpc_reply_event, 4967f5667a5SChuck Lever 4977f5667a5SChuck Lever TP_PROTO( 4987f5667a5SChuck Lever const struct rpc_task *task 4997f5667a5SChuck Lever ), 5007f5667a5SChuck Lever 5017f5667a5SChuck Lever TP_ARGS(task), 5027f5667a5SChuck Lever 5037f5667a5SChuck Lever TP_STRUCT__entry( 5047f5667a5SChuck Lever __field(unsigned int, task_id) 5057f5667a5SChuck Lever __field(unsigned int, client_id) 5067f5667a5SChuck Lever __field(u32, xid) 5077f5667a5SChuck Lever __string(progname, task->tk_client->cl_program->name) 5087f5667a5SChuck Lever __field(u32, version) 5097f5667a5SChuck Lever __string(procname, rpc_proc_name(task)) 5107f5667a5SChuck Lever __string(servername, task->tk_xprt->servername) 5117f5667a5SChuck Lever ), 5127f5667a5SChuck Lever 5137f5667a5SChuck Lever TP_fast_assign( 5147f5667a5SChuck Lever __entry->task_id = task->tk_pid; 5157f5667a5SChuck Lever __entry->client_id = task->tk_client->cl_clid; 5167f5667a5SChuck Lever __entry->xid = be32_to_cpu(task->tk_rqstp->rq_xid); 51778c14b38SJoe Perches __assign_str(progname, task->tk_client->cl_program->name); 5187f5667a5SChuck Lever __entry->version = task->tk_client->cl_vers; 51978c14b38SJoe Perches __assign_str(procname, rpc_proc_name(task)); 52078c14b38SJoe Perches __assign_str(servername, task->tk_xprt->servername); 5217f5667a5SChuck Lever ), 5227f5667a5SChuck Lever 523b4776a34SChuck Lever TP_printk(SUNRPC_TRACE_TASK_SPECIFIER 524b4776a34SChuck Lever " server=%s xid=0x%08x %sv%d %s", 5257f5667a5SChuck Lever __entry->task_id, __entry->client_id, __get_str(servername), 5267f5667a5SChuck Lever __entry->xid, __get_str(progname), __entry->version, 5277f5667a5SChuck Lever __get_str(procname)) 5287f5667a5SChuck Lever ) 5297f5667a5SChuck Lever 5307f5667a5SChuck Lever #define DEFINE_RPC_REPLY_EVENT(name) \ 5317f5667a5SChuck Lever DEFINE_EVENT(rpc_reply_event, rpc__##name, \ 5327f5667a5SChuck Lever TP_PROTO( \ 5337f5667a5SChuck Lever const struct rpc_task *task \ 5347f5667a5SChuck Lever ), \ 5357f5667a5SChuck Lever TP_ARGS(task)) 5367f5667a5SChuck Lever 5377f5667a5SChuck Lever DEFINE_RPC_REPLY_EVENT(prog_unavail); 5387f5667a5SChuck Lever DEFINE_RPC_REPLY_EVENT(prog_mismatch); 5397f5667a5SChuck Lever DEFINE_RPC_REPLY_EVENT(proc_unavail); 5407f5667a5SChuck Lever DEFINE_RPC_REPLY_EVENT(garbage_args); 5417f5667a5SChuck Lever DEFINE_RPC_REPLY_EVENT(unparsable); 5427f5667a5SChuck Lever DEFINE_RPC_REPLY_EVENT(mismatch); 5437f5667a5SChuck Lever DEFINE_RPC_REPLY_EVENT(stale_creds); 5447f5667a5SChuck Lever DEFINE_RPC_REPLY_EVENT(bad_creds); 5457f5667a5SChuck Lever DEFINE_RPC_REPLY_EVENT(auth_tooweak); 546e8680a24SChuck Lever 54742ebfc2cSChuck Lever #define DEFINE_RPCB_ERROR_EVENT(name) \ 54842ebfc2cSChuck Lever DEFINE_EVENT(rpc_reply_event, rpcb_##name##_err, \ 54942ebfc2cSChuck Lever TP_PROTO( \ 55042ebfc2cSChuck Lever const struct rpc_task *task \ 55142ebfc2cSChuck Lever ), \ 55242ebfc2cSChuck Lever TP_ARGS(task)) 55342ebfc2cSChuck Lever 55442ebfc2cSChuck Lever DEFINE_RPCB_ERROR_EVENT(prog_unavail); 55542ebfc2cSChuck Lever DEFINE_RPCB_ERROR_EVENT(timeout); 55642ebfc2cSChuck Lever DEFINE_RPCB_ERROR_EVENT(bind_version); 55742ebfc2cSChuck Lever DEFINE_RPCB_ERROR_EVENT(unreachable); 55842ebfc2cSChuck Lever DEFINE_RPCB_ERROR_EVENT(unrecognized); 55942ebfc2cSChuck Lever 56006e234c6SChuck Lever TRACE_EVENT(rpc_buf_alloc, 56106e234c6SChuck Lever TP_PROTO( 56206e234c6SChuck Lever const struct rpc_task *task, 56306e234c6SChuck Lever int status 56406e234c6SChuck Lever ), 56506e234c6SChuck Lever 56606e234c6SChuck Lever TP_ARGS(task, status), 56706e234c6SChuck Lever 56806e234c6SChuck Lever TP_STRUCT__entry( 56906e234c6SChuck Lever __field(unsigned int, task_id) 57006e234c6SChuck Lever __field(unsigned int, client_id) 57106e234c6SChuck Lever __field(size_t, callsize) 57206e234c6SChuck Lever __field(size_t, recvsize) 57306e234c6SChuck Lever __field(int, status) 57406e234c6SChuck Lever ), 57506e234c6SChuck Lever 57606e234c6SChuck Lever TP_fast_assign( 57706e234c6SChuck Lever __entry->task_id = task->tk_pid; 57806e234c6SChuck Lever __entry->client_id = task->tk_client->cl_clid; 57906e234c6SChuck Lever __entry->callsize = task->tk_rqstp->rq_callsize; 58006e234c6SChuck Lever __entry->recvsize = task->tk_rqstp->rq_rcvsize; 58106e234c6SChuck Lever __entry->status = status; 58206e234c6SChuck Lever ), 58306e234c6SChuck Lever 584b4776a34SChuck Lever TP_printk(SUNRPC_TRACE_TASK_SPECIFIER 585b4776a34SChuck Lever " callsize=%zu recvsize=%zu status=%d", 58606e234c6SChuck Lever __entry->task_id, __entry->client_id, 58706e234c6SChuck Lever __entry->callsize, __entry->recvsize, __entry->status 58806e234c6SChuck Lever ) 58906e234c6SChuck Lever ); 59006e234c6SChuck Lever 5910125ecbbSChuck Lever TRACE_EVENT(rpc_call_rpcerror, 5920125ecbbSChuck Lever TP_PROTO( 5930125ecbbSChuck Lever const struct rpc_task *task, 5940125ecbbSChuck Lever int tk_status, 5950125ecbbSChuck Lever int rpc_status 5960125ecbbSChuck Lever ), 5970125ecbbSChuck Lever 5980125ecbbSChuck Lever TP_ARGS(task, tk_status, rpc_status), 5990125ecbbSChuck Lever 6000125ecbbSChuck Lever TP_STRUCT__entry( 6010125ecbbSChuck Lever __field(unsigned int, task_id) 6020125ecbbSChuck Lever __field(unsigned int, client_id) 6030125ecbbSChuck Lever __field(int, tk_status) 6040125ecbbSChuck Lever __field(int, rpc_status) 6050125ecbbSChuck Lever ), 6060125ecbbSChuck Lever 6070125ecbbSChuck Lever TP_fast_assign( 6080125ecbbSChuck Lever __entry->client_id = task->tk_client->cl_clid; 6090125ecbbSChuck Lever __entry->task_id = task->tk_pid; 6100125ecbbSChuck Lever __entry->tk_status = tk_status; 6110125ecbbSChuck Lever __entry->rpc_status = rpc_status; 6120125ecbbSChuck Lever ), 6130125ecbbSChuck Lever 614b4776a34SChuck Lever TP_printk(SUNRPC_TRACE_TASK_SPECIFIER 615b4776a34SChuck Lever " tk_status=%d rpc_status=%d", 6160125ecbbSChuck Lever __entry->task_id, __entry->client_id, 6170125ecbbSChuck Lever __entry->tk_status, __entry->rpc_status) 6180125ecbbSChuck Lever ); 6190125ecbbSChuck Lever 62040bf7eb3SChuck Lever TRACE_EVENT(rpc_stats_latency, 62140bf7eb3SChuck Lever 62240bf7eb3SChuck Lever TP_PROTO( 62340bf7eb3SChuck Lever const struct rpc_task *task, 62440bf7eb3SChuck Lever ktime_t backlog, 62540bf7eb3SChuck Lever ktime_t rtt, 62640bf7eb3SChuck Lever ktime_t execute 62740bf7eb3SChuck Lever ), 62840bf7eb3SChuck Lever 62940bf7eb3SChuck Lever TP_ARGS(task, backlog, rtt, execute), 63040bf7eb3SChuck Lever 63140bf7eb3SChuck Lever TP_STRUCT__entry( 63298eb6cf2SChuck Lever __field(unsigned int, task_id) 63398eb6cf2SChuck Lever __field(unsigned int, client_id) 63440bf7eb3SChuck Lever __field(u32, xid) 63540bf7eb3SChuck Lever __field(int, version) 63640bf7eb3SChuck Lever __string(progname, task->tk_client->cl_program->name) 63740bf7eb3SChuck Lever __string(procname, rpc_proc_name(task)) 63840bf7eb3SChuck Lever __field(unsigned long, backlog) 63940bf7eb3SChuck Lever __field(unsigned long, rtt) 64040bf7eb3SChuck Lever __field(unsigned long, execute) 64140bf7eb3SChuck Lever ), 64240bf7eb3SChuck Lever 64340bf7eb3SChuck Lever TP_fast_assign( 64498eb6cf2SChuck Lever __entry->client_id = task->tk_client->cl_clid; 64598eb6cf2SChuck Lever __entry->task_id = task->tk_pid; 64640bf7eb3SChuck Lever __entry->xid = be32_to_cpu(task->tk_rqstp->rq_xid); 64740bf7eb3SChuck Lever __entry->version = task->tk_client->cl_vers; 64878c14b38SJoe Perches __assign_str(progname, task->tk_client->cl_program->name); 64978c14b38SJoe Perches __assign_str(procname, rpc_proc_name(task)); 65040bf7eb3SChuck Lever __entry->backlog = ktime_to_us(backlog); 65140bf7eb3SChuck Lever __entry->rtt = ktime_to_us(rtt); 65240bf7eb3SChuck Lever __entry->execute = ktime_to_us(execute); 65340bf7eb3SChuck Lever ), 65440bf7eb3SChuck Lever 655b4776a34SChuck Lever TP_printk(SUNRPC_TRACE_TASK_SPECIFIER 656b4776a34SChuck Lever " xid=0x%08x %sv%d %s backlog=%lu rtt=%lu execute=%lu", 65798eb6cf2SChuck Lever __entry->task_id, __entry->client_id, __entry->xid, 65840bf7eb3SChuck Lever __get_str(progname), __entry->version, __get_str(procname), 65940bf7eb3SChuck Lever __entry->backlog, __entry->rtt, __entry->execute) 66040bf7eb3SChuck Lever ); 66140bf7eb3SChuck Lever 6625582863fSChuck Lever TRACE_EVENT(rpc_xdr_overflow, 6635582863fSChuck Lever TP_PROTO( 6645582863fSChuck Lever const struct xdr_stream *xdr, 6655582863fSChuck Lever size_t requested 6665582863fSChuck Lever ), 6675582863fSChuck Lever 6685582863fSChuck Lever TP_ARGS(xdr, requested), 6695582863fSChuck Lever 6705582863fSChuck Lever TP_STRUCT__entry( 6715582863fSChuck Lever __field(unsigned int, task_id) 6725582863fSChuck Lever __field(unsigned int, client_id) 6735582863fSChuck Lever __field(int, version) 6745582863fSChuck Lever __field(size_t, requested) 6755582863fSChuck Lever __field(const void *, end) 6765582863fSChuck Lever __field(const void *, p) 6775582863fSChuck Lever __field(const void *, head_base) 6785582863fSChuck Lever __field(size_t, head_len) 6795582863fSChuck Lever __field(const void *, tail_base) 6805582863fSChuck Lever __field(size_t, tail_len) 6815582863fSChuck Lever __field(unsigned int, page_len) 6825582863fSChuck Lever __field(unsigned int, len) 683d321ff58SChuck Lever __string(progname, xdr->rqst ? 684d321ff58SChuck Lever xdr->rqst->rq_task->tk_client->cl_program->name : "unknown") 685d321ff58SChuck Lever __string(procedure, xdr->rqst ? 686d321ff58SChuck Lever xdr->rqst->rq_task->tk_msg.rpc_proc->p_name : "unknown") 6875582863fSChuck Lever ), 6885582863fSChuck Lever 6895582863fSChuck Lever TP_fast_assign( 6905582863fSChuck Lever if (xdr->rqst) { 6915582863fSChuck Lever const struct rpc_task *task = xdr->rqst->rq_task; 6925582863fSChuck Lever 6935582863fSChuck Lever __entry->task_id = task->tk_pid; 6945582863fSChuck Lever __entry->client_id = task->tk_client->cl_clid; 6955582863fSChuck Lever __assign_str(progname, 69678c14b38SJoe Perches task->tk_client->cl_program->name); 6975582863fSChuck Lever __entry->version = task->tk_client->cl_vers; 69878c14b38SJoe Perches __assign_str(procedure, task->tk_msg.rpc_proc->p_name); 6995582863fSChuck Lever } else { 700b4776a34SChuck Lever __entry->task_id = -1; 701b4776a34SChuck Lever __entry->client_id = -1; 70278c14b38SJoe Perches __assign_str(progname, "unknown"); 7035582863fSChuck Lever __entry->version = 0; 70478c14b38SJoe Perches __assign_str(procedure, "unknown"); 7055582863fSChuck Lever } 7065582863fSChuck Lever __entry->requested = requested; 7075582863fSChuck Lever __entry->end = xdr->end; 7085582863fSChuck Lever __entry->p = xdr->p; 7095582863fSChuck Lever __entry->head_base = xdr->buf->head[0].iov_base, 7105582863fSChuck Lever __entry->head_len = xdr->buf->head[0].iov_len, 7115582863fSChuck Lever __entry->page_len = xdr->buf->page_len, 7125582863fSChuck Lever __entry->tail_base = xdr->buf->tail[0].iov_base, 7135582863fSChuck Lever __entry->tail_len = xdr->buf->tail[0].iov_len, 7145582863fSChuck Lever __entry->len = xdr->buf->len; 7155582863fSChuck Lever ), 7165582863fSChuck Lever 717b4776a34SChuck Lever TP_printk(SUNRPC_TRACE_TASK_SPECIFIER 718b4776a34SChuck Lever " %sv%d %s requested=%zu p=%p end=%p xdr=[%p,%zu]/%u/[%p,%zu]/%u\n", 7195582863fSChuck Lever __entry->task_id, __entry->client_id, 7205582863fSChuck Lever __get_str(progname), __entry->version, __get_str(procedure), 7215582863fSChuck Lever __entry->requested, __entry->p, __entry->end, 7225582863fSChuck Lever __entry->head_base, __entry->head_len, 7235582863fSChuck Lever __entry->page_len, 7245582863fSChuck Lever __entry->tail_base, __entry->tail_len, 7255582863fSChuck Lever __entry->len 7265582863fSChuck Lever ) 7275582863fSChuck Lever ); 7285582863fSChuck Lever 7297be9cea3SChuck Lever TRACE_EVENT(rpc_xdr_alignment, 7307be9cea3SChuck Lever TP_PROTO( 7317be9cea3SChuck Lever const struct xdr_stream *xdr, 7327be9cea3SChuck Lever size_t offset, 7337be9cea3SChuck Lever unsigned int copied 7347be9cea3SChuck Lever ), 7357be9cea3SChuck Lever 7367be9cea3SChuck Lever TP_ARGS(xdr, offset, copied), 7377be9cea3SChuck Lever 7387be9cea3SChuck Lever TP_STRUCT__entry( 7397be9cea3SChuck Lever __field(unsigned int, task_id) 7407be9cea3SChuck Lever __field(unsigned int, client_id) 7417be9cea3SChuck Lever __field(int, version) 7427be9cea3SChuck Lever __field(size_t, offset) 7437be9cea3SChuck Lever __field(unsigned int, copied) 7447be9cea3SChuck Lever __field(const void *, head_base) 7457be9cea3SChuck Lever __field(size_t, head_len) 7467be9cea3SChuck Lever __field(const void *, tail_base) 7477be9cea3SChuck Lever __field(size_t, tail_len) 7487be9cea3SChuck Lever __field(unsigned int, page_len) 7497be9cea3SChuck Lever __field(unsigned int, len) 7507be9cea3SChuck Lever __string(progname, 7517be9cea3SChuck Lever xdr->rqst->rq_task->tk_client->cl_program->name) 7527be9cea3SChuck Lever __string(procedure, 7537be9cea3SChuck Lever xdr->rqst->rq_task->tk_msg.rpc_proc->p_name) 7547be9cea3SChuck Lever ), 7557be9cea3SChuck Lever 7567be9cea3SChuck Lever TP_fast_assign( 7577be9cea3SChuck Lever const struct rpc_task *task = xdr->rqst->rq_task; 7587be9cea3SChuck Lever 7597be9cea3SChuck Lever __entry->task_id = task->tk_pid; 7607be9cea3SChuck Lever __entry->client_id = task->tk_client->cl_clid; 7617be9cea3SChuck Lever __assign_str(progname, 76278c14b38SJoe Perches task->tk_client->cl_program->name); 7637be9cea3SChuck Lever __entry->version = task->tk_client->cl_vers; 76478c14b38SJoe Perches __assign_str(procedure, task->tk_msg.rpc_proc->p_name); 7657be9cea3SChuck Lever 7667be9cea3SChuck Lever __entry->offset = offset; 7677be9cea3SChuck Lever __entry->copied = copied; 7687be9cea3SChuck Lever __entry->head_base = xdr->buf->head[0].iov_base, 7697be9cea3SChuck Lever __entry->head_len = xdr->buf->head[0].iov_len, 7707be9cea3SChuck Lever __entry->page_len = xdr->buf->page_len, 7717be9cea3SChuck Lever __entry->tail_base = xdr->buf->tail[0].iov_base, 7727be9cea3SChuck Lever __entry->tail_len = xdr->buf->tail[0].iov_len, 7737be9cea3SChuck Lever __entry->len = xdr->buf->len; 7747be9cea3SChuck Lever ), 7757be9cea3SChuck Lever 776b4776a34SChuck Lever TP_printk(SUNRPC_TRACE_TASK_SPECIFIER 777b4776a34SChuck Lever " %sv%d %s offset=%zu copied=%u xdr=[%p,%zu]/%u/[%p,%zu]/%u\n", 7787be9cea3SChuck Lever __entry->task_id, __entry->client_id, 7797be9cea3SChuck Lever __get_str(progname), __entry->version, __get_str(procedure), 7807be9cea3SChuck Lever __entry->offset, __entry->copied, 7817be9cea3SChuck Lever __entry->head_base, __entry->head_len, 7827be9cea3SChuck Lever __entry->page_len, 7837be9cea3SChuck Lever __entry->tail_base, __entry->tail_len, 7847be9cea3SChuck Lever __entry->len 7857be9cea3SChuck Lever ) 7867be9cea3SChuck Lever ); 7877be9cea3SChuck Lever 7886ba16eefSSteven Rostedt (Red Hat) /* 7896ba16eefSSteven Rostedt (Red Hat) * First define the enums in the below macros to be exported to userspace 7906ba16eefSSteven Rostedt (Red Hat) * via TRACE_DEFINE_ENUM(). 7916ba16eefSSteven Rostedt (Red Hat) */ 7926ba16eefSSteven Rostedt (Red Hat) #undef EM 7936ba16eefSSteven Rostedt (Red Hat) #undef EMe 7946ba16eefSSteven Rostedt (Red Hat) #define EM(a, b) TRACE_DEFINE_ENUM(a); 7956ba16eefSSteven Rostedt (Red Hat) #define EMe(a, b) TRACE_DEFINE_ENUM(a); 7966ba16eefSSteven Rostedt (Red Hat) 7976ba16eefSSteven Rostedt (Red Hat) #define RPC_SHOW_SOCKET \ 7986ba16eefSSteven Rostedt (Red Hat) EM( SS_FREE, "FREE" ) \ 7996ba16eefSSteven Rostedt (Red Hat) EM( SS_UNCONNECTED, "UNCONNECTED" ) \ 80082909dc5SChuck Lever EM( SS_CONNECTING, "CONNECTING" ) \ 80182909dc5SChuck Lever EM( SS_CONNECTED, "CONNECTED" ) \ 8026ba16eefSSteven Rostedt (Red Hat) EMe( SS_DISCONNECTING, "DISCONNECTING" ) 8036ba16eefSSteven Rostedt (Red Hat) 80440b5ea0cSTrond Myklebust #define rpc_show_socket_state(state) \ 8056ba16eefSSteven Rostedt (Red Hat) __print_symbolic(state, RPC_SHOW_SOCKET) 8066ba16eefSSteven Rostedt (Red Hat) 8076ba16eefSSteven Rostedt (Red Hat) RPC_SHOW_SOCKET 8086ba16eefSSteven Rostedt (Red Hat) 8096ba16eefSSteven Rostedt (Red Hat) #define RPC_SHOW_SOCK \ 8106ba16eefSSteven Rostedt (Red Hat) EM( TCP_ESTABLISHED, "ESTABLISHED" ) \ 8116ba16eefSSteven Rostedt (Red Hat) EM( TCP_SYN_SENT, "SYN_SENT" ) \ 8126ba16eefSSteven Rostedt (Red Hat) EM( TCP_SYN_RECV, "SYN_RECV" ) \ 8136ba16eefSSteven Rostedt (Red Hat) EM( TCP_FIN_WAIT1, "FIN_WAIT1" ) \ 8146ba16eefSSteven Rostedt (Red Hat) EM( TCP_FIN_WAIT2, "FIN_WAIT2" ) \ 8156ba16eefSSteven Rostedt (Red Hat) EM( TCP_TIME_WAIT, "TIME_WAIT" ) \ 8166ba16eefSSteven Rostedt (Red Hat) EM( TCP_CLOSE, "CLOSE" ) \ 8176ba16eefSSteven Rostedt (Red Hat) EM( TCP_CLOSE_WAIT, "CLOSE_WAIT" ) \ 8186ba16eefSSteven Rostedt (Red Hat) EM( TCP_LAST_ACK, "LAST_ACK" ) \ 8196ba16eefSSteven Rostedt (Red Hat) EM( TCP_LISTEN, "LISTEN" ) \ 8206ba16eefSSteven Rostedt (Red Hat) EMe( TCP_CLOSING, "CLOSING" ) 82140b5ea0cSTrond Myklebust 82240b5ea0cSTrond Myklebust #define rpc_show_sock_state(state) \ 8236ba16eefSSteven Rostedt (Red Hat) __print_symbolic(state, RPC_SHOW_SOCK) 8246ba16eefSSteven Rostedt (Red Hat) 8256ba16eefSSteven Rostedt (Red Hat) RPC_SHOW_SOCK 8266ba16eefSSteven Rostedt (Red Hat) 8274b0c359bSPierguido Lambri 8284b0c359bSPierguido Lambri #include <trace/events/net_probe_common.h> 8294b0c359bSPierguido Lambri 8306ba16eefSSteven Rostedt (Red Hat) /* 8316ba16eefSSteven Rostedt (Red Hat) * Now redefine the EM() and EMe() macros to map the enums to the strings 8326ba16eefSSteven Rostedt (Red Hat) * that will be printed in the output. 8336ba16eefSSteven Rostedt (Red Hat) */ 8346ba16eefSSteven Rostedt (Red Hat) #undef EM 8356ba16eefSSteven Rostedt (Red Hat) #undef EMe 8366ba16eefSSteven Rostedt (Red Hat) #define EM(a, b) {a, b}, 8376ba16eefSSteven Rostedt (Red Hat) #define EMe(a, b) {a, b} 83840b5ea0cSTrond Myklebust 83940b5ea0cSTrond Myklebust DECLARE_EVENT_CLASS(xs_socket_event, 84040b5ea0cSTrond Myklebust 84140b5ea0cSTrond Myklebust TP_PROTO( 84240b5ea0cSTrond Myklebust struct rpc_xprt *xprt, 84340b5ea0cSTrond Myklebust struct socket *socket 84440b5ea0cSTrond Myklebust ), 84540b5ea0cSTrond Myklebust 84640b5ea0cSTrond Myklebust TP_ARGS(xprt, socket), 84740b5ea0cSTrond Myklebust 84840b5ea0cSTrond Myklebust TP_STRUCT__entry( 84940b5ea0cSTrond Myklebust __field(unsigned int, socket_state) 85040b5ea0cSTrond Myklebust __field(unsigned int, sock_state) 85140b5ea0cSTrond Myklebust __field(unsigned long long, ino) 8524b0c359bSPierguido Lambri __array(__u8, saddr, sizeof(struct sockaddr_in6)) 8534b0c359bSPierguido Lambri __array(__u8, daddr, sizeof(struct sockaddr_in6)) 85440b5ea0cSTrond Myklebust ), 85540b5ea0cSTrond Myklebust 85640b5ea0cSTrond Myklebust TP_fast_assign( 85740b5ea0cSTrond Myklebust struct inode *inode = SOCK_INODE(socket); 8584b0c359bSPierguido Lambri const struct sock *sk = socket->sk; 8594b0c359bSPierguido Lambri const struct inet_sock *inet = inet_sk(sk); 8604b0c359bSPierguido Lambri 8614b0c359bSPierguido Lambri memset(__entry->saddr, 0, sizeof(struct sockaddr_in6)); 8624b0c359bSPierguido Lambri memset(__entry->daddr, 0, sizeof(struct sockaddr_in6)); 8634b0c359bSPierguido Lambri 8644b0c359bSPierguido Lambri TP_STORE_ADDR_PORTS(__entry, inet, sk); 8654b0c359bSPierguido Lambri 86640b5ea0cSTrond Myklebust __entry->socket_state = socket->state; 86740b5ea0cSTrond Myklebust __entry->sock_state = socket->sk->sk_state; 86840b5ea0cSTrond Myklebust __entry->ino = (unsigned long long)inode->i_ino; 8694b0c359bSPierguido Lambri 87040b5ea0cSTrond Myklebust ), 87140b5ea0cSTrond Myklebust 87240b5ea0cSTrond Myklebust TP_printk( 8734b0c359bSPierguido Lambri "socket:[%llu] srcaddr=%pISpc dstaddr=%pISpc " 87440b5ea0cSTrond Myklebust "state=%u (%s) sk_state=%u (%s)", 8754b0c359bSPierguido Lambri __entry->ino, 8764b0c359bSPierguido Lambri __entry->saddr, 8774b0c359bSPierguido Lambri __entry->daddr, 87840b5ea0cSTrond Myklebust __entry->socket_state, 87940b5ea0cSTrond Myklebust rpc_show_socket_state(__entry->socket_state), 88040b5ea0cSTrond Myklebust __entry->sock_state, 88140b5ea0cSTrond Myklebust rpc_show_sock_state(__entry->sock_state) 88240b5ea0cSTrond Myklebust ) 88340b5ea0cSTrond Myklebust ); 88440b5ea0cSTrond Myklebust #define DEFINE_RPC_SOCKET_EVENT(name) \ 88540b5ea0cSTrond Myklebust DEFINE_EVENT(xs_socket_event, name, \ 88640b5ea0cSTrond Myklebust TP_PROTO( \ 88740b5ea0cSTrond Myklebust struct rpc_xprt *xprt, \ 88840b5ea0cSTrond Myklebust struct socket *socket \ 88940b5ea0cSTrond Myklebust ), \ 89040b5ea0cSTrond Myklebust TP_ARGS(xprt, socket)) 89140b5ea0cSTrond Myklebust 89240b5ea0cSTrond Myklebust DECLARE_EVENT_CLASS(xs_socket_event_done, 89340b5ea0cSTrond Myklebust 89440b5ea0cSTrond Myklebust TP_PROTO( 89540b5ea0cSTrond Myklebust struct rpc_xprt *xprt, 89640b5ea0cSTrond Myklebust struct socket *socket, 89740b5ea0cSTrond Myklebust int error 89840b5ea0cSTrond Myklebust ), 89940b5ea0cSTrond Myklebust 90040b5ea0cSTrond Myklebust TP_ARGS(xprt, socket, error), 90140b5ea0cSTrond Myklebust 90240b5ea0cSTrond Myklebust TP_STRUCT__entry( 90340b5ea0cSTrond Myklebust __field(int, error) 90440b5ea0cSTrond Myklebust __field(unsigned int, socket_state) 90540b5ea0cSTrond Myklebust __field(unsigned int, sock_state) 90640b5ea0cSTrond Myklebust __field(unsigned long long, ino) 9074b0c359bSPierguido Lambri __array(__u8, saddr, sizeof(struct sockaddr_in6)) 9084b0c359bSPierguido Lambri __array(__u8, daddr, sizeof(struct sockaddr_in6)) 90940b5ea0cSTrond Myklebust ), 91040b5ea0cSTrond Myklebust 91140b5ea0cSTrond Myklebust TP_fast_assign( 91240b5ea0cSTrond Myklebust struct inode *inode = SOCK_INODE(socket); 9134b0c359bSPierguido Lambri const struct sock *sk = socket->sk; 9144b0c359bSPierguido Lambri const struct inet_sock *inet = inet_sk(sk); 9154b0c359bSPierguido Lambri 9164b0c359bSPierguido Lambri memset(__entry->saddr, 0, sizeof(struct sockaddr_in6)); 9174b0c359bSPierguido Lambri memset(__entry->daddr, 0, sizeof(struct sockaddr_in6)); 9184b0c359bSPierguido Lambri 9194b0c359bSPierguido Lambri TP_STORE_ADDR_PORTS(__entry, inet, sk); 9204b0c359bSPierguido Lambri 92140b5ea0cSTrond Myklebust __entry->socket_state = socket->state; 92240b5ea0cSTrond Myklebust __entry->sock_state = socket->sk->sk_state; 92340b5ea0cSTrond Myklebust __entry->ino = (unsigned long long)inode->i_ino; 92440b5ea0cSTrond Myklebust __entry->error = error; 92540b5ea0cSTrond Myklebust ), 92640b5ea0cSTrond Myklebust 92740b5ea0cSTrond Myklebust TP_printk( 9284b0c359bSPierguido Lambri "error=%d socket:[%llu] srcaddr=%pISpc dstaddr=%pISpc " 92940b5ea0cSTrond Myklebust "state=%u (%s) sk_state=%u (%s)", 93040b5ea0cSTrond Myklebust __entry->error, 9314b0c359bSPierguido Lambri __entry->ino, 9324b0c359bSPierguido Lambri __entry->saddr, 9334b0c359bSPierguido Lambri __entry->daddr, 93440b5ea0cSTrond Myklebust __entry->socket_state, 93540b5ea0cSTrond Myklebust rpc_show_socket_state(__entry->socket_state), 93640b5ea0cSTrond Myklebust __entry->sock_state, 93740b5ea0cSTrond Myklebust rpc_show_sock_state(__entry->sock_state) 93840b5ea0cSTrond Myklebust ) 93940b5ea0cSTrond Myklebust ); 94040b5ea0cSTrond Myklebust #define DEFINE_RPC_SOCKET_EVENT_DONE(name) \ 94140b5ea0cSTrond Myklebust DEFINE_EVENT(xs_socket_event_done, name, \ 94240b5ea0cSTrond Myklebust TP_PROTO( \ 94340b5ea0cSTrond Myklebust struct rpc_xprt *xprt, \ 94440b5ea0cSTrond Myklebust struct socket *socket, \ 94540b5ea0cSTrond Myklebust int error \ 94640b5ea0cSTrond Myklebust ), \ 94740b5ea0cSTrond Myklebust TP_ARGS(xprt, socket, error)) 94840b5ea0cSTrond Myklebust 94940b5ea0cSTrond Myklebust DEFINE_RPC_SOCKET_EVENT(rpc_socket_state_change); 95040b5ea0cSTrond Myklebust DEFINE_RPC_SOCKET_EVENT_DONE(rpc_socket_connect); 951e8353c76STrond Myklebust DEFINE_RPC_SOCKET_EVENT_DONE(rpc_socket_error); 95240b5ea0cSTrond Myklebust DEFINE_RPC_SOCKET_EVENT_DONE(rpc_socket_reset_connection); 95340b5ea0cSTrond Myklebust DEFINE_RPC_SOCKET_EVENT(rpc_socket_close); 95440b5ea0cSTrond Myklebust DEFINE_RPC_SOCKET_EVENT(rpc_socket_shutdown); 95540b5ea0cSTrond Myklebust 956015747d2SChuck Lever TRACE_EVENT(rpc_socket_nospace, 957015747d2SChuck Lever TP_PROTO( 958015747d2SChuck Lever const struct rpc_rqst *rqst, 959015747d2SChuck Lever const struct sock_xprt *transport 960015747d2SChuck Lever ), 961015747d2SChuck Lever 962015747d2SChuck Lever TP_ARGS(rqst, transport), 963015747d2SChuck Lever 964015747d2SChuck Lever TP_STRUCT__entry( 965015747d2SChuck Lever __field(unsigned int, task_id) 966015747d2SChuck Lever __field(unsigned int, client_id) 967015747d2SChuck Lever __field(unsigned int, total) 968015747d2SChuck Lever __field(unsigned int, remaining) 969015747d2SChuck Lever ), 970015747d2SChuck Lever 971015747d2SChuck Lever TP_fast_assign( 972015747d2SChuck Lever __entry->task_id = rqst->rq_task->tk_pid; 973015747d2SChuck Lever __entry->client_id = rqst->rq_task->tk_client->cl_clid; 974015747d2SChuck Lever __entry->total = rqst->rq_slen; 975015747d2SChuck Lever __entry->remaining = rqst->rq_slen - transport->xmit.offset; 976015747d2SChuck Lever ), 977015747d2SChuck Lever 978b4776a34SChuck Lever TP_printk(SUNRPC_TRACE_TASK_SPECIFIER 979b4776a34SChuck Lever " total=%u remaining=%u", 980015747d2SChuck Lever __entry->task_id, __entry->client_id, 981015747d2SChuck Lever __entry->total, __entry->remaining 982015747d2SChuck Lever ) 983015747d2SChuck Lever ); 984015747d2SChuck Lever 98594afd9c4SChuck Lever #define rpc_show_xprt_state(x) \ 98694afd9c4SChuck Lever __print_flags(x, "|", \ 98776497b1aSChuck Lever { BIT(XPRT_LOCKED), "LOCKED" }, \ 98876497b1aSChuck Lever { BIT(XPRT_CONNECTED), "CONNECTED" }, \ 98976497b1aSChuck Lever { BIT(XPRT_CONNECTING), "CONNECTING" }, \ 99076497b1aSChuck Lever { BIT(XPRT_CLOSE_WAIT), "CLOSE_WAIT" }, \ 99176497b1aSChuck Lever { BIT(XPRT_BOUND), "BOUND" }, \ 99276497b1aSChuck Lever { BIT(XPRT_BINDING), "BINDING" }, \ 99376497b1aSChuck Lever { BIT(XPRT_CLOSING), "CLOSING" }, \ 99476497b1aSChuck Lever { BIT(XPRT_OFFLINE), "OFFLINE" }, \ 99576497b1aSChuck Lever { BIT(XPRT_REMOVE), "REMOVE" }, \ 99676497b1aSChuck Lever { BIT(XPRT_CONGESTED), "CONGESTED" }, \ 99776497b1aSChuck Lever { BIT(XPRT_CWND_WAIT), "CWND_WAIT" }, \ 998aed28b7aSChuck Lever { BIT(XPRT_WRITE_SPACE), "WRITE_SPACE" }, \ 999aed28b7aSChuck Lever { BIT(XPRT_SND_IS_COOKIE), "SND_IS_COOKIE" }) 100094afd9c4SChuck Lever 1001911813d7SChuck Lever DECLARE_EVENT_CLASS(rpc_xprt_lifetime_class, 1002911813d7SChuck Lever TP_PROTO( 1003911813d7SChuck Lever const struct rpc_xprt *xprt 1004911813d7SChuck Lever ), 1005911813d7SChuck Lever 1006911813d7SChuck Lever TP_ARGS(xprt), 1007911813d7SChuck Lever 1008911813d7SChuck Lever TP_STRUCT__entry( 100994afd9c4SChuck Lever __field(unsigned long, state) 1010911813d7SChuck Lever __string(addr, xprt->address_strings[RPC_DISPLAY_ADDR]) 1011911813d7SChuck Lever __string(port, xprt->address_strings[RPC_DISPLAY_PORT]) 1012911813d7SChuck Lever ), 1013911813d7SChuck Lever 1014911813d7SChuck Lever TP_fast_assign( 101594afd9c4SChuck Lever __entry->state = xprt->state; 1016911813d7SChuck Lever __assign_str(addr, xprt->address_strings[RPC_DISPLAY_ADDR]); 1017911813d7SChuck Lever __assign_str(port, xprt->address_strings[RPC_DISPLAY_PORT]); 1018911813d7SChuck Lever ), 1019911813d7SChuck Lever 102094afd9c4SChuck Lever TP_printk("peer=[%s]:%s state=%s", 102194afd9c4SChuck Lever __get_str(addr), __get_str(port), 102294afd9c4SChuck Lever rpc_show_xprt_state(__entry->state)) 1023911813d7SChuck Lever ); 1024911813d7SChuck Lever 1025911813d7SChuck Lever #define DEFINE_RPC_XPRT_LIFETIME_EVENT(name) \ 1026911813d7SChuck Lever DEFINE_EVENT(rpc_xprt_lifetime_class, \ 1027911813d7SChuck Lever xprt_##name, \ 1028911813d7SChuck Lever TP_PROTO( \ 1029911813d7SChuck Lever const struct rpc_xprt *xprt \ 1030911813d7SChuck Lever ), \ 1031911813d7SChuck Lever TP_ARGS(xprt)) 1032911813d7SChuck Lever 1033911813d7SChuck Lever DEFINE_RPC_XPRT_LIFETIME_EVENT(create); 1034db0a86c4SChuck Lever DEFINE_RPC_XPRT_LIFETIME_EVENT(connect); 1035911813d7SChuck Lever DEFINE_RPC_XPRT_LIFETIME_EVENT(disconnect_auto); 1036911813d7SChuck Lever DEFINE_RPC_XPRT_LIFETIME_EVENT(disconnect_done); 1037911813d7SChuck Lever DEFINE_RPC_XPRT_LIFETIME_EVENT(disconnect_force); 1038911813d7SChuck Lever DEFINE_RPC_XPRT_LIFETIME_EVENT(destroy); 1039911813d7SChuck Lever 10403705ad64SJeff Layton DECLARE_EVENT_CLASS(rpc_xprt_event, 1041dc5820bdSChuck Lever TP_PROTO( 1042dc5820bdSChuck Lever const struct rpc_xprt *xprt, 1043dc5820bdSChuck Lever __be32 xid, 1044dc5820bdSChuck Lever int status 1045dc5820bdSChuck Lever ), 10463705ad64SJeff Layton 10473705ad64SJeff Layton TP_ARGS(xprt, xid, status), 10483705ad64SJeff Layton 10493705ad64SJeff Layton TP_STRUCT__entry( 1050a30ccf1aSChuck Lever __field(u32, xid) 10513705ad64SJeff Layton __field(int, status) 10523705ad64SJeff Layton __string(addr, xprt->address_strings[RPC_DISPLAY_ADDR]) 10533705ad64SJeff Layton __string(port, xprt->address_strings[RPC_DISPLAY_PORT]) 10543705ad64SJeff Layton ), 10553705ad64SJeff Layton 10563705ad64SJeff Layton TP_fast_assign( 1057a30ccf1aSChuck Lever __entry->xid = be32_to_cpu(xid); 10583705ad64SJeff Layton __entry->status = status; 10593705ad64SJeff Layton __assign_str(addr, xprt->address_strings[RPC_DISPLAY_ADDR]); 10603705ad64SJeff Layton __assign_str(port, xprt->address_strings[RPC_DISPLAY_PORT]); 10613705ad64SJeff Layton ), 10623705ad64SJeff Layton 1063a30ccf1aSChuck Lever TP_printk("peer=[%s]:%s xid=0x%08x status=%d", __get_str(addr), 1064a30ccf1aSChuck Lever __get_str(port), __entry->xid, 10653705ad64SJeff Layton __entry->status) 10663705ad64SJeff Layton ); 1067dc5820bdSChuck Lever #define DEFINE_RPC_XPRT_EVENT(name) \ 1068dc5820bdSChuck Lever DEFINE_EVENT(rpc_xprt_event, xprt_##name, \ 1069dc5820bdSChuck Lever TP_PROTO( \ 1070dc5820bdSChuck Lever const struct rpc_xprt *xprt, \ 1071dc5820bdSChuck Lever __be32 xid, \ 1072dc5820bdSChuck Lever int status \ 1073dc5820bdSChuck Lever ), \ 1074dc5820bdSChuck Lever TP_ARGS(xprt, xid, status)) 10753705ad64SJeff Layton 1076dc5820bdSChuck Lever DEFINE_RPC_XPRT_EVENT(timer); 1077dc5820bdSChuck Lever DEFINE_RPC_XPRT_EVENT(lookup_rqst); 10783705ad64SJeff Layton 10790c77668dSChuck Lever TRACE_EVENT(xprt_transmit, 10800c77668dSChuck Lever TP_PROTO( 10810c77668dSChuck Lever const struct rpc_rqst *rqst, 10820c77668dSChuck Lever int status 10830c77668dSChuck Lever ), 10840c77668dSChuck Lever 10850c77668dSChuck Lever TP_ARGS(rqst, status), 10860c77668dSChuck Lever 10870c77668dSChuck Lever TP_STRUCT__entry( 10880c77668dSChuck Lever __field(unsigned int, task_id) 10890c77668dSChuck Lever __field(unsigned int, client_id) 10900c77668dSChuck Lever __field(u32, xid) 10910c77668dSChuck Lever __field(u32, seqno) 10920c77668dSChuck Lever __field(int, status) 10930c77668dSChuck Lever ), 10940c77668dSChuck Lever 10950c77668dSChuck Lever TP_fast_assign( 10960c77668dSChuck Lever __entry->task_id = rqst->rq_task->tk_pid; 1097f87b543aSOlga Kornievskaia __entry->client_id = rqst->rq_task->tk_client ? 1098f87b543aSOlga Kornievskaia rqst->rq_task->tk_client->cl_clid : -1; 10990c77668dSChuck Lever __entry->xid = be32_to_cpu(rqst->rq_xid); 11000c77668dSChuck Lever __entry->seqno = rqst->rq_seqno; 11010c77668dSChuck Lever __entry->status = status; 11020c77668dSChuck Lever ), 11030c77668dSChuck Lever 1104b4776a34SChuck Lever TP_printk(SUNRPC_TRACE_TASK_SPECIFIER 1105b4776a34SChuck Lever " xid=0x%08x seqno=%u status=%d", 11060c77668dSChuck Lever __entry->task_id, __entry->client_id, __entry->xid, 11070c77668dSChuck Lever __entry->seqno, __entry->status) 11080c77668dSChuck Lever ); 11090c77668dSChuck Lever 1110e936a597SChuck Lever TRACE_EVENT(xprt_retransmit, 1111e936a597SChuck Lever TP_PROTO( 1112e936a597SChuck Lever const struct rpc_rqst *rqst 1113e936a597SChuck Lever ), 1114e936a597SChuck Lever 1115e936a597SChuck Lever TP_ARGS(rqst), 1116e936a597SChuck Lever 1117e936a597SChuck Lever TP_STRUCT__entry( 1118e936a597SChuck Lever __field(unsigned int, task_id) 1119e936a597SChuck Lever __field(unsigned int, client_id) 1120e936a597SChuck Lever __field(u32, xid) 1121e936a597SChuck Lever __field(int, ntrans) 1122e936a597SChuck Lever __field(int, version) 1123be17b8caSChuck Lever __field(unsigned long, timeout) 1124e936a597SChuck Lever __string(progname, 1125e936a597SChuck Lever rqst->rq_task->tk_client->cl_program->name) 1126be630b91SChuck Lever __string(procname, rpc_proc_name(rqst->rq_task)) 1127e936a597SChuck Lever ), 1128e936a597SChuck Lever 1129e936a597SChuck Lever TP_fast_assign( 1130e936a597SChuck Lever struct rpc_task *task = rqst->rq_task; 1131e936a597SChuck Lever 1132e936a597SChuck Lever __entry->task_id = task->tk_pid; 1133e936a597SChuck Lever __entry->client_id = task->tk_client ? 1134e936a597SChuck Lever task->tk_client->cl_clid : -1; 1135e936a597SChuck Lever __entry->xid = be32_to_cpu(rqst->rq_xid); 1136e936a597SChuck Lever __entry->ntrans = rqst->rq_ntrans; 1137be17b8caSChuck Lever __entry->timeout = task->tk_timeout; 1138e936a597SChuck Lever __assign_str(progname, 113978c14b38SJoe Perches task->tk_client->cl_program->name); 1140e936a597SChuck Lever __entry->version = task->tk_client->cl_vers; 1141be630b91SChuck Lever __assign_str(procname, rpc_proc_name(task)); 1142e936a597SChuck Lever ), 1143e936a597SChuck Lever 1144b4776a34SChuck Lever TP_printk(SUNRPC_TRACE_TASK_SPECIFIER 1145b4776a34SChuck Lever " xid=0x%08x %sv%d %s ntrans=%d timeout=%lu", 1146e936a597SChuck Lever __entry->task_id, __entry->client_id, __entry->xid, 1147be630b91SChuck Lever __get_str(progname), __entry->version, __get_str(procname), 1148be17b8caSChuck Lever __entry->ntrans, __entry->timeout 1149be630b91SChuck Lever ) 1150e936a597SChuck Lever ); 1151e936a597SChuck Lever 1152a25a4cb3SChuck Lever TRACE_EVENT(xprt_ping, 1153a25a4cb3SChuck Lever TP_PROTO(const struct rpc_xprt *xprt, int status), 1154a25a4cb3SChuck Lever 1155a25a4cb3SChuck Lever TP_ARGS(xprt, status), 1156a25a4cb3SChuck Lever 1157a25a4cb3SChuck Lever TP_STRUCT__entry( 1158a25a4cb3SChuck Lever __field(int, status) 1159a25a4cb3SChuck Lever __string(addr, xprt->address_strings[RPC_DISPLAY_ADDR]) 1160a25a4cb3SChuck Lever __string(port, xprt->address_strings[RPC_DISPLAY_PORT]) 1161a25a4cb3SChuck Lever ), 1162a25a4cb3SChuck Lever 1163a25a4cb3SChuck Lever TP_fast_assign( 1164a25a4cb3SChuck Lever __entry->status = status; 1165a25a4cb3SChuck Lever __assign_str(addr, xprt->address_strings[RPC_DISPLAY_ADDR]); 1166a25a4cb3SChuck Lever __assign_str(port, xprt->address_strings[RPC_DISPLAY_PORT]); 1167a25a4cb3SChuck Lever ), 1168a25a4cb3SChuck Lever 1169a25a4cb3SChuck Lever TP_printk("peer=[%s]:%s status=%d", 1170a25a4cb3SChuck Lever __get_str(addr), __get_str(port), __entry->status) 1171a25a4cb3SChuck Lever ); 1172a25a4cb3SChuck Lever 1173bf7ca707SChuck Lever DECLARE_EVENT_CLASS(xprt_writelock_event, 1174bf7ca707SChuck Lever TP_PROTO( 1175bf7ca707SChuck Lever const struct rpc_xprt *xprt, const struct rpc_task *task 1176bf7ca707SChuck Lever ), 1177bf7ca707SChuck Lever 1178bf7ca707SChuck Lever TP_ARGS(xprt, task), 1179bf7ca707SChuck Lever 1180bf7ca707SChuck Lever TP_STRUCT__entry( 1181bf7ca707SChuck Lever __field(unsigned int, task_id) 1182bf7ca707SChuck Lever __field(unsigned int, client_id) 1183bf7ca707SChuck Lever __field(unsigned int, snd_task_id) 1184bf7ca707SChuck Lever ), 1185bf7ca707SChuck Lever 1186bf7ca707SChuck Lever TP_fast_assign( 1187bf7ca707SChuck Lever if (task) { 1188bf7ca707SChuck Lever __entry->task_id = task->tk_pid; 1189bf7ca707SChuck Lever __entry->client_id = task->tk_client ? 1190bf7ca707SChuck Lever task->tk_client->cl_clid : -1; 1191bf7ca707SChuck Lever } else { 1192bf7ca707SChuck Lever __entry->task_id = -1; 1193bf7ca707SChuck Lever __entry->client_id = -1; 1194bf7ca707SChuck Lever } 1195aed28b7aSChuck Lever if (xprt->snd_task && 1196aed28b7aSChuck Lever !test_bit(XPRT_SND_IS_COOKIE, &xprt->state)) 1197aed28b7aSChuck Lever __entry->snd_task_id = xprt->snd_task->tk_pid; 1198aed28b7aSChuck Lever else 1199aed28b7aSChuck Lever __entry->snd_task_id = -1; 1200bf7ca707SChuck Lever ), 1201bf7ca707SChuck Lever 1202b4776a34SChuck Lever TP_printk(SUNRPC_TRACE_TASK_SPECIFIER 1203b4776a34SChuck Lever " snd_task:" SUNRPC_TRACE_PID_SPECIFIER, 1204bf7ca707SChuck Lever __entry->task_id, __entry->client_id, 1205bf7ca707SChuck Lever __entry->snd_task_id) 1206bf7ca707SChuck Lever ); 1207bf7ca707SChuck Lever 1208bf7ca707SChuck Lever #define DEFINE_WRITELOCK_EVENT(name) \ 1209bf7ca707SChuck Lever DEFINE_EVENT(xprt_writelock_event, xprt_##name, \ 1210bf7ca707SChuck Lever TP_PROTO( \ 1211bf7ca707SChuck Lever const struct rpc_xprt *xprt, \ 1212bf7ca707SChuck Lever const struct rpc_task *task \ 1213bf7ca707SChuck Lever ), \ 1214bf7ca707SChuck Lever TP_ARGS(xprt, task)) 1215bf7ca707SChuck Lever 1216bf7ca707SChuck Lever DEFINE_WRITELOCK_EVENT(reserve_xprt); 1217bf7ca707SChuck Lever DEFINE_WRITELOCK_EVENT(release_xprt); 1218bf7ca707SChuck Lever 1219bf7ca707SChuck Lever DECLARE_EVENT_CLASS(xprt_cong_event, 1220bf7ca707SChuck Lever TP_PROTO( 1221bf7ca707SChuck Lever const struct rpc_xprt *xprt, const struct rpc_task *task 1222bf7ca707SChuck Lever ), 1223bf7ca707SChuck Lever 1224bf7ca707SChuck Lever TP_ARGS(xprt, task), 1225bf7ca707SChuck Lever 1226bf7ca707SChuck Lever TP_STRUCT__entry( 1227bf7ca707SChuck Lever __field(unsigned int, task_id) 1228bf7ca707SChuck Lever __field(unsigned int, client_id) 1229bf7ca707SChuck Lever __field(unsigned int, snd_task_id) 1230bf7ca707SChuck Lever __field(unsigned long, cong) 1231bf7ca707SChuck Lever __field(unsigned long, cwnd) 1232bf7ca707SChuck Lever __field(bool, wait) 1233bf7ca707SChuck Lever ), 1234bf7ca707SChuck Lever 1235bf7ca707SChuck Lever TP_fast_assign( 1236bf7ca707SChuck Lever if (task) { 1237bf7ca707SChuck Lever __entry->task_id = task->tk_pid; 1238bf7ca707SChuck Lever __entry->client_id = task->tk_client ? 1239bf7ca707SChuck Lever task->tk_client->cl_clid : -1; 1240bf7ca707SChuck Lever } else { 1241bf7ca707SChuck Lever __entry->task_id = -1; 1242bf7ca707SChuck Lever __entry->client_id = -1; 1243bf7ca707SChuck Lever } 1244aed28b7aSChuck Lever if (xprt->snd_task && 1245aed28b7aSChuck Lever !test_bit(XPRT_SND_IS_COOKIE, &xprt->state)) 1246aed28b7aSChuck Lever __entry->snd_task_id = xprt->snd_task->tk_pid; 1247aed28b7aSChuck Lever else 1248aed28b7aSChuck Lever __entry->snd_task_id = -1; 1249aed28b7aSChuck Lever 1250bf7ca707SChuck Lever __entry->cong = xprt->cong; 1251bf7ca707SChuck Lever __entry->cwnd = xprt->cwnd; 1252bf7ca707SChuck Lever __entry->wait = test_bit(XPRT_CWND_WAIT, &xprt->state); 1253bf7ca707SChuck Lever ), 1254bf7ca707SChuck Lever 1255b4776a34SChuck Lever TP_printk(SUNRPC_TRACE_TASK_SPECIFIER 1256b4776a34SChuck Lever " snd_task:" SUNRPC_TRACE_PID_SPECIFIER 1257b4776a34SChuck Lever " cong=%lu cwnd=%lu%s", 1258bf7ca707SChuck Lever __entry->task_id, __entry->client_id, 1259bf7ca707SChuck Lever __entry->snd_task_id, __entry->cong, __entry->cwnd, 1260bf7ca707SChuck Lever __entry->wait ? " (wait)" : "") 1261bf7ca707SChuck Lever ); 1262bf7ca707SChuck Lever 1263bf7ca707SChuck Lever #define DEFINE_CONG_EVENT(name) \ 1264bf7ca707SChuck Lever DEFINE_EVENT(xprt_cong_event, xprt_##name, \ 1265bf7ca707SChuck Lever TP_PROTO( \ 1266bf7ca707SChuck Lever const struct rpc_xprt *xprt, \ 1267bf7ca707SChuck Lever const struct rpc_task *task \ 1268bf7ca707SChuck Lever ), \ 1269bf7ca707SChuck Lever TP_ARGS(xprt, task)) 1270bf7ca707SChuck Lever 1271bf7ca707SChuck Lever DEFINE_CONG_EVENT(reserve_cong); 1272bf7ca707SChuck Lever DEFINE_CONG_EVENT(release_cong); 1273bf7ca707SChuck Lever DEFINE_CONG_EVENT(get_cong); 1274bf7ca707SChuck Lever DEFINE_CONG_EVENT(put_cong); 1275bf7ca707SChuck Lever 127609d2ba0cSChuck Lever TRACE_EVENT(xprt_reserve, 127709d2ba0cSChuck Lever TP_PROTO( 127809d2ba0cSChuck Lever const struct rpc_rqst *rqst 127909d2ba0cSChuck Lever ), 128009d2ba0cSChuck Lever 128109d2ba0cSChuck Lever TP_ARGS(rqst), 128209d2ba0cSChuck Lever 128309d2ba0cSChuck Lever TP_STRUCT__entry( 128409d2ba0cSChuck Lever __field(unsigned int, task_id) 128509d2ba0cSChuck Lever __field(unsigned int, client_id) 128609d2ba0cSChuck Lever __field(u32, xid) 128709d2ba0cSChuck Lever ), 128809d2ba0cSChuck Lever 128909d2ba0cSChuck Lever TP_fast_assign( 129009d2ba0cSChuck Lever __entry->task_id = rqst->rq_task->tk_pid; 129109d2ba0cSChuck Lever __entry->client_id = rqst->rq_task->tk_client->cl_clid; 129209d2ba0cSChuck Lever __entry->xid = be32_to_cpu(rqst->rq_xid); 129309d2ba0cSChuck Lever ), 129409d2ba0cSChuck Lever 1295b4776a34SChuck Lever TP_printk(SUNRPC_TRACE_TASK_SPECIFIER " xid=0x%08x", 129609d2ba0cSChuck Lever __entry->task_id, __entry->client_id, __entry->xid 129709d2ba0cSChuck Lever ) 129809d2ba0cSChuck Lever ); 129909d2ba0cSChuck Lever 1300f67939e4SChuck Lever TRACE_EVENT(xs_data_ready, 1301f67939e4SChuck Lever TP_PROTO( 1302f67939e4SChuck Lever const struct rpc_xprt *xprt 1303f67939e4SChuck Lever ), 1304f67939e4SChuck Lever 1305f67939e4SChuck Lever TP_ARGS(xprt), 1306f67939e4SChuck Lever 1307f67939e4SChuck Lever TP_STRUCT__entry( 1308f67939e4SChuck Lever __string(addr, xprt->address_strings[RPC_DISPLAY_ADDR]) 1309f67939e4SChuck Lever __string(port, xprt->address_strings[RPC_DISPLAY_PORT]) 1310f67939e4SChuck Lever ), 1311f67939e4SChuck Lever 1312f67939e4SChuck Lever TP_fast_assign( 1313f67939e4SChuck Lever __assign_str(addr, xprt->address_strings[RPC_DISPLAY_ADDR]); 1314f67939e4SChuck Lever __assign_str(port, xprt->address_strings[RPC_DISPLAY_PORT]); 1315f67939e4SChuck Lever ), 1316f67939e4SChuck Lever 1317f67939e4SChuck Lever TP_printk("peer=[%s]:%s", __get_str(addr), __get_str(port)) 1318f67939e4SChuck Lever ); 1319f67939e4SChuck Lever 1320c50b8ee0STrond Myklebust TRACE_EVENT(xs_stream_read_data, 1321c50b8ee0STrond Myklebust TP_PROTO(struct rpc_xprt *xprt, ssize_t err, size_t total), 13223705ad64SJeff Layton 13233705ad64SJeff Layton TP_ARGS(xprt, err, total), 13243705ad64SJeff Layton 13253705ad64SJeff Layton TP_STRUCT__entry( 1326c50b8ee0STrond Myklebust __field(ssize_t, err) 1327c50b8ee0STrond Myklebust __field(size_t, total) 13283705ad64SJeff Layton __string(addr, xprt ? xprt->address_strings[RPC_DISPLAY_ADDR] : 13293705ad64SJeff Layton "(null)") 13303705ad64SJeff Layton __string(port, xprt ? xprt->address_strings[RPC_DISPLAY_PORT] : 13313705ad64SJeff Layton "(null)") 13323705ad64SJeff Layton ), 13333705ad64SJeff Layton 13343705ad64SJeff Layton TP_fast_assign( 13353705ad64SJeff Layton __entry->err = err; 13363705ad64SJeff Layton __entry->total = total; 13373705ad64SJeff Layton __assign_str(addr, xprt ? 13383705ad64SJeff Layton xprt->address_strings[RPC_DISPLAY_ADDR] : "(null)"); 13393705ad64SJeff Layton __assign_str(port, xprt ? 13403705ad64SJeff Layton xprt->address_strings[RPC_DISPLAY_PORT] : "(null)"); 13413705ad64SJeff Layton ), 13423705ad64SJeff Layton 1343c50b8ee0STrond Myklebust TP_printk("peer=[%s]:%s err=%zd total=%zu", __get_str(addr), 13443705ad64SJeff Layton __get_str(port), __entry->err, __entry->total) 13453705ad64SJeff Layton ); 13463705ad64SJeff Layton 1347c50b8ee0STrond Myklebust TRACE_EVENT(xs_stream_read_request, 13481a867a08SJeff Layton TP_PROTO(struct sock_xprt *xs), 13491a867a08SJeff Layton 13501a867a08SJeff Layton TP_ARGS(xs), 13511a867a08SJeff Layton 13521a867a08SJeff Layton TP_STRUCT__entry( 13531a867a08SJeff Layton __string(addr, xs->xprt.address_strings[RPC_DISPLAY_ADDR]) 13541a867a08SJeff Layton __string(port, xs->xprt.address_strings[RPC_DISPLAY_PORT]) 1355a30ccf1aSChuck Lever __field(u32, xid) 13561a867a08SJeff Layton __field(unsigned long, copied) 13571a867a08SJeff Layton __field(unsigned int, reclen) 1358c50b8ee0STrond Myklebust __field(unsigned int, offset) 13591a867a08SJeff Layton ), 13601a867a08SJeff Layton 13611a867a08SJeff Layton TP_fast_assign( 13621a867a08SJeff Layton __assign_str(addr, xs->xprt.address_strings[RPC_DISPLAY_ADDR]); 13631a867a08SJeff Layton __assign_str(port, xs->xprt.address_strings[RPC_DISPLAY_PORT]); 1364d1109aa5STrond Myklebust __entry->xid = be32_to_cpu(xs->recv.xid); 1365d1109aa5STrond Myklebust __entry->copied = xs->recv.copied; 1366d1109aa5STrond Myklebust __entry->reclen = xs->recv.len; 1367d1109aa5STrond Myklebust __entry->offset = xs->recv.offset; 13681a867a08SJeff Layton ), 13691a867a08SJeff Layton 1370c50b8ee0STrond Myklebust TP_printk("peer=[%s]:%s xid=0x%08x copied=%lu reclen=%u offset=%u", 1371a30ccf1aSChuck Lever __get_str(addr), __get_str(port), __entry->xid, 13721a867a08SJeff Layton __entry->copied, __entry->reclen, __entry->offset) 13731a867a08SJeff Layton ); 13741a867a08SJeff Layton 1375e465cc3fSChuck Lever TRACE_EVENT(rpcb_getport, 1376e465cc3fSChuck Lever TP_PROTO( 1377e465cc3fSChuck Lever const struct rpc_clnt *clnt, 1378e465cc3fSChuck Lever const struct rpc_task *task, 1379e465cc3fSChuck Lever unsigned int bind_version 1380e465cc3fSChuck Lever ), 1381e465cc3fSChuck Lever 1382e465cc3fSChuck Lever TP_ARGS(clnt, task, bind_version), 1383e465cc3fSChuck Lever 1384e465cc3fSChuck Lever TP_STRUCT__entry( 1385e465cc3fSChuck Lever __field(unsigned int, task_id) 1386e465cc3fSChuck Lever __field(unsigned int, client_id) 1387e465cc3fSChuck Lever __field(unsigned int, program) 1388e465cc3fSChuck Lever __field(unsigned int, version) 1389e465cc3fSChuck Lever __field(int, protocol) 1390e465cc3fSChuck Lever __field(unsigned int, bind_version) 1391e465cc3fSChuck Lever __string(servername, task->tk_xprt->servername) 1392e465cc3fSChuck Lever ), 1393e465cc3fSChuck Lever 1394e465cc3fSChuck Lever TP_fast_assign( 1395e465cc3fSChuck Lever __entry->task_id = task->tk_pid; 1396e465cc3fSChuck Lever __entry->client_id = clnt->cl_clid; 1397e465cc3fSChuck Lever __entry->program = clnt->cl_prog; 1398e465cc3fSChuck Lever __entry->version = clnt->cl_vers; 1399e465cc3fSChuck Lever __entry->protocol = task->tk_xprt->prot; 1400e465cc3fSChuck Lever __entry->bind_version = bind_version; 1401e465cc3fSChuck Lever __assign_str(servername, task->tk_xprt->servername); 1402e465cc3fSChuck Lever ), 1403e465cc3fSChuck Lever 1404b4776a34SChuck Lever TP_printk(SUNRPC_TRACE_TASK_SPECIFIER 1405b4776a34SChuck Lever " server=%s program=%u version=%u protocol=%d bind_version=%u", 1406e465cc3fSChuck Lever __entry->task_id, __entry->client_id, __get_str(servername), 1407e465cc3fSChuck Lever __entry->program, __entry->version, __entry->protocol, 1408e465cc3fSChuck Lever __entry->bind_version 1409e465cc3fSChuck Lever ) 1410e465cc3fSChuck Lever ); 1411c509f15aSChuck Lever 1412ac1ae534SChuck Lever TRACE_EVENT(rpcb_setport, 1413ac1ae534SChuck Lever TP_PROTO( 1414ac1ae534SChuck Lever const struct rpc_task *task, 1415ac1ae534SChuck Lever int status, 1416ac1ae534SChuck Lever unsigned short port 1417ac1ae534SChuck Lever ), 1418ac1ae534SChuck Lever 1419ac1ae534SChuck Lever TP_ARGS(task, status, port), 1420ac1ae534SChuck Lever 1421ac1ae534SChuck Lever TP_STRUCT__entry( 1422ac1ae534SChuck Lever __field(unsigned int, task_id) 1423ac1ae534SChuck Lever __field(unsigned int, client_id) 1424ac1ae534SChuck Lever __field(int, status) 1425ac1ae534SChuck Lever __field(unsigned short, port) 1426ac1ae534SChuck Lever ), 1427ac1ae534SChuck Lever 1428ac1ae534SChuck Lever TP_fast_assign( 1429ac1ae534SChuck Lever __entry->task_id = task->tk_pid; 1430ac1ae534SChuck Lever __entry->client_id = task->tk_client->cl_clid; 1431ac1ae534SChuck Lever __entry->status = status; 1432ac1ae534SChuck Lever __entry->port = port; 1433ac1ae534SChuck Lever ), 1434ac1ae534SChuck Lever 1435b4776a34SChuck Lever TP_printk(SUNRPC_TRACE_TASK_SPECIFIER " status=%d port=%u", 1436ac1ae534SChuck Lever __entry->task_id, __entry->client_id, 1437ac1ae534SChuck Lever __entry->status, __entry->port 1438ac1ae534SChuck Lever ) 1439ac1ae534SChuck Lever ); 1440ac1ae534SChuck Lever 1441c3adcc7dSChuck Lever TRACE_EVENT(pmap_register, 1442c3adcc7dSChuck Lever TP_PROTO( 1443c3adcc7dSChuck Lever u32 program, 1444c3adcc7dSChuck Lever u32 version, 1445c3adcc7dSChuck Lever int protocol, 1446c3adcc7dSChuck Lever unsigned short port 1447c3adcc7dSChuck Lever ), 1448c3adcc7dSChuck Lever 1449c3adcc7dSChuck Lever TP_ARGS(program, version, protocol, port), 1450c3adcc7dSChuck Lever 1451c3adcc7dSChuck Lever TP_STRUCT__entry( 1452c3adcc7dSChuck Lever __field(unsigned int, program) 1453c3adcc7dSChuck Lever __field(unsigned int, version) 1454c3adcc7dSChuck Lever __field(int, protocol) 1455c3adcc7dSChuck Lever __field(unsigned int, port) 1456c3adcc7dSChuck Lever ), 1457c3adcc7dSChuck Lever 1458c3adcc7dSChuck Lever TP_fast_assign( 1459c3adcc7dSChuck Lever __entry->program = program; 1460c3adcc7dSChuck Lever __entry->version = version; 1461c3adcc7dSChuck Lever __entry->protocol = protocol; 1462c3adcc7dSChuck Lever __entry->port = port; 1463c3adcc7dSChuck Lever ), 1464c3adcc7dSChuck Lever 1465c3adcc7dSChuck Lever TP_printk("program=%u version=%u protocol=%d port=%u", 1466c3adcc7dSChuck Lever __entry->program, __entry->version, 1467c3adcc7dSChuck Lever __entry->protocol, __entry->port 1468c3adcc7dSChuck Lever ) 1469c3adcc7dSChuck Lever ); 1470c3adcc7dSChuck Lever 1471c3adcc7dSChuck Lever TRACE_EVENT(rpcb_register, 1472c3adcc7dSChuck Lever TP_PROTO( 1473c3adcc7dSChuck Lever u32 program, 1474c3adcc7dSChuck Lever u32 version, 1475c3adcc7dSChuck Lever const char *addr, 1476c3adcc7dSChuck Lever const char *netid 1477c3adcc7dSChuck Lever ), 1478c3adcc7dSChuck Lever 1479c3adcc7dSChuck Lever TP_ARGS(program, version, addr, netid), 1480c3adcc7dSChuck Lever 1481c3adcc7dSChuck Lever TP_STRUCT__entry( 1482c3adcc7dSChuck Lever __field(unsigned int, program) 1483c3adcc7dSChuck Lever __field(unsigned int, version) 1484c3adcc7dSChuck Lever __string(addr, addr) 1485c3adcc7dSChuck Lever __string(netid, netid) 1486c3adcc7dSChuck Lever ), 1487c3adcc7dSChuck Lever 1488c3adcc7dSChuck Lever TP_fast_assign( 1489c3adcc7dSChuck Lever __entry->program = program; 1490c3adcc7dSChuck Lever __entry->version = version; 1491c3adcc7dSChuck Lever __assign_str(addr, addr); 1492c3adcc7dSChuck Lever __assign_str(netid, netid); 1493c3adcc7dSChuck Lever ), 1494c3adcc7dSChuck Lever 1495c3adcc7dSChuck Lever TP_printk("program=%u version=%u addr=%s netid=%s", 1496c3adcc7dSChuck Lever __entry->program, __entry->version, 1497c3adcc7dSChuck Lever __get_str(addr), __get_str(netid) 1498c3adcc7dSChuck Lever ) 1499c3adcc7dSChuck Lever ); 1500c3adcc7dSChuck Lever 1501c3adcc7dSChuck Lever TRACE_EVENT(rpcb_unregister, 1502c3adcc7dSChuck Lever TP_PROTO( 1503c3adcc7dSChuck Lever u32 program, 1504c3adcc7dSChuck Lever u32 version, 1505c3adcc7dSChuck Lever const char *netid 1506c3adcc7dSChuck Lever ), 1507c3adcc7dSChuck Lever 1508c3adcc7dSChuck Lever TP_ARGS(program, version, netid), 1509c3adcc7dSChuck Lever 1510c3adcc7dSChuck Lever TP_STRUCT__entry( 1511c3adcc7dSChuck Lever __field(unsigned int, program) 1512c3adcc7dSChuck Lever __field(unsigned int, version) 1513c3adcc7dSChuck Lever __string(netid, netid) 1514c3adcc7dSChuck Lever ), 1515c3adcc7dSChuck Lever 1516c3adcc7dSChuck Lever TP_fast_assign( 1517c3adcc7dSChuck Lever __entry->program = program; 1518c3adcc7dSChuck Lever __entry->version = version; 1519c3adcc7dSChuck Lever __assign_str(netid, netid); 1520c3adcc7dSChuck Lever ), 1521c3adcc7dSChuck Lever 1522c3adcc7dSChuck Lever TP_printk("program=%u version=%u netid=%s", 1523c3adcc7dSChuck Lever __entry->program, __entry->version, __get_str(netid) 1524c3adcc7dSChuck Lever ) 1525c3adcc7dSChuck Lever ); 1526c3adcc7dSChuck Lever 152775eb6af7SChuck Lever /** 152875eb6af7SChuck Lever ** RPC-over-TLS tracepoints 152975eb6af7SChuck Lever **/ 153075eb6af7SChuck Lever 153175eb6af7SChuck Lever DECLARE_EVENT_CLASS(rpc_tls_class, 153275eb6af7SChuck Lever TP_PROTO( 153375eb6af7SChuck Lever const struct rpc_clnt *clnt, 153475eb6af7SChuck Lever const struct rpc_xprt *xprt 153575eb6af7SChuck Lever ), 153675eb6af7SChuck Lever 153775eb6af7SChuck Lever TP_ARGS(clnt, xprt), 153875eb6af7SChuck Lever 153975eb6af7SChuck Lever TP_STRUCT__entry( 154075eb6af7SChuck Lever __field(unsigned long, requested_policy) 154175eb6af7SChuck Lever __field(u32, version) 154275eb6af7SChuck Lever __string(servername, xprt->servername) 154375eb6af7SChuck Lever __string(progname, clnt->cl_program->name) 154475eb6af7SChuck Lever ), 154575eb6af7SChuck Lever 154675eb6af7SChuck Lever TP_fast_assign( 154775eb6af7SChuck Lever __entry->requested_policy = clnt->cl_xprtsec.policy; 154875eb6af7SChuck Lever __entry->version = clnt->cl_vers; 154975eb6af7SChuck Lever __assign_str(servername, xprt->servername); 155075eb6af7SChuck Lever __assign_str(progname, clnt->cl_program->name) 155175eb6af7SChuck Lever ), 155275eb6af7SChuck Lever 155375eb6af7SChuck Lever TP_printk("server=%s %sv%u requested_policy=%s", 155475eb6af7SChuck Lever __get_str(servername), __get_str(progname), __entry->version, 155575eb6af7SChuck Lever rpc_show_xprtsec_policy(__entry->requested_policy) 155675eb6af7SChuck Lever ) 155775eb6af7SChuck Lever ); 155875eb6af7SChuck Lever 155975eb6af7SChuck Lever #define DEFINE_RPC_TLS_EVENT(name) \ 156075eb6af7SChuck Lever DEFINE_EVENT(rpc_tls_class, rpc_tls_##name, \ 156175eb6af7SChuck Lever TP_PROTO( \ 156275eb6af7SChuck Lever const struct rpc_clnt *clnt, \ 156375eb6af7SChuck Lever const struct rpc_xprt *xprt \ 156475eb6af7SChuck Lever ), \ 156575eb6af7SChuck Lever TP_ARGS(clnt, xprt)) 156675eb6af7SChuck Lever 156775eb6af7SChuck Lever DEFINE_RPC_TLS_EVENT(unavailable); 156875eb6af7SChuck Lever DEFINE_RPC_TLS_EVENT(not_started); 156975eb6af7SChuck Lever 157075eb6af7SChuck Lever 15715f39d271SChuck Lever /* Record an xdr_buf containing a fully-formed RPC message */ 15725f39d271SChuck Lever DECLARE_EVENT_CLASS(svc_xdr_msg_class, 1573c509f15aSChuck Lever TP_PROTO( 1574c509f15aSChuck Lever const struct xdr_buf *xdr 1575c509f15aSChuck Lever ), 1576c509f15aSChuck Lever 15775f39d271SChuck Lever TP_ARGS(xdr), 1578c509f15aSChuck Lever 1579c509f15aSChuck Lever TP_STRUCT__entry( 1580c509f15aSChuck Lever __field(u32, xid) 1581c509f15aSChuck Lever __field(const void *, head_base) 1582c509f15aSChuck Lever __field(size_t, head_len) 1583c509f15aSChuck Lever __field(const void *, tail_base) 1584c509f15aSChuck Lever __field(size_t, tail_len) 1585c509f15aSChuck Lever __field(unsigned int, page_len) 1586c509f15aSChuck Lever __field(unsigned int, msg_len) 1587c509f15aSChuck Lever ), 1588c509f15aSChuck Lever 1589c509f15aSChuck Lever TP_fast_assign( 15905f39d271SChuck Lever __be32 *p = (__be32 *)xdr->head[0].iov_base; 15915f39d271SChuck Lever 15925f39d271SChuck Lever __entry->xid = be32_to_cpu(*p); 15935f39d271SChuck Lever __entry->head_base = p; 15945f39d271SChuck Lever __entry->head_len = xdr->head[0].iov_len; 15955f39d271SChuck Lever __entry->tail_base = xdr->tail[0].iov_base; 15965f39d271SChuck Lever __entry->tail_len = xdr->tail[0].iov_len; 15975f39d271SChuck Lever __entry->page_len = xdr->page_len; 15985f39d271SChuck Lever __entry->msg_len = xdr->len; 15995f39d271SChuck Lever ), 16005f39d271SChuck Lever 16015f39d271SChuck Lever TP_printk("xid=0x%08x head=[%p,%zu] page=%u tail=[%p,%zu] len=%u", 16025f39d271SChuck Lever __entry->xid, 16035f39d271SChuck Lever __entry->head_base, __entry->head_len, __entry->page_len, 16045f39d271SChuck Lever __entry->tail_base, __entry->tail_len, __entry->msg_len 16055f39d271SChuck Lever ) 16065f39d271SChuck Lever ); 16075f39d271SChuck Lever 16085f39d271SChuck Lever #define DEFINE_SVCXDRMSG_EVENT(name) \ 16095f39d271SChuck Lever DEFINE_EVENT(svc_xdr_msg_class, \ 16105f39d271SChuck Lever svc_xdr_##name, \ 16115f39d271SChuck Lever TP_PROTO( \ 16125f39d271SChuck Lever const struct xdr_buf *xdr \ 16135f39d271SChuck Lever ), \ 16145f39d271SChuck Lever TP_ARGS(xdr)) 16155f39d271SChuck Lever 16165f39d271SChuck Lever DEFINE_SVCXDRMSG_EVENT(recvfrom); 16175f39d271SChuck Lever 16185f39d271SChuck Lever /* Record an xdr_buf containing arbitrary data, tagged with an XID */ 16195f39d271SChuck Lever DECLARE_EVENT_CLASS(svc_xdr_buf_class, 16205f39d271SChuck Lever TP_PROTO( 16215f39d271SChuck Lever __be32 xid, 16225f39d271SChuck Lever const struct xdr_buf *xdr 16235f39d271SChuck Lever ), 16245f39d271SChuck Lever 16255f39d271SChuck Lever TP_ARGS(xid, xdr), 16265f39d271SChuck Lever 16275f39d271SChuck Lever TP_STRUCT__entry( 16285f39d271SChuck Lever __field(u32, xid) 16295f39d271SChuck Lever __field(const void *, head_base) 16305f39d271SChuck Lever __field(size_t, head_len) 16315f39d271SChuck Lever __field(const void *, tail_base) 16325f39d271SChuck Lever __field(size_t, tail_len) 163335940a58SChuck Lever __field(unsigned int, page_base) 16345f39d271SChuck Lever __field(unsigned int, page_len) 16355f39d271SChuck Lever __field(unsigned int, msg_len) 16365f39d271SChuck Lever ), 16375f39d271SChuck Lever 16385f39d271SChuck Lever TP_fast_assign( 16395f39d271SChuck Lever __entry->xid = be32_to_cpu(xid); 1640c509f15aSChuck Lever __entry->head_base = xdr->head[0].iov_base; 1641c509f15aSChuck Lever __entry->head_len = xdr->head[0].iov_len; 1642c509f15aSChuck Lever __entry->tail_base = xdr->tail[0].iov_base; 1643c509f15aSChuck Lever __entry->tail_len = xdr->tail[0].iov_len; 164435940a58SChuck Lever __entry->page_base = xdr->page_base; 1645c509f15aSChuck Lever __entry->page_len = xdr->page_len; 1646c509f15aSChuck Lever __entry->msg_len = xdr->len; 1647c509f15aSChuck Lever ), 1648c509f15aSChuck Lever 164935940a58SChuck Lever TP_printk("xid=0x%08x head=[%p,%zu] page=%u(%u) tail=[%p,%zu] len=%u", 1650c509f15aSChuck Lever __entry->xid, 165135940a58SChuck Lever __entry->head_base, __entry->head_len, 165235940a58SChuck Lever __entry->page_len, __entry->page_base, 165335940a58SChuck Lever __entry->tail_base, __entry->tail_len, 165435940a58SChuck Lever __entry->msg_len 1655c509f15aSChuck Lever ) 1656c509f15aSChuck Lever ); 1657c509f15aSChuck Lever 1658c509f15aSChuck Lever #define DEFINE_SVCXDRBUF_EVENT(name) \ 1659c509f15aSChuck Lever DEFINE_EVENT(svc_xdr_buf_class, \ 1660c509f15aSChuck Lever svc_xdr_##name, \ 1661c509f15aSChuck Lever TP_PROTO( \ 16625f39d271SChuck Lever __be32 xid, \ 1663c509f15aSChuck Lever const struct xdr_buf *xdr \ 1664c509f15aSChuck Lever ), \ 16655f39d271SChuck Lever TP_ARGS(xid, xdr)) 1666c509f15aSChuck Lever 1667c509f15aSChuck Lever DEFINE_SVCXDRBUF_EVENT(sendto); 1668c509f15aSChuck Lever 1669a68d5a50SChuck Lever /* 1670a68d5a50SChuck Lever * from include/linux/sunrpc/svc.h 1671a68d5a50SChuck Lever */ 1672a68d5a50SChuck Lever #define SVC_RQST_FLAG_LIST \ 1673a68d5a50SChuck Lever svc_rqst_flag(SECURE) \ 1674a68d5a50SChuck Lever svc_rqst_flag(LOCAL) \ 1675a68d5a50SChuck Lever svc_rqst_flag(USEDEFERRAL) \ 1676a68d5a50SChuck Lever svc_rqst_flag(DROPME) \ 1677a68d5a50SChuck Lever svc_rqst_flag(SPLICE_OK) \ 1678a68d5a50SChuck Lever svc_rqst_flag(VICTIM) \ 1679a68d5a50SChuck Lever svc_rqst_flag(BUSY) \ 16809082e1d9SChuck Lever svc_rqst_flag_end(DATA) 1681a68d5a50SChuck Lever 1682a68d5a50SChuck Lever #undef svc_rqst_flag 1683a68d5a50SChuck Lever #undef svc_rqst_flag_end 1684a68d5a50SChuck Lever #define svc_rqst_flag(x) TRACE_DEFINE_ENUM(RQ_##x); 1685a68d5a50SChuck Lever #define svc_rqst_flag_end(x) TRACE_DEFINE_ENUM(RQ_##x); 1686a68d5a50SChuck Lever 1687a68d5a50SChuck Lever SVC_RQST_FLAG_LIST 1688a68d5a50SChuck Lever 1689a68d5a50SChuck Lever #undef svc_rqst_flag 1690a68d5a50SChuck Lever #undef svc_rqst_flag_end 1691a68d5a50SChuck Lever #define svc_rqst_flag(x) { BIT(RQ_##x), #x }, 1692a68d5a50SChuck Lever #define svc_rqst_flag_end(x) { BIT(RQ_##x), #x } 1693a68d5a50SChuck Lever 16944d152e2cSJeff Layton #define show_rqstp_flags(flags) \ 1695a68d5a50SChuck Lever __print_flags(flags, "|", SVC_RQST_FLAG_LIST) 16964d152e2cSJeff Layton 1697d88ff958SChuck Lever TRACE_DEFINE_ENUM(SVC_GARBAGE); 1698d88ff958SChuck Lever TRACE_DEFINE_ENUM(SVC_SYSERR); 1699d88ff958SChuck Lever TRACE_DEFINE_ENUM(SVC_VALID); 1700d88ff958SChuck Lever TRACE_DEFINE_ENUM(SVC_NEGATIVE); 1701d88ff958SChuck Lever TRACE_DEFINE_ENUM(SVC_OK); 1702d88ff958SChuck Lever TRACE_DEFINE_ENUM(SVC_DROP); 1703d88ff958SChuck Lever TRACE_DEFINE_ENUM(SVC_CLOSE); 1704d88ff958SChuck Lever TRACE_DEFINE_ENUM(SVC_DENIED); 1705d88ff958SChuck Lever TRACE_DEFINE_ENUM(SVC_PENDING); 1706d88ff958SChuck Lever TRACE_DEFINE_ENUM(SVC_COMPLETE); 1707d88ff958SChuck Lever 170878c542f9SChuck Lever #define show_svc_auth_status(status) \ 1709ff27e9f7SChuck Lever __print_symbolic(status, \ 1710ff27e9f7SChuck Lever { SVC_GARBAGE, "SVC_GARBAGE" }, \ 1711ff27e9f7SChuck Lever { SVC_SYSERR, "SVC_SYSERR" }, \ 1712ff27e9f7SChuck Lever { SVC_VALID, "SVC_VALID" }, \ 1713ff27e9f7SChuck Lever { SVC_NEGATIVE, "SVC_NEGATIVE" }, \ 1714ff27e9f7SChuck Lever { SVC_OK, "SVC_OK" }, \ 1715ff27e9f7SChuck Lever { SVC_DROP, "SVC_DROP" }, \ 1716ff27e9f7SChuck Lever { SVC_CLOSE, "SVC_CLOSE" }, \ 1717ff27e9f7SChuck Lever { SVC_DENIED, "SVC_DENIED" }, \ 1718ff27e9f7SChuck Lever { SVC_PENDING, "SVC_PENDING" }, \ 1719ff27e9f7SChuck Lever { SVC_COMPLETE, "SVC_COMPLETE" }) 1720ff27e9f7SChuck Lever 172170a60cbfSChuck Lever #define SVC_RQST_ENDPOINT_FIELDS(r) \ 172270a60cbfSChuck Lever __sockaddr(server, (r)->rq_xprt->xpt_locallen) \ 172370a60cbfSChuck Lever __sockaddr(client, (r)->rq_xprt->xpt_remotelen) \ 172470a60cbfSChuck Lever __field(unsigned int, netns_ino) \ 172570a60cbfSChuck Lever __field(u32, xid) 172670a60cbfSChuck Lever 172770a60cbfSChuck Lever #define SVC_RQST_ENDPOINT_ASSIGNMENTS(r) \ 172870a60cbfSChuck Lever do { \ 172970a60cbfSChuck Lever struct svc_xprt *xprt = (r)->rq_xprt; \ 173070a60cbfSChuck Lever __assign_sockaddr(server, &xprt->xpt_local, \ 173170a60cbfSChuck Lever xprt->xpt_locallen); \ 173270a60cbfSChuck Lever __assign_sockaddr(client, &xprt->xpt_remote, \ 173370a60cbfSChuck Lever xprt->xpt_remotelen); \ 173470a60cbfSChuck Lever __entry->netns_ino = xprt->xpt_net->ns.inum; \ 173570a60cbfSChuck Lever __entry->xid = be32_to_cpu((r)->rq_xid); \ 173670a60cbfSChuck Lever } while (0) 173770a60cbfSChuck Lever 173870a60cbfSChuck Lever #define SVC_RQST_ENDPOINT_FORMAT \ 173970a60cbfSChuck Lever "xid=0x%08x server=%pISpc client=%pISpc" 174070a60cbfSChuck Lever 174170a60cbfSChuck Lever #define SVC_RQST_ENDPOINT_VARARGS \ 174270a60cbfSChuck Lever __entry->xid, __get_sockaddr(server), __get_sockaddr(client) 174370a60cbfSChuck Lever 1744c65d9df0SChuck Lever TRACE_EVENT_CONDITION(svc_authenticate, 174578c542f9SChuck Lever TP_PROTO( 174678c542f9SChuck Lever const struct svc_rqst *rqst, 174778c542f9SChuck Lever enum svc_auth_status auth_res 174878c542f9SChuck Lever ), 1749ff27e9f7SChuck Lever 1750438623a0SChuck Lever TP_ARGS(rqst, auth_res), 1751ff27e9f7SChuck Lever 1752c65d9df0SChuck Lever TP_CONDITION(auth_res != SVC_OK && auth_res != SVC_COMPLETE), 1753c65d9df0SChuck Lever 1754ff27e9f7SChuck Lever TP_STRUCT__entry( 175570a60cbfSChuck Lever SVC_RQST_ENDPOINT_FIELDS(rqst) 175670a60cbfSChuck Lever 1757ff27e9f7SChuck Lever __field(unsigned long, svc_status) 1758ff27e9f7SChuck Lever __field(unsigned long, auth_stat) 1759ff27e9f7SChuck Lever ), 1760ff27e9f7SChuck Lever 1761ff27e9f7SChuck Lever TP_fast_assign( 176270a60cbfSChuck Lever SVC_RQST_ENDPOINT_ASSIGNMENTS(rqst); 176370a60cbfSChuck Lever 1764ff27e9f7SChuck Lever __entry->svc_status = auth_res; 1765438623a0SChuck Lever __entry->auth_stat = be32_to_cpu(rqst->rq_auth_stat); 1766ff27e9f7SChuck Lever ), 1767ff27e9f7SChuck Lever 176870a60cbfSChuck Lever TP_printk(SVC_RQST_ENDPOINT_FORMAT 176970a60cbfSChuck Lever " auth_res=%s auth_stat=%s", 177070a60cbfSChuck Lever SVC_RQST_ENDPOINT_VARARGS, 177178c542f9SChuck Lever show_svc_auth_status(__entry->svc_status), 1772ff27e9f7SChuck Lever rpc_show_auth_stat(__entry->auth_stat)) 1773ff27e9f7SChuck Lever ); 1774ff27e9f7SChuck Lever 17750b9547bfSChuck Lever TRACE_EVENT(svc_process, 17760b9547bfSChuck Lever TP_PROTO(const struct svc_rqst *rqst, const char *name), 17770b9547bfSChuck Lever 17780b9547bfSChuck Lever TP_ARGS(rqst, name), 17790b9547bfSChuck Lever 17800b9547bfSChuck Lever TP_STRUCT__entry( 17810b9547bfSChuck Lever __field(u32, xid) 17820b9547bfSChuck Lever __field(u32, vers) 17830b9547bfSChuck Lever __field(u32, proc) 17840b9547bfSChuck Lever __string(service, name) 17855c117207SChuck Lever __string(procedure, svc_proc_name(rqst)) 1786d4b09acfSVasily Averin __string(addr, rqst->rq_xprt ? 1787d4b09acfSVasily Averin rqst->rq_xprt->xpt_remotebuf : "(null)") 17880b9547bfSChuck Lever ), 17890b9547bfSChuck Lever 17900b9547bfSChuck Lever TP_fast_assign( 17910b9547bfSChuck Lever __entry->xid = be32_to_cpu(rqst->rq_xid); 17920b9547bfSChuck Lever __entry->vers = rqst->rq_vers; 17930b9547bfSChuck Lever __entry->proc = rqst->rq_proc; 17940b9547bfSChuck Lever __assign_str(service, name); 17955c117207SChuck Lever __assign_str(procedure, svc_proc_name(rqst)); 1796d4b09acfSVasily Averin __assign_str(addr, rqst->rq_xprt ? 1797d4b09acfSVasily Averin rqst->rq_xprt->xpt_remotebuf : "(null)"); 17980b9547bfSChuck Lever ), 17990b9547bfSChuck Lever 180089ff8749SChuck Lever TP_printk("addr=%s xid=0x%08x service=%s vers=%u proc=%s", 18010b9547bfSChuck Lever __get_str(addr), __entry->xid, 180289ff8749SChuck Lever __get_str(service), __entry->vers, 180389ff8749SChuck Lever __get_str(procedure) 180489ff8749SChuck Lever ) 18050b9547bfSChuck Lever ); 18060b9547bfSChuck Lever 1807104f6351STrond Myklebust DECLARE_EVENT_CLASS(svc_rqst_event, 1808dc5820bdSChuck Lever TP_PROTO( 1809dc5820bdSChuck Lever const struct svc_rqst *rqst 1810dc5820bdSChuck Lever ), 1811104f6351STrond Myklebust 1812104f6351STrond Myklebust TP_ARGS(rqst), 1813104f6351STrond Myklebust 1814104f6351STrond Myklebust TP_STRUCT__entry( 181570a60cbfSChuck Lever SVC_RQST_ENDPOINT_FIELDS(rqst) 181670a60cbfSChuck Lever 1817104f6351STrond Myklebust __field(unsigned long, flags) 1818104f6351STrond Myklebust ), 1819104f6351STrond Myklebust 1820104f6351STrond Myklebust TP_fast_assign( 182170a60cbfSChuck Lever SVC_RQST_ENDPOINT_ASSIGNMENTS(rqst); 182270a60cbfSChuck Lever 1823104f6351STrond Myklebust __entry->flags = rqst->rq_flags; 1824104f6351STrond Myklebust ), 1825104f6351STrond Myklebust 182670a60cbfSChuck Lever TP_printk(SVC_RQST_ENDPOINT_FORMAT " flags=%s", 182770a60cbfSChuck Lever SVC_RQST_ENDPOINT_VARARGS, 1828104f6351STrond Myklebust show_rqstp_flags(__entry->flags)) 1829104f6351STrond Myklebust ); 1830dc5820bdSChuck Lever #define DEFINE_SVC_RQST_EVENT(name) \ 1831dc5820bdSChuck Lever DEFINE_EVENT(svc_rqst_event, svc_##name, \ 1832dc5820bdSChuck Lever TP_PROTO( \ 1833dc5820bdSChuck Lever const struct svc_rqst *rqst \ 1834dc5820bdSChuck Lever ), \ 1835dc5820bdSChuck Lever TP_ARGS(rqst)) 1836104f6351STrond Myklebust 1837dc5820bdSChuck Lever DEFINE_SVC_RQST_EVENT(defer); 1838dc5820bdSChuck Lever DEFINE_SVC_RQST_EVENT(drop); 1839104f6351STrond Myklebust 1840860a0d9eSJeff Layton DECLARE_EVENT_CLASS(svc_rqst_status, 184170a60cbfSChuck Lever TP_PROTO( 184270a60cbfSChuck Lever const struct svc_rqst *rqst, 184370a60cbfSChuck Lever int status 184470a60cbfSChuck Lever ), 1845860a0d9eSJeff Layton 1846860a0d9eSJeff Layton TP_ARGS(rqst, status), 1847860a0d9eSJeff Layton 1848860a0d9eSJeff Layton TP_STRUCT__entry( 184970a60cbfSChuck Lever SVC_RQST_ENDPOINT_FIELDS(rqst) 185070a60cbfSChuck Lever 1851860a0d9eSJeff Layton __field(int, status) 18524d152e2cSJeff Layton __field(unsigned long, flags) 1853860a0d9eSJeff Layton ), 1854860a0d9eSJeff Layton 1855860a0d9eSJeff Layton TP_fast_assign( 185670a60cbfSChuck Lever SVC_RQST_ENDPOINT_ASSIGNMENTS(rqst); 185770a60cbfSChuck Lever 1858860a0d9eSJeff Layton __entry->status = status; 18594d152e2cSJeff Layton __entry->flags = rqst->rq_flags; 1860860a0d9eSJeff Layton ), 1861860a0d9eSJeff Layton 186270a60cbfSChuck Lever TP_printk(SVC_RQST_ENDPOINT_FORMAT " status=%d flags=%s", 186370a60cbfSChuck Lever SVC_RQST_ENDPOINT_VARARGS, 18644d152e2cSJeff Layton __entry->status, show_rqstp_flags(__entry->flags)) 1865860a0d9eSJeff Layton ); 1866860a0d9eSJeff Layton 1867860a0d9eSJeff Layton DEFINE_EVENT(svc_rqst_status, svc_send, 186870a60cbfSChuck Lever TP_PROTO(const struct svc_rqst *rqst, int status), 1869860a0d9eSJeff Layton TP_ARGS(rqst, status)); 1870860a0d9eSJeff Layton 18710f516248SChuck Lever TRACE_EVENT(svc_replace_page_err, 18720f516248SChuck Lever TP_PROTO(const struct svc_rqst *rqst), 18730f516248SChuck Lever 18740f516248SChuck Lever TP_ARGS(rqst), 18750f516248SChuck Lever TP_STRUCT__entry( 18760f516248SChuck Lever SVC_RQST_ENDPOINT_FIELDS(rqst) 18770f516248SChuck Lever 18780f516248SChuck Lever __field(const void *, begin) 18790f516248SChuck Lever __field(const void *, respages) 18800f516248SChuck Lever __field(const void *, nextpage) 18810f516248SChuck Lever ), 18820f516248SChuck Lever 18830f516248SChuck Lever TP_fast_assign( 18840f516248SChuck Lever SVC_RQST_ENDPOINT_ASSIGNMENTS(rqst); 18850f516248SChuck Lever 18860f516248SChuck Lever __entry->begin = rqst->rq_pages; 18870f516248SChuck Lever __entry->respages = rqst->rq_respages; 18880f516248SChuck Lever __entry->nextpage = rqst->rq_next_page; 18890f516248SChuck Lever ), 18900f516248SChuck Lever 18910f516248SChuck Lever TP_printk(SVC_RQST_ENDPOINT_FORMAT " begin=%p respages=%p nextpage=%p", 18920f516248SChuck Lever SVC_RQST_ENDPOINT_VARARGS, 18930f516248SChuck Lever __entry->begin, __entry->respages, __entry->nextpage) 18940f516248SChuck Lever ); 18950f516248SChuck Lever 189670a60cbfSChuck Lever TRACE_EVENT(svc_stats_latency, 189770a60cbfSChuck Lever TP_PROTO( 189870a60cbfSChuck Lever const struct svc_rqst *rqst 189970a60cbfSChuck Lever ), 190070a60cbfSChuck Lever 190170a60cbfSChuck Lever TP_ARGS(rqst), 190270a60cbfSChuck Lever 190370a60cbfSChuck Lever TP_STRUCT__entry( 190470a60cbfSChuck Lever SVC_RQST_ENDPOINT_FIELDS(rqst) 190570a60cbfSChuck Lever 190670a60cbfSChuck Lever __field(unsigned long, execute) 190770a60cbfSChuck Lever __string(procedure, svc_proc_name(rqst)) 190870a60cbfSChuck Lever ), 190970a60cbfSChuck Lever 191070a60cbfSChuck Lever TP_fast_assign( 191170a60cbfSChuck Lever SVC_RQST_ENDPOINT_ASSIGNMENTS(rqst); 191270a60cbfSChuck Lever 191370a60cbfSChuck Lever __entry->execute = ktime_to_us(ktime_sub(ktime_get(), 191470a60cbfSChuck Lever rqst->rq_stime)); 191570a60cbfSChuck Lever __assign_str(procedure, svc_proc_name(rqst)); 191670a60cbfSChuck Lever ), 191770a60cbfSChuck Lever 191870a60cbfSChuck Lever TP_printk(SVC_RQST_ENDPOINT_FORMAT " proc=%s execute-us=%lu", 191970a60cbfSChuck Lever SVC_RQST_ENDPOINT_VARARGS, 192070a60cbfSChuck Lever __get_str(procedure), __entry->execute) 192170a60cbfSChuck Lever ); 192270a60cbfSChuck Lever 1923d75e490fSChuck Lever /* 1924d75e490fSChuck Lever * from include/linux/sunrpc/svc_xprt.h 1925d75e490fSChuck Lever */ 1926d75e490fSChuck Lever #define SVC_XPRT_FLAG_LIST \ 1927d75e490fSChuck Lever svc_xprt_flag(BUSY) \ 1928d75e490fSChuck Lever svc_xprt_flag(CONN) \ 1929d75e490fSChuck Lever svc_xprt_flag(CLOSE) \ 1930d75e490fSChuck Lever svc_xprt_flag(DATA) \ 1931d75e490fSChuck Lever svc_xprt_flag(TEMP) \ 1932d75e490fSChuck Lever svc_xprt_flag(DEAD) \ 1933d75e490fSChuck Lever svc_xprt_flag(CHNGBUF) \ 1934d75e490fSChuck Lever svc_xprt_flag(DEFERRED) \ 1935d75e490fSChuck Lever svc_xprt_flag(OLD) \ 1936d75e490fSChuck Lever svc_xprt_flag(LISTENER) \ 1937d75e490fSChuck Lever svc_xprt_flag(CACHE_AUTH) \ 1938d75e490fSChuck Lever svc_xprt_flag(LOCAL) \ 1939d75e490fSChuck Lever svc_xprt_flag(KILL_TEMP) \ 1940d75e490fSChuck Lever svc_xprt_flag(CONG_CTRL) \ 1941d75e490fSChuck Lever svc_xprt_flag(HANDSHAKE) \ 1942d75e490fSChuck Lever svc_xprt_flag(TLS_SESSION) \ 1943d75e490fSChuck Lever svc_xprt_flag_end(PEER_AUTH) 1944d75e490fSChuck Lever 1945d75e490fSChuck Lever #undef svc_xprt_flag 1946d75e490fSChuck Lever #undef svc_xprt_flag_end 1947d75e490fSChuck Lever #define svc_xprt_flag(x) TRACE_DEFINE_ENUM(XPT_##x); 1948d75e490fSChuck Lever #define svc_xprt_flag_end(x) TRACE_DEFINE_ENUM(XPT_##x); 1949d75e490fSChuck Lever 1950d75e490fSChuck Lever SVC_XPRT_FLAG_LIST 1951d75e490fSChuck Lever 1952d75e490fSChuck Lever #undef svc_xprt_flag 1953d75e490fSChuck Lever #undef svc_xprt_flag_end 1954d75e490fSChuck Lever #define svc_xprt_flag(x) { BIT(XPT_##x), #x }, 1955d75e490fSChuck Lever #define svc_xprt_flag_end(x) { BIT(XPT_##x), #x } 1956d75e490fSChuck Lever 195783a712e0SJeff Layton #define show_svc_xprt_flags(flags) \ 1958d75e490fSChuck Lever __print_flags(flags, "|", SVC_XPRT_FLAG_LIST) 195983a712e0SJeff Layton 19604b8f380eSChuck Lever TRACE_EVENT(svc_xprt_create_err, 19614b8f380eSChuck Lever TP_PROTO( 19624b8f380eSChuck Lever const char *program, 19634b8f380eSChuck Lever const char *protocol, 19644b8f380eSChuck Lever struct sockaddr *sap, 1965dc6c6fb3SChuck Lever size_t salen, 19664b8f380eSChuck Lever const struct svc_xprt *xprt 19674b8f380eSChuck Lever ), 19684b8f380eSChuck Lever 1969dc6c6fb3SChuck Lever TP_ARGS(program, protocol, sap, salen, xprt), 19704b8f380eSChuck Lever 19714b8f380eSChuck Lever TP_STRUCT__entry( 19724b8f380eSChuck Lever __field(long, error) 19734b8f380eSChuck Lever __string(program, program) 19744b8f380eSChuck Lever __string(protocol, protocol) 197526ce14e7SChuck Lever __sockaddr(addr, salen) 19764b8f380eSChuck Lever ), 19774b8f380eSChuck Lever 19784b8f380eSChuck Lever TP_fast_assign( 19794b8f380eSChuck Lever __entry->error = PTR_ERR(xprt); 19804b8f380eSChuck Lever __assign_str(program, program); 19814b8f380eSChuck Lever __assign_str(protocol, protocol); 198226ce14e7SChuck Lever __assign_sockaddr(addr, sap, salen); 19834b8f380eSChuck Lever ), 19844b8f380eSChuck Lever 19854b8f380eSChuck Lever TP_printk("addr=%pISpc program=%s protocol=%s error=%ld", 198626ce14e7SChuck Lever __get_sockaddr(addr), __get_str(program), __get_str(protocol), 19874b8f380eSChuck Lever __entry->error) 19884b8f380eSChuck Lever ); 19894b8f380eSChuck Lever 1990aca3ed79SChuck Lever #define SVC_XPRT_ENDPOINT_FIELDS(x) \ 1991aca3ed79SChuck Lever __sockaddr(server, (x)->xpt_locallen) \ 1992aca3ed79SChuck Lever __sockaddr(client, (x)->xpt_remotelen) \ 1993aca3ed79SChuck Lever __field(unsigned long, flags) \ 1994aca3ed79SChuck Lever __field(unsigned int, netns_ino) 1995aca3ed79SChuck Lever 1996aca3ed79SChuck Lever #define SVC_XPRT_ENDPOINT_ASSIGNMENTS(x) \ 1997aca3ed79SChuck Lever do { \ 1998aca3ed79SChuck Lever __assign_sockaddr(server, &(x)->xpt_local, \ 1999aca3ed79SChuck Lever (x)->xpt_locallen); \ 2000aca3ed79SChuck Lever __assign_sockaddr(client, &(x)->xpt_remote, \ 2001aca3ed79SChuck Lever (x)->xpt_remotelen); \ 2002aca3ed79SChuck Lever __entry->flags = (x)->xpt_flags; \ 2003aca3ed79SChuck Lever __entry->netns_ino = (x)->xpt_net->ns.inum; \ 2004aca3ed79SChuck Lever } while (0) 2005aca3ed79SChuck Lever 2006aca3ed79SChuck Lever #define SVC_XPRT_ENDPOINT_FORMAT \ 2007aca3ed79SChuck Lever "server=%pISpc client=%pISpc flags=%s" 2008aca3ed79SChuck Lever 2009aca3ed79SChuck Lever #define SVC_XPRT_ENDPOINT_VARARGS \ 2010aca3ed79SChuck Lever __get_sockaddr(server), __get_sockaddr(client), \ 2011aca3ed79SChuck Lever show_svc_xprt_flags(__entry->flags) 2012aca3ed79SChuck Lever 20135089f3d9SChuck Lever TRACE_EVENT(svc_xprt_enqueue, 2014aca3ed79SChuck Lever TP_PROTO( 2015aca3ed79SChuck Lever const struct svc_xprt *xprt, 201682e5d82aSChuck Lever unsigned long flags 2017aca3ed79SChuck Lever ), 201883a712e0SJeff Layton 201982e5d82aSChuck Lever TP_ARGS(xprt, flags), 202083a712e0SJeff Layton 202183a712e0SJeff Layton TP_STRUCT__entry( 2022aca3ed79SChuck Lever SVC_XPRT_ENDPOINT_FIELDS(xprt) 202383a712e0SJeff Layton ), 202483a712e0SJeff Layton 202583a712e0SJeff Layton TP_fast_assign( 202682e5d82aSChuck Lever __assign_sockaddr(server, &xprt->xpt_local, 202782e5d82aSChuck Lever xprt->xpt_locallen); 202882e5d82aSChuck Lever __assign_sockaddr(client, &xprt->xpt_remote, 202982e5d82aSChuck Lever xprt->xpt_remotelen); 203082e5d82aSChuck Lever __entry->flags = flags; 203182e5d82aSChuck Lever __entry->netns_ino = xprt->xpt_net->ns.inum; 203283a712e0SJeff Layton ), 203383a712e0SJeff Layton 203482e5d82aSChuck Lever TP_printk(SVC_XPRT_ENDPOINT_FORMAT, SVC_XPRT_ENDPOINT_VARARGS) 2035aca3ed79SChuck Lever ); 2036aca3ed79SChuck Lever 2037aca3ed79SChuck Lever TRACE_EVENT(svc_xprt_dequeue, 2038aca3ed79SChuck Lever TP_PROTO( 2039aca3ed79SChuck Lever const struct svc_rqst *rqst 2040aca3ed79SChuck Lever ), 2041aca3ed79SChuck Lever 2042aca3ed79SChuck Lever TP_ARGS(rqst), 2043aca3ed79SChuck Lever 2044aca3ed79SChuck Lever TP_STRUCT__entry( 2045aca3ed79SChuck Lever SVC_XPRT_ENDPOINT_FIELDS(rqst->rq_xprt) 2046aca3ed79SChuck Lever 2047aca3ed79SChuck Lever __field(unsigned long, wakeup) 2048aca3ed79SChuck Lever ), 2049aca3ed79SChuck Lever 2050aca3ed79SChuck Lever TP_fast_assign( 2051aca3ed79SChuck Lever SVC_XPRT_ENDPOINT_ASSIGNMENTS(rqst->rq_xprt); 2052aca3ed79SChuck Lever 2053aca3ed79SChuck Lever __entry->wakeup = ktime_to_us(ktime_sub(ktime_get(), 2054aca3ed79SChuck Lever rqst->rq_qtime)); 2055aca3ed79SChuck Lever ), 2056aca3ed79SChuck Lever 2057aca3ed79SChuck Lever TP_printk(SVC_XPRT_ENDPOINT_FORMAT " wakeup-us=%lu", 2058aca3ed79SChuck Lever SVC_XPRT_ENDPOINT_VARARGS, __entry->wakeup) 205983a712e0SJeff Layton ); 206083a712e0SJeff Layton 206182ea2d76STrond Myklebust DECLARE_EVENT_CLASS(svc_xprt_event, 2062aca3ed79SChuck Lever TP_PROTO( 2063aca3ed79SChuck Lever const struct svc_xprt *xprt 2064aca3ed79SChuck Lever ), 206583a712e0SJeff Layton 206683a712e0SJeff Layton TP_ARGS(xprt), 206783a712e0SJeff Layton 206883a712e0SJeff Layton TP_STRUCT__entry( 2069aca3ed79SChuck Lever SVC_XPRT_ENDPOINT_FIELDS(xprt) 207083a712e0SJeff Layton ), 207183a712e0SJeff Layton 207283a712e0SJeff Layton TP_fast_assign( 2073aca3ed79SChuck Lever SVC_XPRT_ENDPOINT_ASSIGNMENTS(xprt); 207483a712e0SJeff Layton ), 207583a712e0SJeff Layton 2076aca3ed79SChuck Lever TP_printk(SVC_XPRT_ENDPOINT_FORMAT, SVC_XPRT_ENDPOINT_VARARGS) 207783a712e0SJeff Layton ); 207883a712e0SJeff Layton 207911bbb0f7SChuck Lever #define DEFINE_SVC_XPRT_EVENT(name) \ 208011bbb0f7SChuck Lever DEFINE_EVENT(svc_xprt_event, svc_xprt_##name, \ 208111bbb0f7SChuck Lever TP_PROTO( \ 2082aca3ed79SChuck Lever const struct svc_xprt *xprt \ 208311bbb0f7SChuck Lever ), \ 208411bbb0f7SChuck Lever TP_ARGS(xprt)) 208511bbb0f7SChuck Lever 208611bbb0f7SChuck Lever DEFINE_SVC_XPRT_EVENT(no_write_space); 208711bbb0f7SChuck Lever DEFINE_SVC_XPRT_EVENT(close); 208811bbb0f7SChuck Lever DEFINE_SVC_XPRT_EVENT(detach); 208911bbb0f7SChuck Lever DEFINE_SVC_XPRT_EVENT(free); 209011bbb0f7SChuck Lever 2091b3cbf98eSChuck Lever #define DEFINE_SVC_TLS_EVENT(name) \ 2092b3cbf98eSChuck Lever DEFINE_EVENT(svc_xprt_event, svc_tls_##name, \ 2093b3cbf98eSChuck Lever TP_PROTO(const struct svc_xprt *xprt), \ 2094b3cbf98eSChuck Lever TP_ARGS(xprt)) 2095b3cbf98eSChuck Lever 2096b3cbf98eSChuck Lever DEFINE_SVC_TLS_EVENT(start); 2097b3cbf98eSChuck Lever DEFINE_SVC_TLS_EVENT(upcall); 2098b3cbf98eSChuck Lever DEFINE_SVC_TLS_EVENT(unavailable); 2099b3cbf98eSChuck Lever DEFINE_SVC_TLS_EVENT(not_started); 2100b3cbf98eSChuck Lever DEFINE_SVC_TLS_EVENT(timed_out); 2101b3cbf98eSChuck Lever 210211bbb0f7SChuck Lever TRACE_EVENT(svc_xprt_accept, 210311bbb0f7SChuck Lever TP_PROTO( 210411bbb0f7SChuck Lever const struct svc_xprt *xprt, 210511bbb0f7SChuck Lever const char *service 210611bbb0f7SChuck Lever ), 210711bbb0f7SChuck Lever 210811bbb0f7SChuck Lever TP_ARGS(xprt, service), 210911bbb0f7SChuck Lever 211011bbb0f7SChuck Lever TP_STRUCT__entry( 2111aca3ed79SChuck Lever SVC_XPRT_ENDPOINT_FIELDS(xprt) 2112aca3ed79SChuck Lever 211311bbb0f7SChuck Lever __string(protocol, xprt->xpt_class->xcl_name) 211411bbb0f7SChuck Lever __string(service, service) 211511bbb0f7SChuck Lever ), 211611bbb0f7SChuck Lever 211711bbb0f7SChuck Lever TP_fast_assign( 2118aca3ed79SChuck Lever SVC_XPRT_ENDPOINT_ASSIGNMENTS(xprt); 2119aca3ed79SChuck Lever 212078c14b38SJoe Perches __assign_str(protocol, xprt->xpt_class->xcl_name); 212111bbb0f7SChuck Lever __assign_str(service, service); 212211bbb0f7SChuck Lever ), 212311bbb0f7SChuck Lever 2124aca3ed79SChuck Lever TP_printk(SVC_XPRT_ENDPOINT_FORMAT " protocol=%s service=%s", 2125aca3ed79SChuck Lever SVC_XPRT_ENDPOINT_VARARGS, 2126aca3ed79SChuck Lever __get_str(protocol), __get_str(service) 212711bbb0f7SChuck Lever ) 212811bbb0f7SChuck Lever ); 212982ea2d76STrond Myklebust 213083a712e0SJeff Layton TRACE_EVENT(svc_wake_up, 213183a712e0SJeff Layton TP_PROTO(int pid), 213283a712e0SJeff Layton 213383a712e0SJeff Layton TP_ARGS(pid), 213483a712e0SJeff Layton 213583a712e0SJeff Layton TP_STRUCT__entry( 213683a712e0SJeff Layton __field(int, pid) 213783a712e0SJeff Layton ), 213883a712e0SJeff Layton 213983a712e0SJeff Layton TP_fast_assign( 214083a712e0SJeff Layton __entry->pid = pid; 214183a712e0SJeff Layton ), 214283a712e0SJeff Layton 214383a712e0SJeff Layton TP_printk("pid=%d", __entry->pid) 214483a712e0SJeff Layton ); 214583a712e0SJeff Layton 214622a027e8SChuck Lever TRACE_EVENT(svc_alloc_arg_err, 214722a027e8SChuck Lever TP_PROTO( 214828fffa6cSChuck Lever unsigned int requested, 214928fffa6cSChuck Lever unsigned int allocated 215022a027e8SChuck Lever ), 215122a027e8SChuck Lever 215228fffa6cSChuck Lever TP_ARGS(requested, allocated), 215322a027e8SChuck Lever 215422a027e8SChuck Lever TP_STRUCT__entry( 215528fffa6cSChuck Lever __field(unsigned int, requested) 215628fffa6cSChuck Lever __field(unsigned int, allocated) 215722a027e8SChuck Lever ), 215822a027e8SChuck Lever 215922a027e8SChuck Lever TP_fast_assign( 216028fffa6cSChuck Lever __entry->requested = requested; 216128fffa6cSChuck Lever __entry->allocated = allocated; 216222a027e8SChuck Lever ), 216322a027e8SChuck Lever 216428fffa6cSChuck Lever TP_printk("requested=%u allocated=%u", 216528fffa6cSChuck Lever __entry->requested, __entry->allocated) 216622a027e8SChuck Lever ); 216722a027e8SChuck Lever 2168104f6351STrond Myklebust DECLARE_EVENT_CLASS(svc_deferred_event, 2169dc5820bdSChuck Lever TP_PROTO( 2170dc5820bdSChuck Lever const struct svc_deferred_req *dr 2171dc5820bdSChuck Lever ), 2172104f6351STrond Myklebust 2173104f6351STrond Myklebust TP_ARGS(dr), 2174104f6351STrond Myklebust 2175104f6351STrond Myklebust TP_STRUCT__entry( 21768954c5c2SChuck Lever __field(const void *, dr) 2177a30ccf1aSChuck Lever __field(u32, xid) 217845cb7955SChuck Lever __sockaddr(addr, dr->addrlen) 2179104f6351STrond Myklebust ), 2180104f6351STrond Myklebust 2181104f6351STrond Myklebust TP_fast_assign( 21828954c5c2SChuck Lever __entry->dr = dr; 2183983084b2SChuck Lever __entry->xid = be32_to_cpu(*(__be32 *)dr->args); 218445cb7955SChuck Lever __assign_sockaddr(addr, &dr->addr, dr->addrlen); 2185104f6351STrond Myklebust ), 2186104f6351STrond Myklebust 218745cb7955SChuck Lever TP_printk("addr=%pISpc dr=%p xid=0x%08x", __get_sockaddr(addr), 218845cb7955SChuck Lever __entry->dr, __entry->xid) 2189104f6351STrond Myklebust ); 21908954c5c2SChuck Lever 2191dc5820bdSChuck Lever #define DEFINE_SVC_DEFERRED_EVENT(name) \ 21928954c5c2SChuck Lever DEFINE_EVENT(svc_deferred_event, svc_defer_##name, \ 2193dc5820bdSChuck Lever TP_PROTO( \ 2194dc5820bdSChuck Lever const struct svc_deferred_req *dr \ 2195dc5820bdSChuck Lever ), \ 2196dc5820bdSChuck Lever TP_ARGS(dr)) 2197104f6351STrond Myklebust 2198dc5820bdSChuck Lever DEFINE_SVC_DEFERRED_EVENT(drop); 21998954c5c2SChuck Lever DEFINE_SVC_DEFERRED_EVENT(queue); 22008954c5c2SChuck Lever DEFINE_SVC_DEFERRED_EVENT(recv); 2201dc5820bdSChuck Lever 2202c42bebcaSChuck Lever DECLARE_EVENT_CLASS(svcsock_lifetime_class, 2203998024deSChuck Lever TP_PROTO( 2204c42bebcaSChuck Lever const void *svsk, 2205998024deSChuck Lever const struct socket *socket 2206998024deSChuck Lever ), 2207c42bebcaSChuck Lever TP_ARGS(svsk, socket), 2208998024deSChuck Lever TP_STRUCT__entry( 2209c42bebcaSChuck Lever __field(unsigned int, netns_ino) 2210c42bebcaSChuck Lever __field(const void *, svsk) 2211c42bebcaSChuck Lever __field(const void *, sk) 2212998024deSChuck Lever __field(unsigned long, type) 2213998024deSChuck Lever __field(unsigned long, family) 2214c42bebcaSChuck Lever __field(unsigned long, state) 2215998024deSChuck Lever ), 2216998024deSChuck Lever TP_fast_assign( 2217c42bebcaSChuck Lever struct sock *sk = socket->sk; 2218998024deSChuck Lever 2219c42bebcaSChuck Lever __entry->netns_ino = sock_net(sk)->ns.inum; 2220c42bebcaSChuck Lever __entry->svsk = svsk; 2221c42bebcaSChuck Lever __entry->sk = sk; 2222c42bebcaSChuck Lever __entry->type = socket->type; 2223c42bebcaSChuck Lever __entry->family = sk->sk_family; 2224c42bebcaSChuck Lever __entry->state = sk->sk_state; 2225c42bebcaSChuck Lever ), 2226c42bebcaSChuck Lever TP_printk("svsk=%p type=%s family=%s%s", 2227c42bebcaSChuck Lever __entry->svsk, show_socket_type(__entry->type), 2228998024deSChuck Lever rpc_show_address_family(__entry->family), 2229c42bebcaSChuck Lever __entry->state == TCP_LISTEN ? " (listener)" : "" 2230998024deSChuck Lever ) 2231998024deSChuck Lever ); 2232c42bebcaSChuck Lever #define DEFINE_SVCSOCK_LIFETIME_EVENT(name) \ 2233c42bebcaSChuck Lever DEFINE_EVENT(svcsock_lifetime_class, name, \ 2234c42bebcaSChuck Lever TP_PROTO( \ 2235c42bebcaSChuck Lever const void *svsk, \ 2236c42bebcaSChuck Lever const struct socket *socket \ 2237c42bebcaSChuck Lever ), \ 2238c42bebcaSChuck Lever TP_ARGS(svsk, socket)) 2239c42bebcaSChuck Lever 2240c42bebcaSChuck Lever DEFINE_SVCSOCK_LIFETIME_EVENT(svcsock_new); 2241c42bebcaSChuck Lever DEFINE_SVCSOCK_LIFETIME_EVENT(svcsock_free); 2242998024deSChuck Lever 2243a5cda73eSChuck Lever TRACE_EVENT(svcsock_marker, 2244a5cda73eSChuck Lever TP_PROTO( 2245a5cda73eSChuck Lever const struct svc_xprt *xprt, 2246a5cda73eSChuck Lever __be32 marker 2247a5cda73eSChuck Lever ), 2248a5cda73eSChuck Lever 2249a5cda73eSChuck Lever TP_ARGS(xprt, marker), 2250a5cda73eSChuck Lever 2251a5cda73eSChuck Lever TP_STRUCT__entry( 2252a5cda73eSChuck Lever __field(unsigned int, length) 2253a5cda73eSChuck Lever __field(bool, last) 2254a5cda73eSChuck Lever __string(addr, xprt->xpt_remotebuf) 2255a5cda73eSChuck Lever ), 2256a5cda73eSChuck Lever 2257a5cda73eSChuck Lever TP_fast_assign( 2258a5cda73eSChuck Lever __entry->length = be32_to_cpu(marker) & RPC_FRAGMENT_SIZE_MASK; 2259a5cda73eSChuck Lever __entry->last = be32_to_cpu(marker) & RPC_LAST_STREAM_FRAGMENT; 2260a5cda73eSChuck Lever __assign_str(addr, xprt->xpt_remotebuf); 2261a5cda73eSChuck Lever ), 2262a5cda73eSChuck Lever 2263a5cda73eSChuck Lever TP_printk("addr=%s length=%u%s", __get_str(addr), 2264a5cda73eSChuck Lever __entry->length, __entry->last ? " (last)" : "") 2265a5cda73eSChuck Lever ); 2266a5cda73eSChuck Lever 2267998024deSChuck Lever DECLARE_EVENT_CLASS(svcsock_class, 2268998024deSChuck Lever TP_PROTO( 2269998024deSChuck Lever const struct svc_xprt *xprt, 2270998024deSChuck Lever ssize_t result 2271998024deSChuck Lever ), 2272998024deSChuck Lever 2273998024deSChuck Lever TP_ARGS(xprt, result), 2274998024deSChuck Lever 2275998024deSChuck Lever TP_STRUCT__entry( 2276998024deSChuck Lever __field(ssize_t, result) 2277998024deSChuck Lever __field(unsigned long, flags) 2278998024deSChuck Lever __string(addr, xprt->xpt_remotebuf) 2279998024deSChuck Lever ), 2280998024deSChuck Lever 2281998024deSChuck Lever TP_fast_assign( 2282998024deSChuck Lever __entry->result = result; 2283998024deSChuck Lever __entry->flags = xprt->xpt_flags; 2284998024deSChuck Lever __assign_str(addr, xprt->xpt_remotebuf); 2285998024deSChuck Lever ), 2286998024deSChuck Lever 2287998024deSChuck Lever TP_printk("addr=%s result=%zd flags=%s", __get_str(addr), 2288998024deSChuck Lever __entry->result, show_svc_xprt_flags(__entry->flags) 2289998024deSChuck Lever ) 2290998024deSChuck Lever ); 2291998024deSChuck Lever 2292998024deSChuck Lever #define DEFINE_SVCSOCK_EVENT(name) \ 2293998024deSChuck Lever DEFINE_EVENT(svcsock_class, svcsock_##name, \ 2294998024deSChuck Lever TP_PROTO( \ 2295998024deSChuck Lever const struct svc_xprt *xprt, \ 2296998024deSChuck Lever ssize_t result \ 2297998024deSChuck Lever ), \ 2298998024deSChuck Lever TP_ARGS(xprt, result)) 2299998024deSChuck Lever 2300998024deSChuck Lever DEFINE_SVCSOCK_EVENT(udp_send); 2301fff1ebb2SChuck Lever DEFINE_SVCSOCK_EVENT(udp_recv); 2302fff1ebb2SChuck Lever DEFINE_SVCSOCK_EVENT(udp_recv_err); 2303998024deSChuck Lever DEFINE_SVCSOCK_EVENT(tcp_send); 23047dae1dd7SChuck Lever DEFINE_SVCSOCK_EVENT(tcp_recv); 23056be8c594SChuck Lever DEFINE_SVCSOCK_EVENT(tcp_recv_eagain); 23066be8c594SChuck Lever DEFINE_SVCSOCK_EVENT(tcp_recv_err); 2307998024deSChuck Lever DEFINE_SVCSOCK_EVENT(data_ready); 2308998024deSChuck Lever DEFINE_SVCSOCK_EVENT(write_space); 2309998024deSChuck Lever 23106be8c594SChuck Lever TRACE_EVENT(svcsock_tcp_recv_short, 23116be8c594SChuck Lever TP_PROTO( 23126be8c594SChuck Lever const struct svc_xprt *xprt, 23136be8c594SChuck Lever u32 expected, 23146be8c594SChuck Lever u32 received 23156be8c594SChuck Lever ), 23166be8c594SChuck Lever 23176be8c594SChuck Lever TP_ARGS(xprt, expected, received), 23186be8c594SChuck Lever 23196be8c594SChuck Lever TP_STRUCT__entry( 23206be8c594SChuck Lever __field(u32, expected) 23216be8c594SChuck Lever __field(u32, received) 23226be8c594SChuck Lever __field(unsigned long, flags) 23236be8c594SChuck Lever __string(addr, xprt->xpt_remotebuf) 23246be8c594SChuck Lever ), 23256be8c594SChuck Lever 23266be8c594SChuck Lever TP_fast_assign( 23276be8c594SChuck Lever __entry->expected = expected; 23286be8c594SChuck Lever __entry->received = received; 23296be8c594SChuck Lever __entry->flags = xprt->xpt_flags; 23306be8c594SChuck Lever __assign_str(addr, xprt->xpt_remotebuf); 23316be8c594SChuck Lever ), 23326be8c594SChuck Lever 23336be8c594SChuck Lever TP_printk("addr=%s flags=%s expected=%u received=%u", 23346be8c594SChuck Lever __get_str(addr), show_svc_xprt_flags(__entry->flags), 23356be8c594SChuck Lever __entry->expected, __entry->received 23366be8c594SChuck Lever ) 23376be8c594SChuck Lever ); 23386be8c594SChuck Lever 2339a0469f46SChuck Lever TRACE_EVENT(svcsock_tcp_state, 2340a0469f46SChuck Lever TP_PROTO( 2341a0469f46SChuck Lever const struct svc_xprt *xprt, 2342a0469f46SChuck Lever const struct socket *socket 2343a0469f46SChuck Lever ), 2344a0469f46SChuck Lever 2345a0469f46SChuck Lever TP_ARGS(xprt, socket), 2346a0469f46SChuck Lever 2347a0469f46SChuck Lever TP_STRUCT__entry( 2348a0469f46SChuck Lever __field(unsigned long, socket_state) 2349a0469f46SChuck Lever __field(unsigned long, sock_state) 2350a0469f46SChuck Lever __field(unsigned long, flags) 2351a0469f46SChuck Lever __string(addr, xprt->xpt_remotebuf) 2352a0469f46SChuck Lever ), 2353a0469f46SChuck Lever 2354a0469f46SChuck Lever TP_fast_assign( 2355a0469f46SChuck Lever __entry->socket_state = socket->state; 2356a0469f46SChuck Lever __entry->sock_state = socket->sk->sk_state; 2357a0469f46SChuck Lever __entry->flags = xprt->xpt_flags; 2358a0469f46SChuck Lever __assign_str(addr, xprt->xpt_remotebuf); 2359a0469f46SChuck Lever ), 2360a0469f46SChuck Lever 2361a0469f46SChuck Lever TP_printk("addr=%s state=%s sk_state=%s flags=%s", __get_str(addr), 2362a0469f46SChuck Lever rpc_show_socket_state(__entry->socket_state), 2363a0469f46SChuck Lever rpc_show_sock_state(__entry->sock_state), 2364a0469f46SChuck Lever show_svc_xprt_flags(__entry->flags) 2365a0469f46SChuck Lever ) 2366a0469f46SChuck Lever ); 2367a0469f46SChuck Lever 2368a0469f46SChuck Lever DECLARE_EVENT_CLASS(svcsock_accept_class, 2369a0469f46SChuck Lever TP_PROTO( 2370a0469f46SChuck Lever const struct svc_xprt *xprt, 2371a0469f46SChuck Lever const char *service, 2372a0469f46SChuck Lever long status 2373a0469f46SChuck Lever ), 2374a0469f46SChuck Lever 2375a0469f46SChuck Lever TP_ARGS(xprt, service, status), 2376a0469f46SChuck Lever 2377a0469f46SChuck Lever TP_STRUCT__entry( 2378a0469f46SChuck Lever __field(long, status) 2379a0469f46SChuck Lever __string(service, service) 238016720861SChuck Lever __field(unsigned int, netns_ino) 2381a0469f46SChuck Lever ), 2382a0469f46SChuck Lever 2383a0469f46SChuck Lever TP_fast_assign( 2384a0469f46SChuck Lever __entry->status = status; 2385a0469f46SChuck Lever __assign_str(service, service); 238616720861SChuck Lever __entry->netns_ino = xprt->xpt_net->ns.inum; 2387a0469f46SChuck Lever ), 2388a0469f46SChuck Lever 238916720861SChuck Lever TP_printk("addr=listener service=%s status=%ld", 239016720861SChuck Lever __get_str(service), __entry->status 2391a0469f46SChuck Lever ) 2392a0469f46SChuck Lever ); 2393a0469f46SChuck Lever 2394a0469f46SChuck Lever #define DEFINE_ACCEPT_EVENT(name) \ 2395a0469f46SChuck Lever DEFINE_EVENT(svcsock_accept_class, svcsock_##name##_err, \ 2396a0469f46SChuck Lever TP_PROTO( \ 2397a0469f46SChuck Lever const struct svc_xprt *xprt, \ 2398a0469f46SChuck Lever const char *service, \ 2399a0469f46SChuck Lever long status \ 2400a0469f46SChuck Lever ), \ 2401a0469f46SChuck Lever TP_ARGS(xprt, service, status)) 2402a0469f46SChuck Lever 2403a0469f46SChuck Lever DEFINE_ACCEPT_EVENT(accept); 2404a0469f46SChuck Lever DEFINE_ACCEPT_EVENT(getpeername); 2405a0469f46SChuck Lever 240678a947f5STrond Myklebust DECLARE_EVENT_CLASS(cache_event, 240778a947f5STrond Myklebust TP_PROTO( 240878a947f5STrond Myklebust const struct cache_detail *cd, 240978a947f5STrond Myklebust const struct cache_head *h 241078a947f5STrond Myklebust ), 241178a947f5STrond Myklebust 241278a947f5STrond Myklebust TP_ARGS(cd, h), 241378a947f5STrond Myklebust 241478a947f5STrond Myklebust TP_STRUCT__entry( 241578a947f5STrond Myklebust __field(const struct cache_head *, h) 241678a947f5STrond Myklebust __string(name, cd->name) 241778a947f5STrond Myklebust ), 241878a947f5STrond Myklebust 241978a947f5STrond Myklebust TP_fast_assign( 242078a947f5STrond Myklebust __entry->h = h; 242178a947f5STrond Myklebust __assign_str(name, cd->name); 242278a947f5STrond Myklebust ), 242378a947f5STrond Myklebust 242478a947f5STrond Myklebust TP_printk("cache=%s entry=%p", __get_str(name), __entry->h) 242578a947f5STrond Myklebust ); 242678a947f5STrond Myklebust #define DEFINE_CACHE_EVENT(name) \ 242778a947f5STrond Myklebust DEFINE_EVENT(cache_event, name, \ 242878a947f5STrond Myklebust TP_PROTO( \ 242978a947f5STrond Myklebust const struct cache_detail *cd, \ 243078a947f5STrond Myklebust const struct cache_head *h \ 243178a947f5STrond Myklebust ), \ 243278a947f5STrond Myklebust TP_ARGS(cd, h)) 243378a947f5STrond Myklebust DEFINE_CACHE_EVENT(cache_entry_expired); 243478a947f5STrond Myklebust DEFINE_CACHE_EVENT(cache_entry_upcall); 243578a947f5STrond Myklebust DEFINE_CACHE_EVENT(cache_entry_update); 243678a947f5STrond Myklebust DEFINE_CACHE_EVENT(cache_entry_make_negative); 243778a947f5STrond Myklebust DEFINE_CACHE_EVENT(cache_entry_no_listener); 243878a947f5STrond Myklebust 2439b4af5932SChuck Lever DECLARE_EVENT_CLASS(register_class, 2440b4af5932SChuck Lever TP_PROTO( 2441b4af5932SChuck Lever const char *program, 2442b4af5932SChuck Lever const u32 version, 2443b4af5932SChuck Lever const int family, 2444b4af5932SChuck Lever const unsigned short protocol, 2445b4af5932SChuck Lever const unsigned short port, 2446b4af5932SChuck Lever int error 2447b4af5932SChuck Lever ), 2448b4af5932SChuck Lever 2449b4af5932SChuck Lever TP_ARGS(program, version, family, protocol, port, error), 2450b4af5932SChuck Lever 2451b4af5932SChuck Lever TP_STRUCT__entry( 2452b4af5932SChuck Lever __field(u32, version) 2453b4af5932SChuck Lever __field(unsigned long, family) 2454b4af5932SChuck Lever __field(unsigned short, protocol) 2455b4af5932SChuck Lever __field(unsigned short, port) 2456b4af5932SChuck Lever __field(int, error) 2457b4af5932SChuck Lever __string(program, program) 2458b4af5932SChuck Lever ), 2459b4af5932SChuck Lever 2460b4af5932SChuck Lever TP_fast_assign( 2461b4af5932SChuck Lever __entry->version = version; 2462b4af5932SChuck Lever __entry->family = family; 2463b4af5932SChuck Lever __entry->protocol = protocol; 2464b4af5932SChuck Lever __entry->port = port; 2465b4af5932SChuck Lever __entry->error = error; 2466b4af5932SChuck Lever __assign_str(program, program); 2467b4af5932SChuck Lever ), 2468b4af5932SChuck Lever 2469b4af5932SChuck Lever TP_printk("program=%sv%u proto=%s port=%u family=%s error=%d", 2470b4af5932SChuck Lever __get_str(program), __entry->version, 2471b4af5932SChuck Lever __entry->protocol == IPPROTO_UDP ? "udp" : "tcp", 2472b4af5932SChuck Lever __entry->port, rpc_show_address_family(__entry->family), 2473b4af5932SChuck Lever __entry->error 2474b4af5932SChuck Lever ) 2475b4af5932SChuck Lever ); 2476b4af5932SChuck Lever 2477b4af5932SChuck Lever #define DEFINE_REGISTER_EVENT(name) \ 2478b4af5932SChuck Lever DEFINE_EVENT(register_class, svc_##name, \ 2479b4af5932SChuck Lever TP_PROTO( \ 2480b4af5932SChuck Lever const char *program, \ 2481b4af5932SChuck Lever const u32 version, \ 2482b4af5932SChuck Lever const int family, \ 2483b4af5932SChuck Lever const unsigned short protocol, \ 2484b4af5932SChuck Lever const unsigned short port, \ 2485b4af5932SChuck Lever int error \ 2486b4af5932SChuck Lever ), \ 2487b4af5932SChuck Lever TP_ARGS(program, version, family, protocol, \ 2488b4af5932SChuck Lever port, error)) 2489b4af5932SChuck Lever 2490b4af5932SChuck Lever DEFINE_REGISTER_EVENT(register); 2491b4af5932SChuck Lever DEFINE_REGISTER_EVENT(noregister); 2492b4af5932SChuck Lever 2493b4af5932SChuck Lever TRACE_EVENT(svc_unregister, 2494b4af5932SChuck Lever TP_PROTO( 2495b4af5932SChuck Lever const char *program, 2496b4af5932SChuck Lever const u32 version, 2497b4af5932SChuck Lever int error 2498b4af5932SChuck Lever ), 2499b4af5932SChuck Lever 2500b4af5932SChuck Lever TP_ARGS(program, version, error), 2501b4af5932SChuck Lever 2502b4af5932SChuck Lever TP_STRUCT__entry( 2503b4af5932SChuck Lever __field(u32, version) 2504b4af5932SChuck Lever __field(int, error) 2505b4af5932SChuck Lever __string(program, program) 2506b4af5932SChuck Lever ), 2507b4af5932SChuck Lever 2508b4af5932SChuck Lever TP_fast_assign( 2509b4af5932SChuck Lever __entry->version = version; 2510b4af5932SChuck Lever __entry->error = error; 2511b4af5932SChuck Lever __assign_str(program, program); 2512b4af5932SChuck Lever ), 2513b4af5932SChuck Lever 2514b4af5932SChuck Lever TP_printk("program=%sv%u error=%d", 2515b4af5932SChuck Lever __get_str(program), __entry->version, __entry->error 2516b4af5932SChuck Lever ) 2517b4af5932SChuck Lever ); 2518b4af5932SChuck Lever 251982b0a4c3STrond Myklebust #endif /* _TRACE_SUNRPC_H */ 252082b0a4c3STrond Myklebust 252182b0a4c3STrond Myklebust #include <trace/define_trace.h> 2522