Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Trond Myklebust | 82b0a4c | 2012-01-20 14:52:23 -0500 | [diff] [blame] | 2 | #undef TRACE_SYSTEM |
| 3 | #define TRACE_SYSTEM sunrpc |
| 4 | |
| 5 | #if !defined(_TRACE_SUNRPC_H) || defined(TRACE_HEADER_MULTI_READ) |
| 6 | #define _TRACE_SUNRPC_H |
| 7 | |
| 8 | #include <linux/sunrpc/sched.h> |
| 9 | #include <linux/sunrpc/clnt.h> |
Jeff Layton | 860a0d9 | 2014-10-28 14:24:12 -0400 | [diff] [blame] | 10 | #include <linux/sunrpc/svc.h> |
Jeff Layton | 1a867a0 | 2014-10-28 14:24:14 -0400 | [diff] [blame] | 11 | #include <linux/sunrpc/xprtsock.h> |
Jeff Layton | 83a712e | 2014-11-21 14:19:31 -0500 | [diff] [blame] | 12 | #include <linux/sunrpc/svc_xprt.h> |
Trond Myklebust | 40b5ea0 | 2013-09-04 12:16:23 -0400 | [diff] [blame] | 13 | #include <net/tcp_states.h> |
| 14 | #include <linux/net.h> |
Trond Myklebust | 82b0a4c | 2012-01-20 14:52:23 -0500 | [diff] [blame] | 15 | #include <linux/tracepoint.h> |
| 16 | |
Chuck Lever | b4776a3 | 2021-10-16 18:02:24 -0400 | [diff] [blame] | 17 | #include <trace/events/sunrpc_base.h> |
| 18 | |
Chuck Lever | 998024d | 2020-03-17 15:06:31 -0400 | [diff] [blame] | 19 | TRACE_DEFINE_ENUM(SOCK_STREAM); |
| 20 | TRACE_DEFINE_ENUM(SOCK_DGRAM); |
| 21 | TRACE_DEFINE_ENUM(SOCK_RAW); |
| 22 | TRACE_DEFINE_ENUM(SOCK_RDM); |
| 23 | TRACE_DEFINE_ENUM(SOCK_SEQPACKET); |
| 24 | TRACE_DEFINE_ENUM(SOCK_DCCP); |
| 25 | TRACE_DEFINE_ENUM(SOCK_PACKET); |
| 26 | |
| 27 | #define show_socket_type(type) \ |
| 28 | __print_symbolic(type, \ |
| 29 | { SOCK_STREAM, "STREAM" }, \ |
| 30 | { SOCK_DGRAM, "DGRAM" }, \ |
| 31 | { SOCK_RAW, "RAW" }, \ |
| 32 | { SOCK_RDM, "RDM" }, \ |
| 33 | { SOCK_SEQPACKET, "SEQPACKET" }, \ |
| 34 | { SOCK_DCCP, "DCCP" }, \ |
| 35 | { SOCK_PACKET, "PACKET" }) |
| 36 | |
| 37 | /* This list is known to be incomplete, add new enums as needed. */ |
| 38 | TRACE_DEFINE_ENUM(AF_UNSPEC); |
| 39 | TRACE_DEFINE_ENUM(AF_UNIX); |
| 40 | TRACE_DEFINE_ENUM(AF_LOCAL); |
| 41 | TRACE_DEFINE_ENUM(AF_INET); |
| 42 | TRACE_DEFINE_ENUM(AF_INET6); |
| 43 | |
| 44 | #define rpc_show_address_family(family) \ |
| 45 | __print_symbolic(family, \ |
| 46 | { AF_UNSPEC, "AF_UNSPEC" }, \ |
| 47 | { AF_UNIX, "AF_UNIX" }, \ |
| 48 | { AF_LOCAL, "AF_LOCAL" }, \ |
| 49 | { AF_INET, "AF_INET" }, \ |
| 50 | { AF_INET6, "AF_INET6" }) |
| 51 | |
Chuck Lever | c509f15a | 2020-05-12 17:13:28 -0400 | [diff] [blame] | 52 | DECLARE_EVENT_CLASS(rpc_xdr_buf_class, |
Chuck Lever | b20dfc3 | 2020-03-02 15:01:08 -0500 | [diff] [blame] | 53 | TP_PROTO( |
Chuck Lever | c509f15a | 2020-05-12 17:13:28 -0400 | [diff] [blame] | 54 | const struct rpc_task *task, |
Chuck Lever | b20dfc3 | 2020-03-02 15:01:08 -0500 | [diff] [blame] | 55 | const struct xdr_buf *xdr |
| 56 | ), |
| 57 | |
Chuck Lever | c509f15a | 2020-05-12 17:13:28 -0400 | [diff] [blame] | 58 | TP_ARGS(task, xdr), |
Chuck Lever | b20dfc3 | 2020-03-02 15:01:08 -0500 | [diff] [blame] | 59 | |
| 60 | TP_STRUCT__entry( |
Chuck Lever | c509f15a | 2020-05-12 17:13:28 -0400 | [diff] [blame] | 61 | __field(unsigned int, task_id) |
| 62 | __field(unsigned int, client_id) |
Chuck Lever | b20dfc3 | 2020-03-02 15:01:08 -0500 | [diff] [blame] | 63 | __field(const void *, head_base) |
| 64 | __field(size_t, head_len) |
| 65 | __field(const void *, tail_base) |
| 66 | __field(size_t, tail_len) |
Chuck Lever | 35940a5 | 2021-10-04 10:16:32 -0400 | [diff] [blame] | 67 | __field(unsigned int, page_base) |
Chuck Lever | b20dfc3 | 2020-03-02 15:01:08 -0500 | [diff] [blame] | 68 | __field(unsigned int, page_len) |
| 69 | __field(unsigned int, msg_len) |
| 70 | ), |
| 71 | |
| 72 | TP_fast_assign( |
Chuck Lever | c509f15a | 2020-05-12 17:13:28 -0400 | [diff] [blame] | 73 | __entry->task_id = task->tk_pid; |
Scott Mayhew | c3213d2 | 2020-11-12 15:17:32 -0500 | [diff] [blame] | 74 | __entry->client_id = task->tk_client ? |
| 75 | task->tk_client->cl_clid : -1; |
Chuck Lever | b20dfc3 | 2020-03-02 15:01:08 -0500 | [diff] [blame] | 76 | __entry->head_base = xdr->head[0].iov_base; |
| 77 | __entry->head_len = xdr->head[0].iov_len; |
| 78 | __entry->tail_base = xdr->tail[0].iov_base; |
| 79 | __entry->tail_len = xdr->tail[0].iov_len; |
Chuck Lever | 35940a5 | 2021-10-04 10:16:32 -0400 | [diff] [blame] | 80 | __entry->page_base = xdr->page_base; |
Chuck Lever | b20dfc3 | 2020-03-02 15:01:08 -0500 | [diff] [blame] | 81 | __entry->page_len = xdr->page_len; |
| 82 | __entry->msg_len = xdr->len; |
| 83 | ), |
| 84 | |
Chuck Lever | b4776a3 | 2021-10-16 18:02:24 -0400 | [diff] [blame] | 85 | TP_printk(SUNRPC_TRACE_TASK_SPECIFIER |
Linus Torvalds | 38764c7 | 2021-11-10 16:45:54 -0800 | [diff] [blame] | 86 | " head=[%p,%zu] page=%u(%u) tail=[%p,%zu] len=%u", |
Chuck Lever | c509f15a | 2020-05-12 17:13:28 -0400 | [diff] [blame] | 87 | __entry->task_id, __entry->client_id, |
Chuck Lever | 35940a5 | 2021-10-04 10:16:32 -0400 | [diff] [blame] | 88 | __entry->head_base, __entry->head_len, |
| 89 | __entry->page_len, __entry->page_base, |
| 90 | __entry->tail_base, __entry->tail_len, |
| 91 | __entry->msg_len |
Chuck Lever | b20dfc3 | 2020-03-02 15:01:08 -0500 | [diff] [blame] | 92 | ) |
| 93 | ); |
| 94 | |
Chuck Lever | c509f15a | 2020-05-12 17:13:28 -0400 | [diff] [blame] | 95 | #define DEFINE_RPCXDRBUF_EVENT(name) \ |
| 96 | DEFINE_EVENT(rpc_xdr_buf_class, \ |
| 97 | rpc_xdr_##name, \ |
Chuck Lever | b20dfc3 | 2020-03-02 15:01:08 -0500 | [diff] [blame] | 98 | TP_PROTO( \ |
Chuck Lever | c509f15a | 2020-05-12 17:13:28 -0400 | [diff] [blame] | 99 | const struct rpc_task *task, \ |
Chuck Lever | b20dfc3 | 2020-03-02 15:01:08 -0500 | [diff] [blame] | 100 | const struct xdr_buf *xdr \ |
| 101 | ), \ |
Chuck Lever | c509f15a | 2020-05-12 17:13:28 -0400 | [diff] [blame] | 102 | TP_ARGS(task, xdr)) |
Chuck Lever | b20dfc3 | 2020-03-02 15:01:08 -0500 | [diff] [blame] | 103 | |
Chuck Lever | c509f15a | 2020-05-12 17:13:28 -0400 | [diff] [blame] | 104 | DEFINE_RPCXDRBUF_EVENT(sendto); |
| 105 | DEFINE_RPCXDRBUF_EVENT(recvfrom); |
| 106 | DEFINE_RPCXDRBUF_EVENT(reply_pages); |
| 107 | |
Chuck Lever | b20dfc3 | 2020-03-02 15:01:08 -0500 | [diff] [blame] | 108 | |
Chuck Lever | 42aad0d | 2020-05-12 17:13:39 -0400 | [diff] [blame] | 109 | DECLARE_EVENT_CLASS(rpc_clnt_class, |
| 110 | TP_PROTO( |
| 111 | const struct rpc_clnt *clnt |
| 112 | ), |
| 113 | |
| 114 | TP_ARGS(clnt), |
| 115 | |
| 116 | TP_STRUCT__entry( |
| 117 | __field(unsigned int, client_id) |
| 118 | ), |
| 119 | |
| 120 | TP_fast_assign( |
| 121 | __entry->client_id = clnt->cl_clid; |
| 122 | ), |
| 123 | |
Chuck Lever | b4776a3 | 2021-10-16 18:02:24 -0400 | [diff] [blame] | 124 | TP_printk("client=" SUNRPC_TRACE_CLID_SPECIFIER, __entry->client_id) |
Chuck Lever | 42aad0d | 2020-05-12 17:13:39 -0400 | [diff] [blame] | 125 | ); |
| 126 | |
| 127 | #define DEFINE_RPC_CLNT_EVENT(name) \ |
| 128 | DEFINE_EVENT(rpc_clnt_class, \ |
| 129 | rpc_clnt_##name, \ |
| 130 | TP_PROTO( \ |
| 131 | const struct rpc_clnt *clnt \ |
| 132 | ), \ |
| 133 | TP_ARGS(clnt)) |
| 134 | |
| 135 | DEFINE_RPC_CLNT_EVENT(free); |
| 136 | DEFINE_RPC_CLNT_EVENT(killall); |
| 137 | DEFINE_RPC_CLNT_EVENT(shutdown); |
| 138 | DEFINE_RPC_CLNT_EVENT(release); |
| 139 | DEFINE_RPC_CLNT_EVENT(replace_xprt); |
| 140 | DEFINE_RPC_CLNT_EVENT(replace_xprt_err); |
| 141 | |
| 142 | TRACE_EVENT(rpc_clnt_new, |
| 143 | TP_PROTO( |
| 144 | const struct rpc_clnt *clnt, |
| 145 | const struct rpc_xprt *xprt, |
| 146 | const char *program, |
| 147 | const char *server |
| 148 | ), |
| 149 | |
| 150 | TP_ARGS(clnt, xprt, program, server), |
| 151 | |
| 152 | TP_STRUCT__entry( |
| 153 | __field(unsigned int, client_id) |
| 154 | __string(addr, xprt->address_strings[RPC_DISPLAY_ADDR]) |
| 155 | __string(port, xprt->address_strings[RPC_DISPLAY_PORT]) |
| 156 | __string(program, program) |
| 157 | __string(server, server) |
| 158 | ), |
| 159 | |
| 160 | TP_fast_assign( |
| 161 | __entry->client_id = clnt->cl_clid; |
| 162 | __assign_str(addr, xprt->address_strings[RPC_DISPLAY_ADDR]); |
| 163 | __assign_str(port, xprt->address_strings[RPC_DISPLAY_PORT]); |
Joe Perches | 78c14b3 | 2021-06-12 08:42:27 -0700 | [diff] [blame] | 164 | __assign_str(program, program); |
| 165 | __assign_str(server, server); |
Chuck Lever | 42aad0d | 2020-05-12 17:13:39 -0400 | [diff] [blame] | 166 | ), |
| 167 | |
Chuck Lever | b4776a3 | 2021-10-16 18:02:24 -0400 | [diff] [blame] | 168 | TP_printk("client=" SUNRPC_TRACE_CLID_SPECIFIER |
| 169 | " peer=[%s]:%s program=%s server=%s", |
Chuck Lever | 42aad0d | 2020-05-12 17:13:39 -0400 | [diff] [blame] | 170 | __entry->client_id, __get_str(addr), __get_str(port), |
| 171 | __get_str(program), __get_str(server)) |
| 172 | ); |
| 173 | |
| 174 | TRACE_EVENT(rpc_clnt_new_err, |
| 175 | TP_PROTO( |
| 176 | const char *program, |
| 177 | const char *server, |
| 178 | int error |
| 179 | ), |
| 180 | |
| 181 | TP_ARGS(program, server, error), |
| 182 | |
| 183 | TP_STRUCT__entry( |
| 184 | __field(int, error) |
| 185 | __string(program, program) |
| 186 | __string(server, server) |
| 187 | ), |
| 188 | |
| 189 | TP_fast_assign( |
| 190 | __entry->error = error; |
Joe Perches | 78c14b3 | 2021-06-12 08:42:27 -0700 | [diff] [blame] | 191 | __assign_str(program, program); |
| 192 | __assign_str(server, server); |
Chuck Lever | 42aad0d | 2020-05-12 17:13:39 -0400 | [diff] [blame] | 193 | ), |
| 194 | |
| 195 | TP_printk("program=%s server=%s error=%d", |
| 196 | __get_str(program), __get_str(server), __entry->error) |
| 197 | ); |
| 198 | |
| 199 | TRACE_EVENT(rpc_clnt_clone_err, |
| 200 | TP_PROTO( |
| 201 | const struct rpc_clnt *clnt, |
| 202 | int error |
| 203 | ), |
| 204 | |
| 205 | TP_ARGS(clnt, error), |
| 206 | |
| 207 | TP_STRUCT__entry( |
| 208 | __field(unsigned int, client_id) |
| 209 | __field(int, error) |
| 210 | ), |
| 211 | |
| 212 | TP_fast_assign( |
| 213 | __entry->client_id = clnt->cl_clid; |
| 214 | __entry->error = error; |
| 215 | ), |
| 216 | |
Chuck Lever | b4776a3 | 2021-10-16 18:02:24 -0400 | [diff] [blame] | 217 | TP_printk("client=" SUNRPC_TRACE_CLID_SPECIFIER " error=%d", |
| 218 | __entry->client_id, __entry->error) |
Chuck Lever | 42aad0d | 2020-05-12 17:13:39 -0400 | [diff] [blame] | 219 | ); |
| 220 | |
Chuck Lever | dc5820b | 2018-12-19 11:00:16 -0500 | [diff] [blame] | 221 | |
| 222 | TRACE_DEFINE_ENUM(RPC_AUTH_OK); |
| 223 | TRACE_DEFINE_ENUM(RPC_AUTH_BADCRED); |
| 224 | TRACE_DEFINE_ENUM(RPC_AUTH_REJECTEDCRED); |
| 225 | TRACE_DEFINE_ENUM(RPC_AUTH_BADVERF); |
| 226 | TRACE_DEFINE_ENUM(RPC_AUTH_REJECTEDVERF); |
| 227 | TRACE_DEFINE_ENUM(RPC_AUTH_TOOWEAK); |
| 228 | TRACE_DEFINE_ENUM(RPCSEC_GSS_CREDPROBLEM); |
| 229 | TRACE_DEFINE_ENUM(RPCSEC_GSS_CTXPROBLEM); |
| 230 | |
Steve Dickson | 5753cba | 2012-02-06 10:08:08 -0500 | [diff] [blame] | 231 | #define rpc_show_auth_stat(status) \ |
Chuck Lever | c435da6 | 2017-11-03 13:46:14 -0400 | [diff] [blame] | 232 | __print_symbolic(status, \ |
| 233 | { RPC_AUTH_OK, "AUTH_OK" }, \ |
| 234 | { RPC_AUTH_BADCRED, "BADCRED" }, \ |
| 235 | { RPC_AUTH_REJECTEDCRED, "REJECTEDCRED" }, \ |
| 236 | { RPC_AUTH_BADVERF, "BADVERF" }, \ |
| 237 | { RPC_AUTH_REJECTEDVERF, "REJECTEDVERF" }, \ |
| 238 | { RPC_AUTH_TOOWEAK, "TOOWEAK" }, \ |
| 239 | { RPCSEC_GSS_CREDPROBLEM, "GSS_CREDPROBLEM" }, \ |
| 240 | { RPCSEC_GSS_CTXPROBLEM, "GSS_CTXPROBLEM" }) \ |
| 241 | |
| 242 | DECLARE_EVENT_CLASS(rpc_task_status, |
| 243 | |
| 244 | TP_PROTO(const struct rpc_task *task), |
| 245 | |
| 246 | TP_ARGS(task), |
| 247 | |
| 248 | TP_STRUCT__entry( |
| 249 | __field(unsigned int, task_id) |
| 250 | __field(unsigned int, client_id) |
| 251 | __field(int, status) |
| 252 | ), |
| 253 | |
| 254 | TP_fast_assign( |
| 255 | __entry->task_id = task->tk_pid; |
| 256 | __entry->client_id = task->tk_client->cl_clid; |
| 257 | __entry->status = task->tk_status; |
| 258 | ), |
| 259 | |
Chuck Lever | b4776a3 | 2021-10-16 18:02:24 -0400 | [diff] [blame] | 260 | TP_printk(SUNRPC_TRACE_TASK_SPECIFIER " status=%d", |
Trond Myklebust | 82b0a4c | 2012-01-20 14:52:23 -0500 | [diff] [blame] | 261 | __entry->task_id, __entry->client_id, |
| 262 | __entry->status) |
| 263 | ); |
| 264 | #define DEFINE_RPC_STATUS_EVENT(name) \ |
| 265 | DEFINE_EVENT(rpc_task_status, rpc_##name##_status, \ |
| 266 | TP_PROTO( \ |
| 267 | const struct rpc_task *task \ |
| 268 | ), \ |
| 269 | TP_ARGS(task)) |
| 270 | |
| 271 | DEFINE_RPC_STATUS_EVENT(call); |
Trond Myklebust | 82b0a4c | 2012-01-20 14:52:23 -0500 | [diff] [blame] | 272 | DEFINE_RPC_STATUS_EVENT(connect); |
Chuck Lever | 914cdcc | 2020-07-08 16:09:58 -0400 | [diff] [blame] | 273 | DEFINE_RPC_STATUS_EVENT(timeout); |
Chuck Lever | 7c8099f | 2020-07-08 16:10:03 -0400 | [diff] [blame] | 274 | DEFINE_RPC_STATUS_EVENT(retry_refresh); |
| 275 | DEFINE_RPC_STATUS_EVENT(refresh); |
Trond Myklebust | 82b0a4c | 2012-01-20 14:52:23 -0500 | [diff] [blame] | 276 | |
Chuck Lever | c435da6 | 2017-11-03 13:46:14 -0400 | [diff] [blame] | 277 | TRACE_EVENT(rpc_request, |
| 278 | TP_PROTO(const struct rpc_task *task), |
| 279 | |
| 280 | TP_ARGS(task), |
| 281 | |
| 282 | TP_STRUCT__entry( |
| 283 | __field(unsigned int, task_id) |
| 284 | __field(unsigned int, client_id) |
| 285 | __field(int, version) |
| 286 | __field(bool, async) |
| 287 | __string(progname, task->tk_client->cl_program->name) |
| 288 | __string(procname, rpc_proc_name(task)) |
| 289 | ), |
| 290 | |
| 291 | TP_fast_assign( |
| 292 | __entry->task_id = task->tk_pid; |
| 293 | __entry->client_id = task->tk_client->cl_clid; |
| 294 | __entry->version = task->tk_client->cl_vers; |
| 295 | __entry->async = RPC_IS_ASYNC(task); |
Joe Perches | 78c14b3 | 2021-06-12 08:42:27 -0700 | [diff] [blame] | 296 | __assign_str(progname, task->tk_client->cl_program->name); |
| 297 | __assign_str(procname, rpc_proc_name(task)); |
Chuck Lever | c435da6 | 2017-11-03 13:46:14 -0400 | [diff] [blame] | 298 | ), |
| 299 | |
Chuck Lever | b4776a3 | 2021-10-16 18:02:24 -0400 | [diff] [blame] | 300 | TP_printk(SUNRPC_TRACE_TASK_SPECIFIER " %sv%d %s (%ssync)", |
Chuck Lever | c435da6 | 2017-11-03 13:46:14 -0400 | [diff] [blame] | 301 | __entry->task_id, __entry->client_id, |
| 302 | __get_str(progname), __entry->version, |
| 303 | __get_str(procname), __entry->async ? "a": "" |
| 304 | ) |
| 305 | ); |
| 306 | |
Chuck Lever | 6f701383 | 2019-02-11 11:24:00 -0500 | [diff] [blame] | 307 | #define rpc_show_task_flags(flags) \ |
| 308 | __print_flags(flags, "|", \ |
| 309 | { RPC_TASK_ASYNC, "ASYNC" }, \ |
| 310 | { RPC_TASK_SWAPPER, "SWAPPER" }, \ |
Chuck Lever | f9d091c | 2021-07-19 10:48:22 -0400 | [diff] [blame] | 311 | { RPC_TASK_MOVEABLE, "MOVEABLE" }, \ |
Chuck Lever | 7a34c8e | 2020-05-12 17:13:12 -0400 | [diff] [blame] | 312 | { RPC_TASK_NULLCREDS, "NULLCREDS" }, \ |
Chuck Lever | 6f701383 | 2019-02-11 11:24:00 -0500 | [diff] [blame] | 313 | { RPC_CALL_MAJORSEEN, "MAJORSEEN" }, \ |
| 314 | { RPC_TASK_ROOTCREDS, "ROOTCREDS" }, \ |
| 315 | { RPC_TASK_DYNAMIC, "DYNAMIC" }, \ |
Chuck Lever | 7a34c8e | 2020-05-12 17:13:12 -0400 | [diff] [blame] | 316 | { RPC_TASK_NO_ROUND_ROBIN, "NO_ROUND_ROBIN" }, \ |
Chuck Lever | 6f701383 | 2019-02-11 11:24:00 -0500 | [diff] [blame] | 317 | { RPC_TASK_SOFT, "SOFT" }, \ |
| 318 | { RPC_TASK_SOFTCONN, "SOFTCONN" }, \ |
| 319 | { RPC_TASK_SENT, "SENT" }, \ |
| 320 | { RPC_TASK_TIMEOUT, "TIMEOUT" }, \ |
| 321 | { RPC_TASK_NOCONNECT, "NOCONNECT" }, \ |
Chuck Lever | 7a34c8e | 2020-05-12 17:13:12 -0400 | [diff] [blame] | 322 | { RPC_TASK_NO_RETRANS_TIMEOUT, "NORTO" }, \ |
| 323 | { RPC_TASK_CRED_NOREF, "CRED_NOREF" }) |
Chuck Lever | 6f701383 | 2019-02-11 11:24:00 -0500 | [diff] [blame] | 324 | |
Chuck Lever | 6f701383 | 2019-02-11 11:24:00 -0500 | [diff] [blame] | 325 | #define rpc_show_runstate(flags) \ |
| 326 | __print_flags(flags, "|", \ |
| 327 | { (1UL << RPC_TASK_RUNNING), "RUNNING" }, \ |
| 328 | { (1UL << RPC_TASK_QUEUED), "QUEUED" }, \ |
| 329 | { (1UL << RPC_TASK_ACTIVE), "ACTIVE" }, \ |
| 330 | { (1UL << RPC_TASK_NEED_XMIT), "NEED_XMIT" }, \ |
| 331 | { (1UL << RPC_TASK_NEED_RECV), "NEED_RECV" }, \ |
Trond Myklebust | ae67bd3 | 2019-04-07 13:58:44 -0400 | [diff] [blame] | 332 | { (1UL << RPC_TASK_MSG_PIN_WAIT), "MSG_PIN_WAIT" }, \ |
| 333 | { (1UL << RPC_TASK_SIGNALLED), "SIGNALLED" }) |
Chuck Lever | 6f701383 | 2019-02-11 11:24:00 -0500 | [diff] [blame] | 334 | |
Trond Myklebust | 82b0a4c | 2012-01-20 14:52:23 -0500 | [diff] [blame] | 335 | DECLARE_EVENT_CLASS(rpc_task_running, |
| 336 | |
Chuck Lever | e671edb | 2018-03-16 10:33:44 -0400 | [diff] [blame] | 337 | TP_PROTO(const struct rpc_task *task, const void *action), |
Trond Myklebust | 82b0a4c | 2012-01-20 14:52:23 -0500 | [diff] [blame] | 338 | |
Chuck Lever | e671edb | 2018-03-16 10:33:44 -0400 | [diff] [blame] | 339 | TP_ARGS(task, action), |
Trond Myklebust | 82b0a4c | 2012-01-20 14:52:23 -0500 | [diff] [blame] | 340 | |
| 341 | TP_STRUCT__entry( |
Trond Myklebust | 92cb6c5 | 2013-09-04 22:09:50 -0400 | [diff] [blame] | 342 | __field(unsigned int, task_id) |
| 343 | __field(unsigned int, client_id) |
Trond Myklebust | 82b0a4c | 2012-01-20 14:52:23 -0500 | [diff] [blame] | 344 | __field(const void *, action) |
| 345 | __field(unsigned long, runstate) |
| 346 | __field(int, status) |
| 347 | __field(unsigned short, flags) |
| 348 | ), |
| 349 | |
| 350 | TP_fast_assign( |
Chuck Lever | e671edb | 2018-03-16 10:33:44 -0400 | [diff] [blame] | 351 | __entry->client_id = task->tk_client ? |
| 352 | task->tk_client->cl_clid : -1; |
Trond Myklebust | 92cb6c5 | 2013-09-04 22:09:50 -0400 | [diff] [blame] | 353 | __entry->task_id = task->tk_pid; |
Trond Myklebust | 82b0a4c | 2012-01-20 14:52:23 -0500 | [diff] [blame] | 354 | __entry->action = action; |
| 355 | __entry->runstate = task->tk_runstate; |
| 356 | __entry->status = task->tk_status; |
| 357 | __entry->flags = task->tk_flags; |
| 358 | ), |
| 359 | |
Chuck Lever | b4776a3 | 2021-10-16 18:02:24 -0400 | [diff] [blame] | 360 | TP_printk(SUNRPC_TRACE_TASK_SPECIFIER |
| 361 | " flags=%s runstate=%s status=%d action=%ps", |
Trond Myklebust | 92cb6c5 | 2013-09-04 22:09:50 -0400 | [diff] [blame] | 362 | __entry->task_id, __entry->client_id, |
Chuck Lever | 6f701383 | 2019-02-11 11:24:00 -0500 | [diff] [blame] | 363 | rpc_show_task_flags(__entry->flags), |
| 364 | rpc_show_runstate(__entry->runstate), |
Trond Myklebust | 82b0a4c | 2012-01-20 14:52:23 -0500 | [diff] [blame] | 365 | __entry->status, |
| 366 | __entry->action |
| 367 | ) |
| 368 | ); |
Chuck Lever | dc5820b | 2018-12-19 11:00:16 -0500 | [diff] [blame] | 369 | #define DEFINE_RPC_RUNNING_EVENT(name) \ |
| 370 | DEFINE_EVENT(rpc_task_running, rpc_task_##name, \ |
| 371 | TP_PROTO( \ |
| 372 | const struct rpc_task *task, \ |
| 373 | const void *action \ |
| 374 | ), \ |
| 375 | TP_ARGS(task, action)) |
Trond Myklebust | 82b0a4c | 2012-01-20 14:52:23 -0500 | [diff] [blame] | 376 | |
Chuck Lever | dc5820b | 2018-12-19 11:00:16 -0500 | [diff] [blame] | 377 | DEFINE_RPC_RUNNING_EVENT(begin); |
| 378 | DEFINE_RPC_RUNNING_EVENT(run_action); |
Chuck Lever | 1466c22 | 2020-07-08 16:10:45 -0400 | [diff] [blame] | 379 | DEFINE_RPC_RUNNING_EVENT(sync_sleep); |
| 380 | DEFINE_RPC_RUNNING_EVENT(sync_wake); |
Chuck Lever | dc5820b | 2018-12-19 11:00:16 -0500 | [diff] [blame] | 381 | DEFINE_RPC_RUNNING_EVENT(complete); |
Chuck Lever | 721a1d3 | 2020-07-08 16:10:50 -0400 | [diff] [blame] | 382 | DEFINE_RPC_RUNNING_EVENT(timeout); |
Chuck Lever | abf8af7 | 2019-12-23 10:28:28 -0500 | [diff] [blame] | 383 | DEFINE_RPC_RUNNING_EVENT(signalled); |
Chuck Lever | a264aba | 2019-11-20 16:25:52 -0500 | [diff] [blame] | 384 | DEFINE_RPC_RUNNING_EVENT(end); |
Chuck Lever | b40887e | 2021-10-16 18:02:57 -0400 | [diff] [blame] | 385 | DEFINE_RPC_RUNNING_EVENT(call_done); |
Trond Myklebust | 82b0a4c | 2012-01-20 14:52:23 -0500 | [diff] [blame] | 386 | |
| 387 | DECLARE_EVENT_CLASS(rpc_task_queued, |
| 388 | |
Chuck Lever | e671edb | 2018-03-16 10:33:44 -0400 | [diff] [blame] | 389 | TP_PROTO(const struct rpc_task *task, const struct rpc_wait_queue *q), |
Trond Myklebust | 82b0a4c | 2012-01-20 14:52:23 -0500 | [diff] [blame] | 390 | |
Chuck Lever | e671edb | 2018-03-16 10:33:44 -0400 | [diff] [blame] | 391 | TP_ARGS(task, q), |
Trond Myklebust | 82b0a4c | 2012-01-20 14:52:23 -0500 | [diff] [blame] | 392 | |
| 393 | TP_STRUCT__entry( |
Trond Myklebust | 92cb6c5 | 2013-09-04 22:09:50 -0400 | [diff] [blame] | 394 | __field(unsigned int, task_id) |
| 395 | __field(unsigned int, client_id) |
Trond Myklebust | 82b0a4c | 2012-01-20 14:52:23 -0500 | [diff] [blame] | 396 | __field(unsigned long, timeout) |
| 397 | __field(unsigned long, runstate) |
| 398 | __field(int, status) |
| 399 | __field(unsigned short, flags) |
Trond Myklebust | 85c0d24 | 2012-02-06 10:31:35 -0500 | [diff] [blame] | 400 | __string(q_name, rpc_qname(q)) |
Trond Myklebust | 82b0a4c | 2012-01-20 14:52:23 -0500 | [diff] [blame] | 401 | ), |
| 402 | |
| 403 | TP_fast_assign( |
Chuck Lever | e671edb | 2018-03-16 10:33:44 -0400 | [diff] [blame] | 404 | __entry->client_id = task->tk_client ? |
| 405 | task->tk_client->cl_clid : -1; |
Trond Myklebust | 92cb6c5 | 2013-09-04 22:09:50 -0400 | [diff] [blame] | 406 | __entry->task_id = task->tk_pid; |
Trond Myklebust | 5efd187 | 2019-04-07 13:58:50 -0400 | [diff] [blame] | 407 | __entry->timeout = rpc_task_timeout(task); |
Trond Myklebust | 82b0a4c | 2012-01-20 14:52:23 -0500 | [diff] [blame] | 408 | __entry->runstate = task->tk_runstate; |
| 409 | __entry->status = task->tk_status; |
| 410 | __entry->flags = task->tk_flags; |
Trond Myklebust | 85c0d24 | 2012-02-06 10:31:35 -0500 | [diff] [blame] | 411 | __assign_str(q_name, rpc_qname(q)); |
Trond Myklebust | 82b0a4c | 2012-01-20 14:52:23 -0500 | [diff] [blame] | 412 | ), |
| 413 | |
Chuck Lever | b4776a3 | 2021-10-16 18:02:24 -0400 | [diff] [blame] | 414 | TP_printk(SUNRPC_TRACE_TASK_SPECIFIER |
| 415 | " flags=%s runstate=%s status=%d timeout=%lu queue=%s", |
Trond Myklebust | 92cb6c5 | 2013-09-04 22:09:50 -0400 | [diff] [blame] | 416 | __entry->task_id, __entry->client_id, |
Chuck Lever | 6f701383 | 2019-02-11 11:24:00 -0500 | [diff] [blame] | 417 | rpc_show_task_flags(__entry->flags), |
| 418 | rpc_show_runstate(__entry->runstate), |
Trond Myklebust | 82b0a4c | 2012-01-20 14:52:23 -0500 | [diff] [blame] | 419 | __entry->status, |
| 420 | __entry->timeout, |
Trond Myklebust | 85c0d24 | 2012-02-06 10:31:35 -0500 | [diff] [blame] | 421 | __get_str(q_name) |
Trond Myklebust | 82b0a4c | 2012-01-20 14:52:23 -0500 | [diff] [blame] | 422 | ) |
| 423 | ); |
Chuck Lever | dc5820b | 2018-12-19 11:00:16 -0500 | [diff] [blame] | 424 | #define DEFINE_RPC_QUEUED_EVENT(name) \ |
| 425 | DEFINE_EVENT(rpc_task_queued, rpc_task_##name, \ |
| 426 | TP_PROTO( \ |
| 427 | const struct rpc_task *task, \ |
| 428 | const struct rpc_wait_queue *q \ |
| 429 | ), \ |
| 430 | TP_ARGS(task, q)) |
Trond Myklebust | 82b0a4c | 2012-01-20 14:52:23 -0500 | [diff] [blame] | 431 | |
Chuck Lever | dc5820b | 2018-12-19 11:00:16 -0500 | [diff] [blame] | 432 | DEFINE_RPC_QUEUED_EVENT(sleep); |
| 433 | DEFINE_RPC_QUEUED_EVENT(wakeup); |
Trond Myklebust | 82b0a4c | 2012-01-20 14:52:23 -0500 | [diff] [blame] | 434 | |
Chuck Lever | e8680a2 | 2019-02-11 11:24:48 -0500 | [diff] [blame] | 435 | DECLARE_EVENT_CLASS(rpc_failure, |
| 436 | |
| 437 | TP_PROTO(const struct rpc_task *task), |
| 438 | |
| 439 | TP_ARGS(task), |
| 440 | |
| 441 | TP_STRUCT__entry( |
| 442 | __field(unsigned int, task_id) |
| 443 | __field(unsigned int, client_id) |
| 444 | ), |
| 445 | |
| 446 | TP_fast_assign( |
| 447 | __entry->task_id = task->tk_pid; |
| 448 | __entry->client_id = task->tk_client->cl_clid; |
| 449 | ), |
| 450 | |
Chuck Lever | b4776a3 | 2021-10-16 18:02:24 -0400 | [diff] [blame] | 451 | TP_printk(SUNRPC_TRACE_TASK_SPECIFIER, |
Chuck Lever | e8680a2 | 2019-02-11 11:24:48 -0500 | [diff] [blame] | 452 | __entry->task_id, __entry->client_id) |
| 453 | ); |
| 454 | |
| 455 | #define DEFINE_RPC_FAILURE(name) \ |
| 456 | DEFINE_EVENT(rpc_failure, rpc_bad_##name, \ |
| 457 | TP_PROTO( \ |
| 458 | const struct rpc_task *task \ |
| 459 | ), \ |
| 460 | TP_ARGS(task)) |
| 461 | |
| 462 | DEFINE_RPC_FAILURE(callhdr); |
Chuck Lever | 7f5667a | 2019-02-11 11:24:53 -0500 | [diff] [blame] | 463 | DEFINE_RPC_FAILURE(verifier); |
| 464 | |
| 465 | DECLARE_EVENT_CLASS(rpc_reply_event, |
| 466 | |
| 467 | TP_PROTO( |
| 468 | const struct rpc_task *task |
| 469 | ), |
| 470 | |
| 471 | TP_ARGS(task), |
| 472 | |
| 473 | TP_STRUCT__entry( |
| 474 | __field(unsigned int, task_id) |
| 475 | __field(unsigned int, client_id) |
| 476 | __field(u32, xid) |
| 477 | __string(progname, task->tk_client->cl_program->name) |
| 478 | __field(u32, version) |
| 479 | __string(procname, rpc_proc_name(task)) |
| 480 | __string(servername, task->tk_xprt->servername) |
| 481 | ), |
| 482 | |
| 483 | TP_fast_assign( |
| 484 | __entry->task_id = task->tk_pid; |
| 485 | __entry->client_id = task->tk_client->cl_clid; |
| 486 | __entry->xid = be32_to_cpu(task->tk_rqstp->rq_xid); |
Joe Perches | 78c14b3 | 2021-06-12 08:42:27 -0700 | [diff] [blame] | 487 | __assign_str(progname, task->tk_client->cl_program->name); |
Chuck Lever | 7f5667a | 2019-02-11 11:24:53 -0500 | [diff] [blame] | 488 | __entry->version = task->tk_client->cl_vers; |
Joe Perches | 78c14b3 | 2021-06-12 08:42:27 -0700 | [diff] [blame] | 489 | __assign_str(procname, rpc_proc_name(task)); |
| 490 | __assign_str(servername, task->tk_xprt->servername); |
Chuck Lever | 7f5667a | 2019-02-11 11:24:53 -0500 | [diff] [blame] | 491 | ), |
| 492 | |
Chuck Lever | b4776a3 | 2021-10-16 18:02:24 -0400 | [diff] [blame] | 493 | TP_printk(SUNRPC_TRACE_TASK_SPECIFIER |
| 494 | " server=%s xid=0x%08x %sv%d %s", |
Chuck Lever | 7f5667a | 2019-02-11 11:24:53 -0500 | [diff] [blame] | 495 | __entry->task_id, __entry->client_id, __get_str(servername), |
| 496 | __entry->xid, __get_str(progname), __entry->version, |
| 497 | __get_str(procname)) |
| 498 | ) |
| 499 | |
| 500 | #define DEFINE_RPC_REPLY_EVENT(name) \ |
| 501 | DEFINE_EVENT(rpc_reply_event, rpc__##name, \ |
| 502 | TP_PROTO( \ |
| 503 | const struct rpc_task *task \ |
| 504 | ), \ |
| 505 | TP_ARGS(task)) |
| 506 | |
| 507 | DEFINE_RPC_REPLY_EVENT(prog_unavail); |
| 508 | DEFINE_RPC_REPLY_EVENT(prog_mismatch); |
| 509 | DEFINE_RPC_REPLY_EVENT(proc_unavail); |
| 510 | DEFINE_RPC_REPLY_EVENT(garbage_args); |
| 511 | DEFINE_RPC_REPLY_EVENT(unparsable); |
| 512 | DEFINE_RPC_REPLY_EVENT(mismatch); |
| 513 | DEFINE_RPC_REPLY_EVENT(stale_creds); |
| 514 | DEFINE_RPC_REPLY_EVENT(bad_creds); |
| 515 | DEFINE_RPC_REPLY_EVENT(auth_tooweak); |
Chuck Lever | e8680a2 | 2019-02-11 11:24:48 -0500 | [diff] [blame] | 516 | |
Chuck Lever | 42ebfc2 | 2020-07-08 16:10:14 -0400 | [diff] [blame] | 517 | #define DEFINE_RPCB_ERROR_EVENT(name) \ |
| 518 | DEFINE_EVENT(rpc_reply_event, rpcb_##name##_err, \ |
| 519 | TP_PROTO( \ |
| 520 | const struct rpc_task *task \ |
| 521 | ), \ |
| 522 | TP_ARGS(task)) |
| 523 | |
| 524 | DEFINE_RPCB_ERROR_EVENT(prog_unavail); |
| 525 | DEFINE_RPCB_ERROR_EVENT(timeout); |
| 526 | DEFINE_RPCB_ERROR_EVENT(bind_version); |
| 527 | DEFINE_RPCB_ERROR_EVENT(unreachable); |
| 528 | DEFINE_RPCB_ERROR_EVENT(unrecognized); |
| 529 | |
Chuck Lever | 06e234c | 2020-07-08 16:09:11 -0400 | [diff] [blame] | 530 | TRACE_EVENT(rpc_buf_alloc, |
| 531 | TP_PROTO( |
| 532 | const struct rpc_task *task, |
| 533 | int status |
| 534 | ), |
| 535 | |
| 536 | TP_ARGS(task, status), |
| 537 | |
| 538 | TP_STRUCT__entry( |
| 539 | __field(unsigned int, task_id) |
| 540 | __field(unsigned int, client_id) |
| 541 | __field(size_t, callsize) |
| 542 | __field(size_t, recvsize) |
| 543 | __field(int, status) |
| 544 | ), |
| 545 | |
| 546 | TP_fast_assign( |
| 547 | __entry->task_id = task->tk_pid; |
| 548 | __entry->client_id = task->tk_client->cl_clid; |
| 549 | __entry->callsize = task->tk_rqstp->rq_callsize; |
| 550 | __entry->recvsize = task->tk_rqstp->rq_rcvsize; |
| 551 | __entry->status = status; |
| 552 | ), |
| 553 | |
Chuck Lever | b4776a3 | 2021-10-16 18:02:24 -0400 | [diff] [blame] | 554 | TP_printk(SUNRPC_TRACE_TASK_SPECIFIER |
| 555 | " callsize=%zu recvsize=%zu status=%d", |
Chuck Lever | 06e234c | 2020-07-08 16:09:11 -0400 | [diff] [blame] | 556 | __entry->task_id, __entry->client_id, |
| 557 | __entry->callsize, __entry->recvsize, __entry->status |
| 558 | ) |
| 559 | ); |
| 560 | |
Chuck Lever | 0125ecb | 2020-05-12 17:13:23 -0400 | [diff] [blame] | 561 | TRACE_EVENT(rpc_call_rpcerror, |
| 562 | TP_PROTO( |
| 563 | const struct rpc_task *task, |
| 564 | int tk_status, |
| 565 | int rpc_status |
| 566 | ), |
| 567 | |
| 568 | TP_ARGS(task, tk_status, rpc_status), |
| 569 | |
| 570 | TP_STRUCT__entry( |
| 571 | __field(unsigned int, task_id) |
| 572 | __field(unsigned int, client_id) |
| 573 | __field(int, tk_status) |
| 574 | __field(int, rpc_status) |
| 575 | ), |
| 576 | |
| 577 | TP_fast_assign( |
| 578 | __entry->client_id = task->tk_client->cl_clid; |
| 579 | __entry->task_id = task->tk_pid; |
| 580 | __entry->tk_status = tk_status; |
| 581 | __entry->rpc_status = rpc_status; |
| 582 | ), |
| 583 | |
Chuck Lever | b4776a3 | 2021-10-16 18:02:24 -0400 | [diff] [blame] | 584 | TP_printk(SUNRPC_TRACE_TASK_SPECIFIER |
| 585 | " tk_status=%d rpc_status=%d", |
Chuck Lever | 0125ecb | 2020-05-12 17:13:23 -0400 | [diff] [blame] | 586 | __entry->task_id, __entry->client_id, |
| 587 | __entry->tk_status, __entry->rpc_status) |
| 588 | ); |
| 589 | |
Chuck Lever | 40bf7eb | 2018-03-16 10:33:49 -0400 | [diff] [blame] | 590 | TRACE_EVENT(rpc_stats_latency, |
| 591 | |
| 592 | TP_PROTO( |
| 593 | const struct rpc_task *task, |
| 594 | ktime_t backlog, |
| 595 | ktime_t rtt, |
| 596 | ktime_t execute |
| 597 | ), |
| 598 | |
| 599 | TP_ARGS(task, backlog, rtt, execute), |
| 600 | |
| 601 | TP_STRUCT__entry( |
Chuck Lever | 98eb6cf | 2018-05-01 11:37:19 -0400 | [diff] [blame] | 602 | __field(unsigned int, task_id) |
| 603 | __field(unsigned int, client_id) |
Chuck Lever | 40bf7eb | 2018-03-16 10:33:49 -0400 | [diff] [blame] | 604 | __field(u32, xid) |
| 605 | __field(int, version) |
| 606 | __string(progname, task->tk_client->cl_program->name) |
| 607 | __string(procname, rpc_proc_name(task)) |
| 608 | __field(unsigned long, backlog) |
| 609 | __field(unsigned long, rtt) |
| 610 | __field(unsigned long, execute) |
Chuck Lever | 40bf7eb | 2018-03-16 10:33:49 -0400 | [diff] [blame] | 611 | ), |
| 612 | |
| 613 | TP_fast_assign( |
Chuck Lever | 98eb6cf | 2018-05-01 11:37:19 -0400 | [diff] [blame] | 614 | __entry->client_id = task->tk_client->cl_clid; |
| 615 | __entry->task_id = task->tk_pid; |
Chuck Lever | 40bf7eb | 2018-03-16 10:33:49 -0400 | [diff] [blame] | 616 | __entry->xid = be32_to_cpu(task->tk_rqstp->rq_xid); |
| 617 | __entry->version = task->tk_client->cl_vers; |
Joe Perches | 78c14b3 | 2021-06-12 08:42:27 -0700 | [diff] [blame] | 618 | __assign_str(progname, task->tk_client->cl_program->name); |
| 619 | __assign_str(procname, rpc_proc_name(task)); |
Chuck Lever | 40bf7eb | 2018-03-16 10:33:49 -0400 | [diff] [blame] | 620 | __entry->backlog = ktime_to_us(backlog); |
| 621 | __entry->rtt = ktime_to_us(rtt); |
| 622 | __entry->execute = ktime_to_us(execute); |
Chuck Lever | 40bf7eb | 2018-03-16 10:33:49 -0400 | [diff] [blame] | 623 | ), |
| 624 | |
Chuck Lever | b4776a3 | 2021-10-16 18:02:24 -0400 | [diff] [blame] | 625 | TP_printk(SUNRPC_TRACE_TASK_SPECIFIER |
| 626 | " xid=0x%08x %sv%d %s backlog=%lu rtt=%lu execute=%lu", |
Chuck Lever | 98eb6cf | 2018-05-01 11:37:19 -0400 | [diff] [blame] | 627 | __entry->task_id, __entry->client_id, __entry->xid, |
Chuck Lever | 40bf7eb | 2018-03-16 10:33:49 -0400 | [diff] [blame] | 628 | __get_str(progname), __entry->version, __get_str(procname), |
| 629 | __entry->backlog, __entry->rtt, __entry->execute) |
| 630 | ); |
| 631 | |
Chuck Lever | 5582863 | 2019-02-11 11:24:10 -0500 | [diff] [blame] | 632 | TRACE_EVENT(rpc_xdr_overflow, |
| 633 | TP_PROTO( |
| 634 | const struct xdr_stream *xdr, |
| 635 | size_t requested |
| 636 | ), |
| 637 | |
| 638 | TP_ARGS(xdr, requested), |
| 639 | |
| 640 | TP_STRUCT__entry( |
| 641 | __field(unsigned int, task_id) |
| 642 | __field(unsigned int, client_id) |
| 643 | __field(int, version) |
| 644 | __field(size_t, requested) |
| 645 | __field(const void *, end) |
| 646 | __field(const void *, p) |
| 647 | __field(const void *, head_base) |
| 648 | __field(size_t, head_len) |
| 649 | __field(const void *, tail_base) |
| 650 | __field(size_t, tail_len) |
| 651 | __field(unsigned int, page_len) |
| 652 | __field(unsigned int, len) |
Chuck Lever | d321ff5 | 2020-10-23 10:41:07 -0400 | [diff] [blame] | 653 | __string(progname, xdr->rqst ? |
| 654 | xdr->rqst->rq_task->tk_client->cl_program->name : "unknown") |
| 655 | __string(procedure, xdr->rqst ? |
| 656 | xdr->rqst->rq_task->tk_msg.rpc_proc->p_name : "unknown") |
Chuck Lever | 5582863 | 2019-02-11 11:24:10 -0500 | [diff] [blame] | 657 | ), |
| 658 | |
| 659 | TP_fast_assign( |
| 660 | if (xdr->rqst) { |
| 661 | const struct rpc_task *task = xdr->rqst->rq_task; |
| 662 | |
| 663 | __entry->task_id = task->tk_pid; |
| 664 | __entry->client_id = task->tk_client->cl_clid; |
| 665 | __assign_str(progname, |
Joe Perches | 78c14b3 | 2021-06-12 08:42:27 -0700 | [diff] [blame] | 666 | task->tk_client->cl_program->name); |
Chuck Lever | 5582863 | 2019-02-11 11:24:10 -0500 | [diff] [blame] | 667 | __entry->version = task->tk_client->cl_vers; |
Joe Perches | 78c14b3 | 2021-06-12 08:42:27 -0700 | [diff] [blame] | 668 | __assign_str(procedure, task->tk_msg.rpc_proc->p_name); |
Chuck Lever | 5582863 | 2019-02-11 11:24:10 -0500 | [diff] [blame] | 669 | } else { |
Chuck Lever | b4776a3 | 2021-10-16 18:02:24 -0400 | [diff] [blame] | 670 | __entry->task_id = -1; |
| 671 | __entry->client_id = -1; |
Joe Perches | 78c14b3 | 2021-06-12 08:42:27 -0700 | [diff] [blame] | 672 | __assign_str(progname, "unknown"); |
Chuck Lever | 5582863 | 2019-02-11 11:24:10 -0500 | [diff] [blame] | 673 | __entry->version = 0; |
Joe Perches | 78c14b3 | 2021-06-12 08:42:27 -0700 | [diff] [blame] | 674 | __assign_str(procedure, "unknown"); |
Chuck Lever | 5582863 | 2019-02-11 11:24:10 -0500 | [diff] [blame] | 675 | } |
| 676 | __entry->requested = requested; |
| 677 | __entry->end = xdr->end; |
| 678 | __entry->p = xdr->p; |
| 679 | __entry->head_base = xdr->buf->head[0].iov_base, |
| 680 | __entry->head_len = xdr->buf->head[0].iov_len, |
| 681 | __entry->page_len = xdr->buf->page_len, |
| 682 | __entry->tail_base = xdr->buf->tail[0].iov_base, |
| 683 | __entry->tail_len = xdr->buf->tail[0].iov_len, |
| 684 | __entry->len = xdr->buf->len; |
| 685 | ), |
| 686 | |
Chuck Lever | b4776a3 | 2021-10-16 18:02:24 -0400 | [diff] [blame] | 687 | TP_printk(SUNRPC_TRACE_TASK_SPECIFIER |
| 688 | " %sv%d %s requested=%zu p=%p end=%p xdr=[%p,%zu]/%u/[%p,%zu]/%u\n", |
Chuck Lever | 5582863 | 2019-02-11 11:24:10 -0500 | [diff] [blame] | 689 | __entry->task_id, __entry->client_id, |
| 690 | __get_str(progname), __entry->version, __get_str(procedure), |
| 691 | __entry->requested, __entry->p, __entry->end, |
| 692 | __entry->head_base, __entry->head_len, |
| 693 | __entry->page_len, |
| 694 | __entry->tail_base, __entry->tail_len, |
| 695 | __entry->len |
| 696 | ) |
| 697 | ); |
| 698 | |
Chuck Lever | 7be9cea3 | 2019-02-11 11:24:16 -0500 | [diff] [blame] | 699 | TRACE_EVENT(rpc_xdr_alignment, |
| 700 | TP_PROTO( |
| 701 | const struct xdr_stream *xdr, |
| 702 | size_t offset, |
| 703 | unsigned int copied |
| 704 | ), |
| 705 | |
| 706 | TP_ARGS(xdr, offset, copied), |
| 707 | |
| 708 | TP_STRUCT__entry( |
| 709 | __field(unsigned int, task_id) |
| 710 | __field(unsigned int, client_id) |
| 711 | __field(int, version) |
| 712 | __field(size_t, offset) |
| 713 | __field(unsigned int, copied) |
| 714 | __field(const void *, head_base) |
| 715 | __field(size_t, head_len) |
| 716 | __field(const void *, tail_base) |
| 717 | __field(size_t, tail_len) |
| 718 | __field(unsigned int, page_len) |
| 719 | __field(unsigned int, len) |
| 720 | __string(progname, |
| 721 | xdr->rqst->rq_task->tk_client->cl_program->name) |
| 722 | __string(procedure, |
| 723 | xdr->rqst->rq_task->tk_msg.rpc_proc->p_name) |
| 724 | ), |
| 725 | |
| 726 | TP_fast_assign( |
| 727 | const struct rpc_task *task = xdr->rqst->rq_task; |
| 728 | |
| 729 | __entry->task_id = task->tk_pid; |
| 730 | __entry->client_id = task->tk_client->cl_clid; |
| 731 | __assign_str(progname, |
Joe Perches | 78c14b3 | 2021-06-12 08:42:27 -0700 | [diff] [blame] | 732 | task->tk_client->cl_program->name); |
Chuck Lever | 7be9cea3 | 2019-02-11 11:24:16 -0500 | [diff] [blame] | 733 | __entry->version = task->tk_client->cl_vers; |
Joe Perches | 78c14b3 | 2021-06-12 08:42:27 -0700 | [diff] [blame] | 734 | __assign_str(procedure, task->tk_msg.rpc_proc->p_name); |
Chuck Lever | 7be9cea3 | 2019-02-11 11:24:16 -0500 | [diff] [blame] | 735 | |
| 736 | __entry->offset = offset; |
| 737 | __entry->copied = copied; |
| 738 | __entry->head_base = xdr->buf->head[0].iov_base, |
| 739 | __entry->head_len = xdr->buf->head[0].iov_len, |
| 740 | __entry->page_len = xdr->buf->page_len, |
| 741 | __entry->tail_base = xdr->buf->tail[0].iov_base, |
| 742 | __entry->tail_len = xdr->buf->tail[0].iov_len, |
| 743 | __entry->len = xdr->buf->len; |
| 744 | ), |
| 745 | |
Chuck Lever | b4776a3 | 2021-10-16 18:02:24 -0400 | [diff] [blame] | 746 | TP_printk(SUNRPC_TRACE_TASK_SPECIFIER |
| 747 | " %sv%d %s offset=%zu copied=%u xdr=[%p,%zu]/%u/[%p,%zu]/%u\n", |
Chuck Lever | 7be9cea3 | 2019-02-11 11:24:16 -0500 | [diff] [blame] | 748 | __entry->task_id, __entry->client_id, |
| 749 | __get_str(progname), __entry->version, __get_str(procedure), |
| 750 | __entry->offset, __entry->copied, |
| 751 | __entry->head_base, __entry->head_len, |
| 752 | __entry->page_len, |
| 753 | __entry->tail_base, __entry->tail_len, |
| 754 | __entry->len |
| 755 | ) |
| 756 | ); |
| 757 | |
Steven Rostedt (Red Hat) | 6ba16ee | 2015-03-27 16:53:03 -0400 | [diff] [blame] | 758 | /* |
| 759 | * First define the enums in the below macros to be exported to userspace |
| 760 | * via TRACE_DEFINE_ENUM(). |
| 761 | */ |
| 762 | #undef EM |
| 763 | #undef EMe |
| 764 | #define EM(a, b) TRACE_DEFINE_ENUM(a); |
| 765 | #define EMe(a, b) TRACE_DEFINE_ENUM(a); |
| 766 | |
| 767 | #define RPC_SHOW_SOCKET \ |
| 768 | EM( SS_FREE, "FREE" ) \ |
| 769 | EM( SS_UNCONNECTED, "UNCONNECTED" ) \ |
Chuck Lever | 82909dc | 2020-05-12 17:13:18 -0400 | [diff] [blame] | 770 | EM( SS_CONNECTING, "CONNECTING" ) \ |
| 771 | EM( SS_CONNECTED, "CONNECTED" ) \ |
| 772 | EMe( SS_DISCONNECTING, "DISCONNECTING" ) |
Steven Rostedt (Red Hat) | 6ba16ee | 2015-03-27 16:53:03 -0400 | [diff] [blame] | 773 | |
Trond Myklebust | 40b5ea0 | 2013-09-04 12:16:23 -0400 | [diff] [blame] | 774 | #define rpc_show_socket_state(state) \ |
Steven Rostedt (Red Hat) | 6ba16ee | 2015-03-27 16:53:03 -0400 | [diff] [blame] | 775 | __print_symbolic(state, RPC_SHOW_SOCKET) |
| 776 | |
| 777 | RPC_SHOW_SOCKET |
| 778 | |
| 779 | #define RPC_SHOW_SOCK \ |
| 780 | EM( TCP_ESTABLISHED, "ESTABLISHED" ) \ |
| 781 | EM( TCP_SYN_SENT, "SYN_SENT" ) \ |
| 782 | EM( TCP_SYN_RECV, "SYN_RECV" ) \ |
| 783 | EM( TCP_FIN_WAIT1, "FIN_WAIT1" ) \ |
| 784 | EM( TCP_FIN_WAIT2, "FIN_WAIT2" ) \ |
| 785 | EM( TCP_TIME_WAIT, "TIME_WAIT" ) \ |
| 786 | EM( TCP_CLOSE, "CLOSE" ) \ |
| 787 | EM( TCP_CLOSE_WAIT, "CLOSE_WAIT" ) \ |
| 788 | EM( TCP_LAST_ACK, "LAST_ACK" ) \ |
| 789 | EM( TCP_LISTEN, "LISTEN" ) \ |
| 790 | EMe( TCP_CLOSING, "CLOSING" ) |
Trond Myklebust | 40b5ea0 | 2013-09-04 12:16:23 -0400 | [diff] [blame] | 791 | |
| 792 | #define rpc_show_sock_state(state) \ |
Steven Rostedt (Red Hat) | 6ba16ee | 2015-03-27 16:53:03 -0400 | [diff] [blame] | 793 | __print_symbolic(state, RPC_SHOW_SOCK) |
| 794 | |
| 795 | RPC_SHOW_SOCK |
| 796 | |
Pierguido Lambri | 4b0c359 | 2021-12-13 08:38:48 +0000 | [diff] [blame] | 797 | |
| 798 | #include <trace/events/net_probe_common.h> |
| 799 | |
Steven Rostedt (Red Hat) | 6ba16ee | 2015-03-27 16:53:03 -0400 | [diff] [blame] | 800 | /* |
| 801 | * Now redefine the EM() and EMe() macros to map the enums to the strings |
| 802 | * that will be printed in the output. |
| 803 | */ |
| 804 | #undef EM |
| 805 | #undef EMe |
| 806 | #define EM(a, b) {a, b}, |
| 807 | #define EMe(a, b) {a, b} |
Trond Myklebust | 40b5ea0 | 2013-09-04 12:16:23 -0400 | [diff] [blame] | 808 | |
| 809 | DECLARE_EVENT_CLASS(xs_socket_event, |
| 810 | |
| 811 | TP_PROTO( |
| 812 | struct rpc_xprt *xprt, |
| 813 | struct socket *socket |
| 814 | ), |
| 815 | |
| 816 | TP_ARGS(xprt, socket), |
| 817 | |
| 818 | TP_STRUCT__entry( |
| 819 | __field(unsigned int, socket_state) |
| 820 | __field(unsigned int, sock_state) |
| 821 | __field(unsigned long long, ino) |
Pierguido Lambri | 4b0c359 | 2021-12-13 08:38:48 +0000 | [diff] [blame] | 822 | __array(__u8, saddr, sizeof(struct sockaddr_in6)) |
| 823 | __array(__u8, daddr, sizeof(struct sockaddr_in6)) |
Trond Myklebust | 40b5ea0 | 2013-09-04 12:16:23 -0400 | [diff] [blame] | 824 | ), |
| 825 | |
| 826 | TP_fast_assign( |
| 827 | struct inode *inode = SOCK_INODE(socket); |
Pierguido Lambri | 4b0c359 | 2021-12-13 08:38:48 +0000 | [diff] [blame] | 828 | const struct sock *sk = socket->sk; |
| 829 | const struct inet_sock *inet = inet_sk(sk); |
| 830 | |
| 831 | memset(__entry->saddr, 0, sizeof(struct sockaddr_in6)); |
| 832 | memset(__entry->daddr, 0, sizeof(struct sockaddr_in6)); |
| 833 | |
| 834 | TP_STORE_ADDR_PORTS(__entry, inet, sk); |
| 835 | |
Trond Myklebust | 40b5ea0 | 2013-09-04 12:16:23 -0400 | [diff] [blame] | 836 | __entry->socket_state = socket->state; |
| 837 | __entry->sock_state = socket->sk->sk_state; |
| 838 | __entry->ino = (unsigned long long)inode->i_ino; |
Pierguido Lambri | 4b0c359 | 2021-12-13 08:38:48 +0000 | [diff] [blame] | 839 | |
Trond Myklebust | 40b5ea0 | 2013-09-04 12:16:23 -0400 | [diff] [blame] | 840 | ), |
| 841 | |
| 842 | TP_printk( |
Pierguido Lambri | 4b0c359 | 2021-12-13 08:38:48 +0000 | [diff] [blame] | 843 | "socket:[%llu] srcaddr=%pISpc dstaddr=%pISpc " |
Trond Myklebust | 40b5ea0 | 2013-09-04 12:16:23 -0400 | [diff] [blame] | 844 | "state=%u (%s) sk_state=%u (%s)", |
Pierguido Lambri | 4b0c359 | 2021-12-13 08:38:48 +0000 | [diff] [blame] | 845 | __entry->ino, |
| 846 | __entry->saddr, |
| 847 | __entry->daddr, |
Trond Myklebust | 40b5ea0 | 2013-09-04 12:16:23 -0400 | [diff] [blame] | 848 | __entry->socket_state, |
| 849 | rpc_show_socket_state(__entry->socket_state), |
| 850 | __entry->sock_state, |
| 851 | rpc_show_sock_state(__entry->sock_state) |
| 852 | ) |
| 853 | ); |
| 854 | #define DEFINE_RPC_SOCKET_EVENT(name) \ |
| 855 | DEFINE_EVENT(xs_socket_event, name, \ |
| 856 | TP_PROTO( \ |
| 857 | struct rpc_xprt *xprt, \ |
| 858 | struct socket *socket \ |
| 859 | ), \ |
| 860 | TP_ARGS(xprt, socket)) |
| 861 | |
| 862 | DECLARE_EVENT_CLASS(xs_socket_event_done, |
| 863 | |
| 864 | TP_PROTO( |
| 865 | struct rpc_xprt *xprt, |
| 866 | struct socket *socket, |
| 867 | int error |
| 868 | ), |
| 869 | |
| 870 | TP_ARGS(xprt, socket, error), |
| 871 | |
| 872 | TP_STRUCT__entry( |
| 873 | __field(int, error) |
| 874 | __field(unsigned int, socket_state) |
| 875 | __field(unsigned int, sock_state) |
| 876 | __field(unsigned long long, ino) |
Pierguido Lambri | 4b0c359 | 2021-12-13 08:38:48 +0000 | [diff] [blame] | 877 | __array(__u8, saddr, sizeof(struct sockaddr_in6)) |
| 878 | __array(__u8, daddr, sizeof(struct sockaddr_in6)) |
Trond Myklebust | 40b5ea0 | 2013-09-04 12:16:23 -0400 | [diff] [blame] | 879 | ), |
| 880 | |
| 881 | TP_fast_assign( |
| 882 | struct inode *inode = SOCK_INODE(socket); |
Pierguido Lambri | 4b0c359 | 2021-12-13 08:38:48 +0000 | [diff] [blame] | 883 | const struct sock *sk = socket->sk; |
| 884 | const struct inet_sock *inet = inet_sk(sk); |
| 885 | |
| 886 | memset(__entry->saddr, 0, sizeof(struct sockaddr_in6)); |
| 887 | memset(__entry->daddr, 0, sizeof(struct sockaddr_in6)); |
| 888 | |
| 889 | TP_STORE_ADDR_PORTS(__entry, inet, sk); |
| 890 | |
Trond Myklebust | 40b5ea0 | 2013-09-04 12:16:23 -0400 | [diff] [blame] | 891 | __entry->socket_state = socket->state; |
| 892 | __entry->sock_state = socket->sk->sk_state; |
| 893 | __entry->ino = (unsigned long long)inode->i_ino; |
| 894 | __entry->error = error; |
Trond Myklebust | 40b5ea0 | 2013-09-04 12:16:23 -0400 | [diff] [blame] | 895 | ), |
| 896 | |
| 897 | TP_printk( |
Pierguido Lambri | 4b0c359 | 2021-12-13 08:38:48 +0000 | [diff] [blame] | 898 | "error=%d socket:[%llu] srcaddr=%pISpc dstaddr=%pISpc " |
Trond Myklebust | 40b5ea0 | 2013-09-04 12:16:23 -0400 | [diff] [blame] | 899 | "state=%u (%s) sk_state=%u (%s)", |
| 900 | __entry->error, |
Pierguido Lambri | 4b0c359 | 2021-12-13 08:38:48 +0000 | [diff] [blame] | 901 | __entry->ino, |
| 902 | __entry->saddr, |
| 903 | __entry->daddr, |
Trond Myklebust | 40b5ea0 | 2013-09-04 12:16:23 -0400 | [diff] [blame] | 904 | __entry->socket_state, |
| 905 | rpc_show_socket_state(__entry->socket_state), |
| 906 | __entry->sock_state, |
| 907 | rpc_show_sock_state(__entry->sock_state) |
| 908 | ) |
| 909 | ); |
| 910 | #define DEFINE_RPC_SOCKET_EVENT_DONE(name) \ |
| 911 | DEFINE_EVENT(xs_socket_event_done, name, \ |
| 912 | TP_PROTO( \ |
| 913 | struct rpc_xprt *xprt, \ |
| 914 | struct socket *socket, \ |
| 915 | int error \ |
| 916 | ), \ |
| 917 | TP_ARGS(xprt, socket, error)) |
| 918 | |
| 919 | DEFINE_RPC_SOCKET_EVENT(rpc_socket_state_change); |
| 920 | DEFINE_RPC_SOCKET_EVENT_DONE(rpc_socket_connect); |
Trond Myklebust | e8353c76 | 2013-12-31 13:39:22 -0500 | [diff] [blame] | 921 | DEFINE_RPC_SOCKET_EVENT_DONE(rpc_socket_error); |
Trond Myklebust | 40b5ea0 | 2013-09-04 12:16:23 -0400 | [diff] [blame] | 922 | DEFINE_RPC_SOCKET_EVENT_DONE(rpc_socket_reset_connection); |
| 923 | DEFINE_RPC_SOCKET_EVENT(rpc_socket_close); |
| 924 | DEFINE_RPC_SOCKET_EVENT(rpc_socket_shutdown); |
| 925 | |
Chuck Lever | 015747d | 2020-07-08 16:09:32 -0400 | [diff] [blame] | 926 | TRACE_EVENT(rpc_socket_nospace, |
| 927 | TP_PROTO( |
| 928 | const struct rpc_rqst *rqst, |
| 929 | const struct sock_xprt *transport |
| 930 | ), |
| 931 | |
| 932 | TP_ARGS(rqst, transport), |
| 933 | |
| 934 | TP_STRUCT__entry( |
| 935 | __field(unsigned int, task_id) |
| 936 | __field(unsigned int, client_id) |
| 937 | __field(unsigned int, total) |
| 938 | __field(unsigned int, remaining) |
| 939 | ), |
| 940 | |
| 941 | TP_fast_assign( |
| 942 | __entry->task_id = rqst->rq_task->tk_pid; |
| 943 | __entry->client_id = rqst->rq_task->tk_client->cl_clid; |
| 944 | __entry->total = rqst->rq_slen; |
| 945 | __entry->remaining = rqst->rq_slen - transport->xmit.offset; |
| 946 | ), |
| 947 | |
Chuck Lever | b4776a3 | 2021-10-16 18:02:24 -0400 | [diff] [blame] | 948 | TP_printk(SUNRPC_TRACE_TASK_SPECIFIER |
| 949 | " total=%u remaining=%u", |
Chuck Lever | 015747d | 2020-07-08 16:09:32 -0400 | [diff] [blame] | 950 | __entry->task_id, __entry->client_id, |
| 951 | __entry->total, __entry->remaining |
| 952 | ) |
| 953 | ); |
| 954 | |
Chuck Lever | 94afd9c | 2020-05-18 10:13:02 -0400 | [diff] [blame] | 955 | #define rpc_show_xprt_state(x) \ |
| 956 | __print_flags(x, "|", \ |
Chuck Lever | 76497b1 | 2021-10-16 18:02:38 -0400 | [diff] [blame] | 957 | { BIT(XPRT_LOCKED), "LOCKED" }, \ |
| 958 | { BIT(XPRT_CONNECTED), "CONNECTED" }, \ |
| 959 | { BIT(XPRT_CONNECTING), "CONNECTING" }, \ |
| 960 | { BIT(XPRT_CLOSE_WAIT), "CLOSE_WAIT" }, \ |
| 961 | { BIT(XPRT_BOUND), "BOUND" }, \ |
| 962 | { BIT(XPRT_BINDING), "BINDING" }, \ |
| 963 | { BIT(XPRT_CLOSING), "CLOSING" }, \ |
| 964 | { BIT(XPRT_OFFLINE), "OFFLINE" }, \ |
| 965 | { BIT(XPRT_REMOVE), "REMOVE" }, \ |
| 966 | { BIT(XPRT_CONGESTED), "CONGESTED" }, \ |
| 967 | { BIT(XPRT_CWND_WAIT), "CWND_WAIT" }, \ |
Chuck Lever | aed28b7 | 2022-01-13 12:20:36 -0500 | [diff] [blame] | 968 | { BIT(XPRT_WRITE_SPACE), "WRITE_SPACE" }, \ |
| 969 | { BIT(XPRT_SND_IS_COOKIE), "SND_IS_COOKIE" }) |
Chuck Lever | 94afd9c | 2020-05-18 10:13:02 -0400 | [diff] [blame] | 970 | |
Chuck Lever | 911813d | 2020-05-12 17:13:34 -0400 | [diff] [blame] | 971 | DECLARE_EVENT_CLASS(rpc_xprt_lifetime_class, |
| 972 | TP_PROTO( |
| 973 | const struct rpc_xprt *xprt |
| 974 | ), |
| 975 | |
| 976 | TP_ARGS(xprt), |
| 977 | |
| 978 | TP_STRUCT__entry( |
Chuck Lever | 94afd9c | 2020-05-18 10:13:02 -0400 | [diff] [blame] | 979 | __field(unsigned long, state) |
Chuck Lever | 911813d | 2020-05-12 17:13:34 -0400 | [diff] [blame] | 980 | __string(addr, xprt->address_strings[RPC_DISPLAY_ADDR]) |
| 981 | __string(port, xprt->address_strings[RPC_DISPLAY_PORT]) |
| 982 | ), |
| 983 | |
| 984 | TP_fast_assign( |
Chuck Lever | 94afd9c | 2020-05-18 10:13:02 -0400 | [diff] [blame] | 985 | __entry->state = xprt->state; |
Chuck Lever | 911813d | 2020-05-12 17:13:34 -0400 | [diff] [blame] | 986 | __assign_str(addr, xprt->address_strings[RPC_DISPLAY_ADDR]); |
| 987 | __assign_str(port, xprt->address_strings[RPC_DISPLAY_PORT]); |
| 988 | ), |
| 989 | |
Chuck Lever | 94afd9c | 2020-05-18 10:13:02 -0400 | [diff] [blame] | 990 | TP_printk("peer=[%s]:%s state=%s", |
| 991 | __get_str(addr), __get_str(port), |
| 992 | rpc_show_xprt_state(__entry->state)) |
Chuck Lever | 911813d | 2020-05-12 17:13:34 -0400 | [diff] [blame] | 993 | ); |
| 994 | |
| 995 | #define DEFINE_RPC_XPRT_LIFETIME_EVENT(name) \ |
| 996 | DEFINE_EVENT(rpc_xprt_lifetime_class, \ |
| 997 | xprt_##name, \ |
| 998 | TP_PROTO( \ |
| 999 | const struct rpc_xprt *xprt \ |
| 1000 | ), \ |
| 1001 | TP_ARGS(xprt)) |
| 1002 | |
| 1003 | DEFINE_RPC_XPRT_LIFETIME_EVENT(create); |
Chuck Lever | db0a86c | 2020-07-08 16:09:47 -0400 | [diff] [blame] | 1004 | DEFINE_RPC_XPRT_LIFETIME_EVENT(connect); |
Chuck Lever | 911813d | 2020-05-12 17:13:34 -0400 | [diff] [blame] | 1005 | DEFINE_RPC_XPRT_LIFETIME_EVENT(disconnect_auto); |
| 1006 | DEFINE_RPC_XPRT_LIFETIME_EVENT(disconnect_done); |
| 1007 | DEFINE_RPC_XPRT_LIFETIME_EVENT(disconnect_force); |
| 1008 | DEFINE_RPC_XPRT_LIFETIME_EVENT(disconnect_cleanup); |
| 1009 | DEFINE_RPC_XPRT_LIFETIME_EVENT(destroy); |
| 1010 | |
Jeff Layton | 3705ad6 | 2014-10-28 14:24:13 -0400 | [diff] [blame] | 1011 | DECLARE_EVENT_CLASS(rpc_xprt_event, |
Chuck Lever | dc5820b | 2018-12-19 11:00:16 -0500 | [diff] [blame] | 1012 | TP_PROTO( |
| 1013 | const struct rpc_xprt *xprt, |
| 1014 | __be32 xid, |
| 1015 | int status |
| 1016 | ), |
Jeff Layton | 3705ad6 | 2014-10-28 14:24:13 -0400 | [diff] [blame] | 1017 | |
| 1018 | TP_ARGS(xprt, xid, status), |
| 1019 | |
| 1020 | TP_STRUCT__entry( |
Chuck Lever | a30ccf1 | 2017-10-20 10:35:18 -0400 | [diff] [blame] | 1021 | __field(u32, xid) |
Jeff Layton | 3705ad6 | 2014-10-28 14:24:13 -0400 | [diff] [blame] | 1022 | __field(int, status) |
| 1023 | __string(addr, xprt->address_strings[RPC_DISPLAY_ADDR]) |
| 1024 | __string(port, xprt->address_strings[RPC_DISPLAY_PORT]) |
| 1025 | ), |
| 1026 | |
| 1027 | TP_fast_assign( |
Chuck Lever | a30ccf1 | 2017-10-20 10:35:18 -0400 | [diff] [blame] | 1028 | __entry->xid = be32_to_cpu(xid); |
Jeff Layton | 3705ad6 | 2014-10-28 14:24:13 -0400 | [diff] [blame] | 1029 | __entry->status = status; |
| 1030 | __assign_str(addr, xprt->address_strings[RPC_DISPLAY_ADDR]); |
| 1031 | __assign_str(port, xprt->address_strings[RPC_DISPLAY_PORT]); |
| 1032 | ), |
| 1033 | |
Chuck Lever | a30ccf1 | 2017-10-20 10:35:18 -0400 | [diff] [blame] | 1034 | TP_printk("peer=[%s]:%s xid=0x%08x status=%d", __get_str(addr), |
| 1035 | __get_str(port), __entry->xid, |
Jeff Layton | 3705ad6 | 2014-10-28 14:24:13 -0400 | [diff] [blame] | 1036 | __entry->status) |
| 1037 | ); |
Chuck Lever | dc5820b | 2018-12-19 11:00:16 -0500 | [diff] [blame] | 1038 | #define DEFINE_RPC_XPRT_EVENT(name) \ |
| 1039 | DEFINE_EVENT(rpc_xprt_event, xprt_##name, \ |
| 1040 | TP_PROTO( \ |
| 1041 | const struct rpc_xprt *xprt, \ |
| 1042 | __be32 xid, \ |
| 1043 | int status \ |
| 1044 | ), \ |
| 1045 | TP_ARGS(xprt, xid, status)) |
Jeff Layton | 3705ad6 | 2014-10-28 14:24:13 -0400 | [diff] [blame] | 1046 | |
Chuck Lever | dc5820b | 2018-12-19 11:00:16 -0500 | [diff] [blame] | 1047 | DEFINE_RPC_XPRT_EVENT(timer); |
| 1048 | DEFINE_RPC_XPRT_EVENT(lookup_rqst); |
Jeff Layton | 3705ad6 | 2014-10-28 14:24:13 -0400 | [diff] [blame] | 1049 | |
Chuck Lever | 0c77668 | 2019-02-11 11:25:04 -0500 | [diff] [blame] | 1050 | TRACE_EVENT(xprt_transmit, |
| 1051 | TP_PROTO( |
| 1052 | const struct rpc_rqst *rqst, |
| 1053 | int status |
| 1054 | ), |
| 1055 | |
| 1056 | TP_ARGS(rqst, status), |
| 1057 | |
| 1058 | TP_STRUCT__entry( |
| 1059 | __field(unsigned int, task_id) |
| 1060 | __field(unsigned int, client_id) |
| 1061 | __field(u32, xid) |
| 1062 | __field(u32, seqno) |
| 1063 | __field(int, status) |
| 1064 | ), |
| 1065 | |
| 1066 | TP_fast_assign( |
| 1067 | __entry->task_id = rqst->rq_task->tk_pid; |
Olga Kornievskaia | f87b543 | 2019-03-12 12:06:35 -0400 | [diff] [blame] | 1068 | __entry->client_id = rqst->rq_task->tk_client ? |
| 1069 | rqst->rq_task->tk_client->cl_clid : -1; |
Chuck Lever | 0c77668 | 2019-02-11 11:25:04 -0500 | [diff] [blame] | 1070 | __entry->xid = be32_to_cpu(rqst->rq_xid); |
| 1071 | __entry->seqno = rqst->rq_seqno; |
| 1072 | __entry->status = status; |
| 1073 | ), |
| 1074 | |
Chuck Lever | b4776a3 | 2021-10-16 18:02:24 -0400 | [diff] [blame] | 1075 | TP_printk(SUNRPC_TRACE_TASK_SPECIFIER |
| 1076 | " xid=0x%08x seqno=%u status=%d", |
Chuck Lever | 0c77668 | 2019-02-11 11:25:04 -0500 | [diff] [blame] | 1077 | __entry->task_id, __entry->client_id, __entry->xid, |
| 1078 | __entry->seqno, __entry->status) |
| 1079 | ); |
| 1080 | |
Chuck Lever | e936a59 | 2021-03-31 13:22:27 -0400 | [diff] [blame] | 1081 | TRACE_EVENT(xprt_retransmit, |
| 1082 | TP_PROTO( |
| 1083 | const struct rpc_rqst *rqst |
| 1084 | ), |
| 1085 | |
| 1086 | TP_ARGS(rqst), |
| 1087 | |
| 1088 | TP_STRUCT__entry( |
| 1089 | __field(unsigned int, task_id) |
| 1090 | __field(unsigned int, client_id) |
| 1091 | __field(u32, xid) |
| 1092 | __field(int, ntrans) |
| 1093 | __field(int, version) |
Chuck Lever | be17b8c | 2021-07-19 10:48:34 -0400 | [diff] [blame] | 1094 | __field(unsigned long, timeout) |
Chuck Lever | e936a59 | 2021-03-31 13:22:27 -0400 | [diff] [blame] | 1095 | __string(progname, |
| 1096 | rqst->rq_task->tk_client->cl_program->name) |
Chuck Lever | be630b9 | 2021-07-19 10:48:28 -0400 | [diff] [blame] | 1097 | __string(procname, rpc_proc_name(rqst->rq_task)) |
Chuck Lever | e936a59 | 2021-03-31 13:22:27 -0400 | [diff] [blame] | 1098 | ), |
| 1099 | |
| 1100 | TP_fast_assign( |
| 1101 | struct rpc_task *task = rqst->rq_task; |
| 1102 | |
| 1103 | __entry->task_id = task->tk_pid; |
| 1104 | __entry->client_id = task->tk_client ? |
| 1105 | task->tk_client->cl_clid : -1; |
| 1106 | __entry->xid = be32_to_cpu(rqst->rq_xid); |
| 1107 | __entry->ntrans = rqst->rq_ntrans; |
Chuck Lever | be17b8c | 2021-07-19 10:48:34 -0400 | [diff] [blame] | 1108 | __entry->timeout = task->tk_timeout; |
Chuck Lever | e936a59 | 2021-03-31 13:22:27 -0400 | [diff] [blame] | 1109 | __assign_str(progname, |
Joe Perches | 78c14b3 | 2021-06-12 08:42:27 -0700 | [diff] [blame] | 1110 | task->tk_client->cl_program->name); |
Chuck Lever | e936a59 | 2021-03-31 13:22:27 -0400 | [diff] [blame] | 1111 | __entry->version = task->tk_client->cl_vers; |
Chuck Lever | be630b9 | 2021-07-19 10:48:28 -0400 | [diff] [blame] | 1112 | __assign_str(procname, rpc_proc_name(task)); |
Chuck Lever | e936a59 | 2021-03-31 13:22:27 -0400 | [diff] [blame] | 1113 | ), |
| 1114 | |
Chuck Lever | b4776a3 | 2021-10-16 18:02:24 -0400 | [diff] [blame] | 1115 | TP_printk(SUNRPC_TRACE_TASK_SPECIFIER |
| 1116 | " xid=0x%08x %sv%d %s ntrans=%d timeout=%lu", |
Chuck Lever | e936a59 | 2021-03-31 13:22:27 -0400 | [diff] [blame] | 1117 | __entry->task_id, __entry->client_id, __entry->xid, |
Chuck Lever | be630b9 | 2021-07-19 10:48:28 -0400 | [diff] [blame] | 1118 | __get_str(progname), __entry->version, __get_str(procname), |
Chuck Lever | be17b8c | 2021-07-19 10:48:34 -0400 | [diff] [blame] | 1119 | __entry->ntrans, __entry->timeout |
Chuck Lever | be630b9 | 2021-07-19 10:48:28 -0400 | [diff] [blame] | 1120 | ) |
Chuck Lever | e936a59 | 2021-03-31 13:22:27 -0400 | [diff] [blame] | 1121 | ); |
| 1122 | |
Chuck Lever | a25a4cb | 2018-03-16 10:33:55 -0400 | [diff] [blame] | 1123 | TRACE_EVENT(xprt_ping, |
| 1124 | TP_PROTO(const struct rpc_xprt *xprt, int status), |
| 1125 | |
| 1126 | TP_ARGS(xprt, status), |
| 1127 | |
| 1128 | TP_STRUCT__entry( |
| 1129 | __field(int, status) |
| 1130 | __string(addr, xprt->address_strings[RPC_DISPLAY_ADDR]) |
| 1131 | __string(port, xprt->address_strings[RPC_DISPLAY_PORT]) |
| 1132 | ), |
| 1133 | |
| 1134 | TP_fast_assign( |
| 1135 | __entry->status = status; |
| 1136 | __assign_str(addr, xprt->address_strings[RPC_DISPLAY_ADDR]); |
| 1137 | __assign_str(port, xprt->address_strings[RPC_DISPLAY_PORT]); |
| 1138 | ), |
| 1139 | |
| 1140 | TP_printk("peer=[%s]:%s status=%d", |
| 1141 | __get_str(addr), __get_str(port), __entry->status) |
| 1142 | ); |
| 1143 | |
Chuck Lever | bf7ca70 | 2019-10-09 12:58:14 -0400 | [diff] [blame] | 1144 | DECLARE_EVENT_CLASS(xprt_writelock_event, |
| 1145 | TP_PROTO( |
| 1146 | const struct rpc_xprt *xprt, const struct rpc_task *task |
| 1147 | ), |
| 1148 | |
| 1149 | TP_ARGS(xprt, task), |
| 1150 | |
| 1151 | TP_STRUCT__entry( |
| 1152 | __field(unsigned int, task_id) |
| 1153 | __field(unsigned int, client_id) |
| 1154 | __field(unsigned int, snd_task_id) |
| 1155 | ), |
| 1156 | |
| 1157 | TP_fast_assign( |
| 1158 | if (task) { |
| 1159 | __entry->task_id = task->tk_pid; |
| 1160 | __entry->client_id = task->tk_client ? |
| 1161 | task->tk_client->cl_clid : -1; |
| 1162 | } else { |
| 1163 | __entry->task_id = -1; |
| 1164 | __entry->client_id = -1; |
| 1165 | } |
Chuck Lever | aed28b7 | 2022-01-13 12:20:36 -0500 | [diff] [blame] | 1166 | if (xprt->snd_task && |
| 1167 | !test_bit(XPRT_SND_IS_COOKIE, &xprt->state)) |
| 1168 | __entry->snd_task_id = xprt->snd_task->tk_pid; |
| 1169 | else |
| 1170 | __entry->snd_task_id = -1; |
Chuck Lever | bf7ca70 | 2019-10-09 12:58:14 -0400 | [diff] [blame] | 1171 | ), |
| 1172 | |
Chuck Lever | b4776a3 | 2021-10-16 18:02:24 -0400 | [diff] [blame] | 1173 | TP_printk(SUNRPC_TRACE_TASK_SPECIFIER |
| 1174 | " snd_task:" SUNRPC_TRACE_PID_SPECIFIER, |
Chuck Lever | bf7ca70 | 2019-10-09 12:58:14 -0400 | [diff] [blame] | 1175 | __entry->task_id, __entry->client_id, |
| 1176 | __entry->snd_task_id) |
| 1177 | ); |
| 1178 | |
| 1179 | #define DEFINE_WRITELOCK_EVENT(name) \ |
| 1180 | DEFINE_EVENT(xprt_writelock_event, xprt_##name, \ |
| 1181 | TP_PROTO( \ |
| 1182 | const struct rpc_xprt *xprt, \ |
| 1183 | const struct rpc_task *task \ |
| 1184 | ), \ |
| 1185 | TP_ARGS(xprt, task)) |
| 1186 | |
| 1187 | DEFINE_WRITELOCK_EVENT(reserve_xprt); |
| 1188 | DEFINE_WRITELOCK_EVENT(release_xprt); |
| 1189 | |
| 1190 | DECLARE_EVENT_CLASS(xprt_cong_event, |
| 1191 | TP_PROTO( |
| 1192 | const struct rpc_xprt *xprt, const struct rpc_task *task |
| 1193 | ), |
| 1194 | |
| 1195 | TP_ARGS(xprt, task), |
| 1196 | |
| 1197 | TP_STRUCT__entry( |
| 1198 | __field(unsigned int, task_id) |
| 1199 | __field(unsigned int, client_id) |
| 1200 | __field(unsigned int, snd_task_id) |
| 1201 | __field(unsigned long, cong) |
| 1202 | __field(unsigned long, cwnd) |
| 1203 | __field(bool, wait) |
| 1204 | ), |
| 1205 | |
| 1206 | TP_fast_assign( |
| 1207 | if (task) { |
| 1208 | __entry->task_id = task->tk_pid; |
| 1209 | __entry->client_id = task->tk_client ? |
| 1210 | task->tk_client->cl_clid : -1; |
| 1211 | } else { |
| 1212 | __entry->task_id = -1; |
| 1213 | __entry->client_id = -1; |
| 1214 | } |
Chuck Lever | aed28b7 | 2022-01-13 12:20:36 -0500 | [diff] [blame] | 1215 | if (xprt->snd_task && |
| 1216 | !test_bit(XPRT_SND_IS_COOKIE, &xprt->state)) |
| 1217 | __entry->snd_task_id = xprt->snd_task->tk_pid; |
| 1218 | else |
| 1219 | __entry->snd_task_id = -1; |
| 1220 | |
Chuck Lever | bf7ca70 | 2019-10-09 12:58:14 -0400 | [diff] [blame] | 1221 | __entry->cong = xprt->cong; |
| 1222 | __entry->cwnd = xprt->cwnd; |
| 1223 | __entry->wait = test_bit(XPRT_CWND_WAIT, &xprt->state); |
| 1224 | ), |
| 1225 | |
Chuck Lever | b4776a3 | 2021-10-16 18:02:24 -0400 | [diff] [blame] | 1226 | TP_printk(SUNRPC_TRACE_TASK_SPECIFIER |
| 1227 | " snd_task:" SUNRPC_TRACE_PID_SPECIFIER |
| 1228 | " cong=%lu cwnd=%lu%s", |
Chuck Lever | bf7ca70 | 2019-10-09 12:58:14 -0400 | [diff] [blame] | 1229 | __entry->task_id, __entry->client_id, |
| 1230 | __entry->snd_task_id, __entry->cong, __entry->cwnd, |
| 1231 | __entry->wait ? " (wait)" : "") |
| 1232 | ); |
| 1233 | |
| 1234 | #define DEFINE_CONG_EVENT(name) \ |
| 1235 | DEFINE_EVENT(xprt_cong_event, xprt_##name, \ |
| 1236 | TP_PROTO( \ |
| 1237 | const struct rpc_xprt *xprt, \ |
| 1238 | const struct rpc_task *task \ |
| 1239 | ), \ |
| 1240 | TP_ARGS(xprt, task)) |
| 1241 | |
| 1242 | DEFINE_CONG_EVENT(reserve_cong); |
| 1243 | DEFINE_CONG_EVENT(release_cong); |
| 1244 | DEFINE_CONG_EVENT(get_cong); |
| 1245 | DEFINE_CONG_EVENT(put_cong); |
| 1246 | |
Chuck Lever | 09d2ba0 | 2020-07-08 16:09:21 -0400 | [diff] [blame] | 1247 | TRACE_EVENT(xprt_reserve, |
| 1248 | TP_PROTO( |
| 1249 | const struct rpc_rqst *rqst |
| 1250 | ), |
| 1251 | |
| 1252 | TP_ARGS(rqst), |
| 1253 | |
| 1254 | TP_STRUCT__entry( |
| 1255 | __field(unsigned int, task_id) |
| 1256 | __field(unsigned int, client_id) |
| 1257 | __field(u32, xid) |
| 1258 | ), |
| 1259 | |
| 1260 | TP_fast_assign( |
| 1261 | __entry->task_id = rqst->rq_task->tk_pid; |
| 1262 | __entry->client_id = rqst->rq_task->tk_client->cl_clid; |
| 1263 | __entry->xid = be32_to_cpu(rqst->rq_xid); |
| 1264 | ), |
| 1265 | |
Chuck Lever | b4776a3 | 2021-10-16 18:02:24 -0400 | [diff] [blame] | 1266 | TP_printk(SUNRPC_TRACE_TASK_SPECIFIER " xid=0x%08x", |
Chuck Lever | 09d2ba0 | 2020-07-08 16:09:21 -0400 | [diff] [blame] | 1267 | __entry->task_id, __entry->client_id, __entry->xid |
| 1268 | ) |
| 1269 | ); |
| 1270 | |
Trond Myklebust | c50b8ee | 2018-09-14 14:26:28 -0400 | [diff] [blame] | 1271 | TRACE_EVENT(xs_stream_read_data, |
| 1272 | TP_PROTO(struct rpc_xprt *xprt, ssize_t err, size_t total), |
Jeff Layton | 3705ad6 | 2014-10-28 14:24:13 -0400 | [diff] [blame] | 1273 | |
| 1274 | TP_ARGS(xprt, err, total), |
| 1275 | |
| 1276 | TP_STRUCT__entry( |
Trond Myklebust | c50b8ee | 2018-09-14 14:26:28 -0400 | [diff] [blame] | 1277 | __field(ssize_t, err) |
| 1278 | __field(size_t, total) |
Jeff Layton | 3705ad6 | 2014-10-28 14:24:13 -0400 | [diff] [blame] | 1279 | __string(addr, xprt ? xprt->address_strings[RPC_DISPLAY_ADDR] : |
| 1280 | "(null)") |
| 1281 | __string(port, xprt ? xprt->address_strings[RPC_DISPLAY_PORT] : |
| 1282 | "(null)") |
| 1283 | ), |
| 1284 | |
| 1285 | TP_fast_assign( |
| 1286 | __entry->err = err; |
| 1287 | __entry->total = total; |
| 1288 | __assign_str(addr, xprt ? |
| 1289 | xprt->address_strings[RPC_DISPLAY_ADDR] : "(null)"); |
| 1290 | __assign_str(port, xprt ? |
| 1291 | xprt->address_strings[RPC_DISPLAY_PORT] : "(null)"); |
| 1292 | ), |
| 1293 | |
Trond Myklebust | c50b8ee | 2018-09-14 14:26:28 -0400 | [diff] [blame] | 1294 | TP_printk("peer=[%s]:%s err=%zd total=%zu", __get_str(addr), |
Jeff Layton | 3705ad6 | 2014-10-28 14:24:13 -0400 | [diff] [blame] | 1295 | __get_str(port), __entry->err, __entry->total) |
| 1296 | ); |
| 1297 | |
Trond Myklebust | c50b8ee | 2018-09-14 14:26:28 -0400 | [diff] [blame] | 1298 | TRACE_EVENT(xs_stream_read_request, |
Jeff Layton | 1a867a0 | 2014-10-28 14:24:14 -0400 | [diff] [blame] | 1299 | TP_PROTO(struct sock_xprt *xs), |
| 1300 | |
| 1301 | TP_ARGS(xs), |
| 1302 | |
| 1303 | TP_STRUCT__entry( |
| 1304 | __string(addr, xs->xprt.address_strings[RPC_DISPLAY_ADDR]) |
| 1305 | __string(port, xs->xprt.address_strings[RPC_DISPLAY_PORT]) |
Chuck Lever | a30ccf1 | 2017-10-20 10:35:18 -0400 | [diff] [blame] | 1306 | __field(u32, xid) |
Jeff Layton | 1a867a0 | 2014-10-28 14:24:14 -0400 | [diff] [blame] | 1307 | __field(unsigned long, copied) |
| 1308 | __field(unsigned int, reclen) |
Trond Myklebust | c50b8ee | 2018-09-14 14:26:28 -0400 | [diff] [blame] | 1309 | __field(unsigned int, offset) |
Jeff Layton | 1a867a0 | 2014-10-28 14:24:14 -0400 | [diff] [blame] | 1310 | ), |
| 1311 | |
| 1312 | TP_fast_assign( |
| 1313 | __assign_str(addr, xs->xprt.address_strings[RPC_DISPLAY_ADDR]); |
| 1314 | __assign_str(port, xs->xprt.address_strings[RPC_DISPLAY_PORT]); |
Trond Myklebust | d1109aa | 2018-08-13 15:48:42 -0400 | [diff] [blame] | 1315 | __entry->xid = be32_to_cpu(xs->recv.xid); |
Trond Myklebust | d1109aa | 2018-08-13 15:48:42 -0400 | [diff] [blame] | 1316 | __entry->copied = xs->recv.copied; |
| 1317 | __entry->reclen = xs->recv.len; |
| 1318 | __entry->offset = xs->recv.offset; |
Jeff Layton | 1a867a0 | 2014-10-28 14:24:14 -0400 | [diff] [blame] | 1319 | ), |
| 1320 | |
Trond Myklebust | c50b8ee | 2018-09-14 14:26:28 -0400 | [diff] [blame] | 1321 | TP_printk("peer=[%s]:%s xid=0x%08x copied=%lu reclen=%u offset=%u", |
Chuck Lever | a30ccf1 | 2017-10-20 10:35:18 -0400 | [diff] [blame] | 1322 | __get_str(addr), __get_str(port), __entry->xid, |
Jeff Layton | 1a867a0 | 2014-10-28 14:24:14 -0400 | [diff] [blame] | 1323 | __entry->copied, __entry->reclen, __entry->offset) |
| 1324 | ); |
| 1325 | |
Chuck Lever | e465cc3 | 2020-07-08 16:10:19 -0400 | [diff] [blame] | 1326 | TRACE_EVENT(rpcb_getport, |
| 1327 | TP_PROTO( |
| 1328 | const struct rpc_clnt *clnt, |
| 1329 | const struct rpc_task *task, |
| 1330 | unsigned int bind_version |
| 1331 | ), |
| 1332 | |
| 1333 | TP_ARGS(clnt, task, bind_version), |
| 1334 | |
| 1335 | TP_STRUCT__entry( |
| 1336 | __field(unsigned int, task_id) |
| 1337 | __field(unsigned int, client_id) |
| 1338 | __field(unsigned int, program) |
| 1339 | __field(unsigned int, version) |
| 1340 | __field(int, protocol) |
| 1341 | __field(unsigned int, bind_version) |
| 1342 | __string(servername, task->tk_xprt->servername) |
| 1343 | ), |
| 1344 | |
| 1345 | TP_fast_assign( |
| 1346 | __entry->task_id = task->tk_pid; |
| 1347 | __entry->client_id = clnt->cl_clid; |
| 1348 | __entry->program = clnt->cl_prog; |
| 1349 | __entry->version = clnt->cl_vers; |
| 1350 | __entry->protocol = task->tk_xprt->prot; |
| 1351 | __entry->bind_version = bind_version; |
| 1352 | __assign_str(servername, task->tk_xprt->servername); |
| 1353 | ), |
| 1354 | |
Chuck Lever | b4776a3 | 2021-10-16 18:02:24 -0400 | [diff] [blame] | 1355 | TP_printk(SUNRPC_TRACE_TASK_SPECIFIER |
| 1356 | " server=%s program=%u version=%u protocol=%d bind_version=%u", |
Chuck Lever | e465cc3 | 2020-07-08 16:10:19 -0400 | [diff] [blame] | 1357 | __entry->task_id, __entry->client_id, __get_str(servername), |
| 1358 | __entry->program, __entry->version, __entry->protocol, |
| 1359 | __entry->bind_version |
| 1360 | ) |
| 1361 | ); |
Chuck Lever | c509f15a | 2020-05-12 17:13:28 -0400 | [diff] [blame] | 1362 | |
Chuck Lever | ac1ae53 | 2020-07-08 16:10:24 -0400 | [diff] [blame] | 1363 | TRACE_EVENT(rpcb_setport, |
| 1364 | TP_PROTO( |
| 1365 | const struct rpc_task *task, |
| 1366 | int status, |
| 1367 | unsigned short port |
| 1368 | ), |
| 1369 | |
| 1370 | TP_ARGS(task, status, port), |
| 1371 | |
| 1372 | TP_STRUCT__entry( |
| 1373 | __field(unsigned int, task_id) |
| 1374 | __field(unsigned int, client_id) |
| 1375 | __field(int, status) |
| 1376 | __field(unsigned short, port) |
| 1377 | ), |
| 1378 | |
| 1379 | TP_fast_assign( |
| 1380 | __entry->task_id = task->tk_pid; |
| 1381 | __entry->client_id = task->tk_client->cl_clid; |
| 1382 | __entry->status = status; |
| 1383 | __entry->port = port; |
| 1384 | ), |
| 1385 | |
Chuck Lever | b4776a3 | 2021-10-16 18:02:24 -0400 | [diff] [blame] | 1386 | TP_printk(SUNRPC_TRACE_TASK_SPECIFIER " status=%d port=%u", |
Chuck Lever | ac1ae53 | 2020-07-08 16:10:24 -0400 | [diff] [blame] | 1387 | __entry->task_id, __entry->client_id, |
| 1388 | __entry->status, __entry->port |
| 1389 | ) |
| 1390 | ); |
| 1391 | |
Chuck Lever | c3adcc7 | 2020-07-08 16:10:40 -0400 | [diff] [blame] | 1392 | TRACE_EVENT(pmap_register, |
| 1393 | TP_PROTO( |
| 1394 | u32 program, |
| 1395 | u32 version, |
| 1396 | int protocol, |
| 1397 | unsigned short port |
| 1398 | ), |
| 1399 | |
| 1400 | TP_ARGS(program, version, protocol, port), |
| 1401 | |
| 1402 | TP_STRUCT__entry( |
| 1403 | __field(unsigned int, program) |
| 1404 | __field(unsigned int, version) |
| 1405 | __field(int, protocol) |
| 1406 | __field(unsigned int, port) |
| 1407 | ), |
| 1408 | |
| 1409 | TP_fast_assign( |
| 1410 | __entry->program = program; |
| 1411 | __entry->version = version; |
| 1412 | __entry->protocol = protocol; |
| 1413 | __entry->port = port; |
| 1414 | ), |
| 1415 | |
| 1416 | TP_printk("program=%u version=%u protocol=%d port=%u", |
| 1417 | __entry->program, __entry->version, |
| 1418 | __entry->protocol, __entry->port |
| 1419 | ) |
| 1420 | ); |
| 1421 | |
| 1422 | TRACE_EVENT(rpcb_register, |
| 1423 | TP_PROTO( |
| 1424 | u32 program, |
| 1425 | u32 version, |
| 1426 | const char *addr, |
| 1427 | const char *netid |
| 1428 | ), |
| 1429 | |
| 1430 | TP_ARGS(program, version, addr, netid), |
| 1431 | |
| 1432 | TP_STRUCT__entry( |
| 1433 | __field(unsigned int, program) |
| 1434 | __field(unsigned int, version) |
| 1435 | __string(addr, addr) |
| 1436 | __string(netid, netid) |
| 1437 | ), |
| 1438 | |
| 1439 | TP_fast_assign( |
| 1440 | __entry->program = program; |
| 1441 | __entry->version = version; |
| 1442 | __assign_str(addr, addr); |
| 1443 | __assign_str(netid, netid); |
| 1444 | ), |
| 1445 | |
| 1446 | TP_printk("program=%u version=%u addr=%s netid=%s", |
| 1447 | __entry->program, __entry->version, |
| 1448 | __get_str(addr), __get_str(netid) |
| 1449 | ) |
| 1450 | ); |
| 1451 | |
| 1452 | TRACE_EVENT(rpcb_unregister, |
| 1453 | TP_PROTO( |
| 1454 | u32 program, |
| 1455 | u32 version, |
| 1456 | const char *netid |
| 1457 | ), |
| 1458 | |
| 1459 | TP_ARGS(program, version, netid), |
| 1460 | |
| 1461 | TP_STRUCT__entry( |
| 1462 | __field(unsigned int, program) |
| 1463 | __field(unsigned int, version) |
| 1464 | __string(netid, netid) |
| 1465 | ), |
| 1466 | |
| 1467 | TP_fast_assign( |
| 1468 | __entry->program = program; |
| 1469 | __entry->version = version; |
| 1470 | __assign_str(netid, netid); |
| 1471 | ), |
| 1472 | |
| 1473 | TP_printk("program=%u version=%u netid=%s", |
| 1474 | __entry->program, __entry->version, __get_str(netid) |
| 1475 | ) |
| 1476 | ); |
| 1477 | |
Chuck Lever | 5f39d27 | 2021-01-03 14:39:27 -0500 | [diff] [blame] | 1478 | /* Record an xdr_buf containing a fully-formed RPC message */ |
| 1479 | DECLARE_EVENT_CLASS(svc_xdr_msg_class, |
Chuck Lever | c509f15a | 2020-05-12 17:13:28 -0400 | [diff] [blame] | 1480 | TP_PROTO( |
Chuck Lever | c509f15a | 2020-05-12 17:13:28 -0400 | [diff] [blame] | 1481 | const struct xdr_buf *xdr |
| 1482 | ), |
| 1483 | |
Chuck Lever | 5f39d27 | 2021-01-03 14:39:27 -0500 | [diff] [blame] | 1484 | TP_ARGS(xdr), |
Chuck Lever | c509f15a | 2020-05-12 17:13:28 -0400 | [diff] [blame] | 1485 | |
| 1486 | TP_STRUCT__entry( |
| 1487 | __field(u32, xid) |
| 1488 | __field(const void *, head_base) |
| 1489 | __field(size_t, head_len) |
| 1490 | __field(const void *, tail_base) |
| 1491 | __field(size_t, tail_len) |
| 1492 | __field(unsigned int, page_len) |
| 1493 | __field(unsigned int, msg_len) |
| 1494 | ), |
| 1495 | |
| 1496 | TP_fast_assign( |
Chuck Lever | 5f39d27 | 2021-01-03 14:39:27 -0500 | [diff] [blame] | 1497 | __be32 *p = (__be32 *)xdr->head[0].iov_base; |
| 1498 | |
| 1499 | __entry->xid = be32_to_cpu(*p); |
| 1500 | __entry->head_base = p; |
| 1501 | __entry->head_len = xdr->head[0].iov_len; |
| 1502 | __entry->tail_base = xdr->tail[0].iov_base; |
| 1503 | __entry->tail_len = xdr->tail[0].iov_len; |
| 1504 | __entry->page_len = xdr->page_len; |
| 1505 | __entry->msg_len = xdr->len; |
| 1506 | ), |
| 1507 | |
| 1508 | TP_printk("xid=0x%08x head=[%p,%zu] page=%u tail=[%p,%zu] len=%u", |
| 1509 | __entry->xid, |
| 1510 | __entry->head_base, __entry->head_len, __entry->page_len, |
| 1511 | __entry->tail_base, __entry->tail_len, __entry->msg_len |
| 1512 | ) |
| 1513 | ); |
| 1514 | |
| 1515 | #define DEFINE_SVCXDRMSG_EVENT(name) \ |
| 1516 | DEFINE_EVENT(svc_xdr_msg_class, \ |
| 1517 | svc_xdr_##name, \ |
| 1518 | TP_PROTO( \ |
| 1519 | const struct xdr_buf *xdr \ |
| 1520 | ), \ |
| 1521 | TP_ARGS(xdr)) |
| 1522 | |
| 1523 | DEFINE_SVCXDRMSG_EVENT(recvfrom); |
| 1524 | |
| 1525 | /* Record an xdr_buf containing arbitrary data, tagged with an XID */ |
| 1526 | DECLARE_EVENT_CLASS(svc_xdr_buf_class, |
| 1527 | TP_PROTO( |
| 1528 | __be32 xid, |
| 1529 | const struct xdr_buf *xdr |
| 1530 | ), |
| 1531 | |
| 1532 | TP_ARGS(xid, xdr), |
| 1533 | |
| 1534 | TP_STRUCT__entry( |
| 1535 | __field(u32, xid) |
| 1536 | __field(const void *, head_base) |
| 1537 | __field(size_t, head_len) |
| 1538 | __field(const void *, tail_base) |
| 1539 | __field(size_t, tail_len) |
Chuck Lever | 35940a5 | 2021-10-04 10:16:32 -0400 | [diff] [blame] | 1540 | __field(unsigned int, page_base) |
Chuck Lever | 5f39d27 | 2021-01-03 14:39:27 -0500 | [diff] [blame] | 1541 | __field(unsigned int, page_len) |
| 1542 | __field(unsigned int, msg_len) |
| 1543 | ), |
| 1544 | |
| 1545 | TP_fast_assign( |
| 1546 | __entry->xid = be32_to_cpu(xid); |
Chuck Lever | c509f15a | 2020-05-12 17:13:28 -0400 | [diff] [blame] | 1547 | __entry->head_base = xdr->head[0].iov_base; |
| 1548 | __entry->head_len = xdr->head[0].iov_len; |
| 1549 | __entry->tail_base = xdr->tail[0].iov_base; |
| 1550 | __entry->tail_len = xdr->tail[0].iov_len; |
Chuck Lever | 35940a5 | 2021-10-04 10:16:32 -0400 | [diff] [blame] | 1551 | __entry->page_base = xdr->page_base; |
Chuck Lever | c509f15a | 2020-05-12 17:13:28 -0400 | [diff] [blame] | 1552 | __entry->page_len = xdr->page_len; |
| 1553 | __entry->msg_len = xdr->len; |
| 1554 | ), |
| 1555 | |
Chuck Lever | 35940a5 | 2021-10-04 10:16:32 -0400 | [diff] [blame] | 1556 | TP_printk("xid=0x%08x head=[%p,%zu] page=%u(%u) tail=[%p,%zu] len=%u", |
Chuck Lever | c509f15a | 2020-05-12 17:13:28 -0400 | [diff] [blame] | 1557 | __entry->xid, |
Chuck Lever | 35940a5 | 2021-10-04 10:16:32 -0400 | [diff] [blame] | 1558 | __entry->head_base, __entry->head_len, |
| 1559 | __entry->page_len, __entry->page_base, |
| 1560 | __entry->tail_base, __entry->tail_len, |
| 1561 | __entry->msg_len |
Chuck Lever | c509f15a | 2020-05-12 17:13:28 -0400 | [diff] [blame] | 1562 | ) |
| 1563 | ); |
| 1564 | |
| 1565 | #define DEFINE_SVCXDRBUF_EVENT(name) \ |
| 1566 | DEFINE_EVENT(svc_xdr_buf_class, \ |
| 1567 | svc_xdr_##name, \ |
| 1568 | TP_PROTO( \ |
Chuck Lever | 5f39d27 | 2021-01-03 14:39:27 -0500 | [diff] [blame] | 1569 | __be32 xid, \ |
Chuck Lever | c509f15a | 2020-05-12 17:13:28 -0400 | [diff] [blame] | 1570 | const struct xdr_buf *xdr \ |
| 1571 | ), \ |
Chuck Lever | 5f39d27 | 2021-01-03 14:39:27 -0500 | [diff] [blame] | 1572 | TP_ARGS(xid, xdr)) |
Chuck Lever | c509f15a | 2020-05-12 17:13:28 -0400 | [diff] [blame] | 1573 | |
Chuck Lever | c509f15a | 2020-05-12 17:13:28 -0400 | [diff] [blame] | 1574 | DEFINE_SVCXDRBUF_EVENT(sendto); |
| 1575 | |
Chuck Lever | a68d5a50 | 2020-07-24 15:26:47 -0400 | [diff] [blame] | 1576 | /* |
| 1577 | * from include/linux/sunrpc/svc.h |
| 1578 | */ |
| 1579 | #define SVC_RQST_FLAG_LIST \ |
| 1580 | svc_rqst_flag(SECURE) \ |
| 1581 | svc_rqst_flag(LOCAL) \ |
| 1582 | svc_rqst_flag(USEDEFERRAL) \ |
| 1583 | svc_rqst_flag(DROPME) \ |
| 1584 | svc_rqst_flag(SPLICE_OK) \ |
| 1585 | svc_rqst_flag(VICTIM) \ |
| 1586 | svc_rqst_flag(BUSY) \ |
Chuck Lever | 9082e1d | 2021-07-15 15:52:19 -0400 | [diff] [blame] | 1587 | svc_rqst_flag_end(DATA) |
Chuck Lever | a68d5a50 | 2020-07-24 15:26:47 -0400 | [diff] [blame] | 1588 | |
| 1589 | #undef svc_rqst_flag |
| 1590 | #undef svc_rqst_flag_end |
| 1591 | #define svc_rqst_flag(x) TRACE_DEFINE_ENUM(RQ_##x); |
| 1592 | #define svc_rqst_flag_end(x) TRACE_DEFINE_ENUM(RQ_##x); |
| 1593 | |
| 1594 | SVC_RQST_FLAG_LIST |
| 1595 | |
| 1596 | #undef svc_rqst_flag |
| 1597 | #undef svc_rqst_flag_end |
| 1598 | #define svc_rqst_flag(x) { BIT(RQ_##x), #x }, |
| 1599 | #define svc_rqst_flag_end(x) { BIT(RQ_##x), #x } |
| 1600 | |
Jeff Layton | 30660e04b | 2014-11-19 07:51:16 -0500 | [diff] [blame] | 1601 | #define show_rqstp_flags(flags) \ |
Chuck Lever | a68d5a50 | 2020-07-24 15:26:47 -0400 | [diff] [blame] | 1602 | __print_flags(flags, "|", SVC_RQST_FLAG_LIST) |
Jeff Layton | 4d152e2 | 2014-11-19 07:51:14 -0500 | [diff] [blame] | 1603 | |
Chuck Lever | d88ff95 | 2020-04-15 09:47:41 -0400 | [diff] [blame] | 1604 | TRACE_DEFINE_ENUM(SVC_GARBAGE); |
| 1605 | TRACE_DEFINE_ENUM(SVC_SYSERR); |
| 1606 | TRACE_DEFINE_ENUM(SVC_VALID); |
| 1607 | TRACE_DEFINE_ENUM(SVC_NEGATIVE); |
| 1608 | TRACE_DEFINE_ENUM(SVC_OK); |
| 1609 | TRACE_DEFINE_ENUM(SVC_DROP); |
| 1610 | TRACE_DEFINE_ENUM(SVC_CLOSE); |
| 1611 | TRACE_DEFINE_ENUM(SVC_DENIED); |
| 1612 | TRACE_DEFINE_ENUM(SVC_PENDING); |
| 1613 | TRACE_DEFINE_ENUM(SVC_COMPLETE); |
| 1614 | |
Chuck Lever | ff27e9f | 2019-10-24 09:34:10 -0400 | [diff] [blame] | 1615 | #define svc_show_status(status) \ |
| 1616 | __print_symbolic(status, \ |
| 1617 | { SVC_GARBAGE, "SVC_GARBAGE" }, \ |
| 1618 | { SVC_SYSERR, "SVC_SYSERR" }, \ |
| 1619 | { SVC_VALID, "SVC_VALID" }, \ |
| 1620 | { SVC_NEGATIVE, "SVC_NEGATIVE" }, \ |
| 1621 | { SVC_OK, "SVC_OK" }, \ |
| 1622 | { SVC_DROP, "SVC_DROP" }, \ |
| 1623 | { SVC_CLOSE, "SVC_CLOSE" }, \ |
| 1624 | { SVC_DENIED, "SVC_DENIED" }, \ |
| 1625 | { SVC_PENDING, "SVC_PENDING" }, \ |
| 1626 | { SVC_COMPLETE, "SVC_COMPLETE" }) |
| 1627 | |
| 1628 | TRACE_EVENT(svc_authenticate, |
Chuck Lever | 438623a | 2021-07-15 15:52:06 -0400 | [diff] [blame] | 1629 | TP_PROTO(const struct svc_rqst *rqst, int auth_res), |
Chuck Lever | ff27e9f | 2019-10-24 09:34:10 -0400 | [diff] [blame] | 1630 | |
Chuck Lever | 438623a | 2021-07-15 15:52:06 -0400 | [diff] [blame] | 1631 | TP_ARGS(rqst, auth_res), |
Chuck Lever | ff27e9f | 2019-10-24 09:34:10 -0400 | [diff] [blame] | 1632 | |
| 1633 | TP_STRUCT__entry( |
| 1634 | __field(u32, xid) |
| 1635 | __field(unsigned long, svc_status) |
| 1636 | __field(unsigned long, auth_stat) |
| 1637 | ), |
| 1638 | |
| 1639 | TP_fast_assign( |
| 1640 | __entry->xid = be32_to_cpu(rqst->rq_xid); |
| 1641 | __entry->svc_status = auth_res; |
Chuck Lever | 438623a | 2021-07-15 15:52:06 -0400 | [diff] [blame] | 1642 | __entry->auth_stat = be32_to_cpu(rqst->rq_auth_stat); |
Chuck Lever | ff27e9f | 2019-10-24 09:34:10 -0400 | [diff] [blame] | 1643 | ), |
| 1644 | |
| 1645 | TP_printk("xid=0x%08x auth_res=%s auth_stat=%s", |
| 1646 | __entry->xid, svc_show_status(__entry->svc_status), |
| 1647 | rpc_show_auth_stat(__entry->auth_stat)) |
| 1648 | ); |
| 1649 | |
Chuck Lever | 0b9547b | 2018-03-27 10:51:22 -0400 | [diff] [blame] | 1650 | TRACE_EVENT(svc_process, |
| 1651 | TP_PROTO(const struct svc_rqst *rqst, const char *name), |
| 1652 | |
| 1653 | TP_ARGS(rqst, name), |
| 1654 | |
| 1655 | TP_STRUCT__entry( |
| 1656 | __field(u32, xid) |
| 1657 | __field(u32, vers) |
| 1658 | __field(u32, proc) |
| 1659 | __string(service, name) |
Chuck Lever | 5c11720 | 2021-08-05 15:11:24 -0400 | [diff] [blame] | 1660 | __string(procedure, svc_proc_name(rqst)) |
Vasily Averin | d4b09ac | 2018-12-24 14:44:52 +0300 | [diff] [blame] | 1661 | __string(addr, rqst->rq_xprt ? |
| 1662 | rqst->rq_xprt->xpt_remotebuf : "(null)") |
Chuck Lever | 0b9547b | 2018-03-27 10:51:22 -0400 | [diff] [blame] | 1663 | ), |
| 1664 | |
| 1665 | TP_fast_assign( |
| 1666 | __entry->xid = be32_to_cpu(rqst->rq_xid); |
| 1667 | __entry->vers = rqst->rq_vers; |
| 1668 | __entry->proc = rqst->rq_proc; |
| 1669 | __assign_str(service, name); |
Chuck Lever | 5c11720 | 2021-08-05 15:11:24 -0400 | [diff] [blame] | 1670 | __assign_str(procedure, svc_proc_name(rqst)); |
Vasily Averin | d4b09ac | 2018-12-24 14:44:52 +0300 | [diff] [blame] | 1671 | __assign_str(addr, rqst->rq_xprt ? |
| 1672 | rqst->rq_xprt->xpt_remotebuf : "(null)"); |
Chuck Lever | 0b9547b | 2018-03-27 10:51:22 -0400 | [diff] [blame] | 1673 | ), |
| 1674 | |
Chuck Lever | 89ff874 | 2020-12-03 10:22:09 -0500 | [diff] [blame] | 1675 | TP_printk("addr=%s xid=0x%08x service=%s vers=%u proc=%s", |
Chuck Lever | 0b9547b | 2018-03-27 10:51:22 -0400 | [diff] [blame] | 1676 | __get_str(addr), __entry->xid, |
Chuck Lever | 89ff874 | 2020-12-03 10:22:09 -0500 | [diff] [blame] | 1677 | __get_str(service), __entry->vers, |
| 1678 | __get_str(procedure) |
| 1679 | ) |
Chuck Lever | 0b9547b | 2018-03-27 10:51:22 -0400 | [diff] [blame] | 1680 | ); |
| 1681 | |
Trond Myklebust | 104f635 | 2016-06-24 10:55:46 -0400 | [diff] [blame] | 1682 | DECLARE_EVENT_CLASS(svc_rqst_event, |
| 1683 | |
Chuck Lever | dc5820b | 2018-12-19 11:00:16 -0500 | [diff] [blame] | 1684 | TP_PROTO( |
| 1685 | const struct svc_rqst *rqst |
| 1686 | ), |
Trond Myklebust | 104f635 | 2016-06-24 10:55:46 -0400 | [diff] [blame] | 1687 | |
| 1688 | TP_ARGS(rqst), |
| 1689 | |
| 1690 | TP_STRUCT__entry( |
Chuck Lever | a30ccf1 | 2017-10-20 10:35:18 -0400 | [diff] [blame] | 1691 | __field(u32, xid) |
Trond Myklebust | 104f635 | 2016-06-24 10:55:46 -0400 | [diff] [blame] | 1692 | __field(unsigned long, flags) |
Chuck Lever | ece200d | 2018-03-27 10:51:00 -0400 | [diff] [blame] | 1693 | __string(addr, rqst->rq_xprt->xpt_remotebuf) |
Trond Myklebust | 104f635 | 2016-06-24 10:55:46 -0400 | [diff] [blame] | 1694 | ), |
| 1695 | |
| 1696 | TP_fast_assign( |
Chuck Lever | a30ccf1 | 2017-10-20 10:35:18 -0400 | [diff] [blame] | 1697 | __entry->xid = be32_to_cpu(rqst->rq_xid); |
Trond Myklebust | 104f635 | 2016-06-24 10:55:46 -0400 | [diff] [blame] | 1698 | __entry->flags = rqst->rq_flags; |
Chuck Lever | ece200d | 2018-03-27 10:51:00 -0400 | [diff] [blame] | 1699 | __assign_str(addr, rqst->rq_xprt->xpt_remotebuf); |
Trond Myklebust | 104f635 | 2016-06-24 10:55:46 -0400 | [diff] [blame] | 1700 | ), |
| 1701 | |
Chuck Lever | ece200d | 2018-03-27 10:51:00 -0400 | [diff] [blame] | 1702 | TP_printk("addr=%s xid=0x%08x flags=%s", |
| 1703 | __get_str(addr), __entry->xid, |
| 1704 | show_rqstp_flags(__entry->flags)) |
Trond Myklebust | 104f635 | 2016-06-24 10:55:46 -0400 | [diff] [blame] | 1705 | ); |
Chuck Lever | dc5820b | 2018-12-19 11:00:16 -0500 | [diff] [blame] | 1706 | #define DEFINE_SVC_RQST_EVENT(name) \ |
| 1707 | DEFINE_EVENT(svc_rqst_event, svc_##name, \ |
| 1708 | TP_PROTO( \ |
| 1709 | const struct svc_rqst *rqst \ |
| 1710 | ), \ |
| 1711 | TP_ARGS(rqst)) |
Trond Myklebust | 104f635 | 2016-06-24 10:55:46 -0400 | [diff] [blame] | 1712 | |
Chuck Lever | dc5820b | 2018-12-19 11:00:16 -0500 | [diff] [blame] | 1713 | DEFINE_SVC_RQST_EVENT(defer); |
| 1714 | DEFINE_SVC_RQST_EVENT(drop); |
Trond Myklebust | 104f635 | 2016-06-24 10:55:46 -0400 | [diff] [blame] | 1715 | |
Jeff Layton | 860a0d9 | 2014-10-28 14:24:12 -0400 | [diff] [blame] | 1716 | DECLARE_EVENT_CLASS(svc_rqst_status, |
| 1717 | |
| 1718 | TP_PROTO(struct svc_rqst *rqst, int status), |
| 1719 | |
| 1720 | TP_ARGS(rqst, status), |
| 1721 | |
| 1722 | TP_STRUCT__entry( |
Chuck Lever | a30ccf1 | 2017-10-20 10:35:18 -0400 | [diff] [blame] | 1723 | __field(u32, xid) |
Jeff Layton | 860a0d9 | 2014-10-28 14:24:12 -0400 | [diff] [blame] | 1724 | __field(int, status) |
Jeff Layton | 4d152e2 | 2014-11-19 07:51:14 -0500 | [diff] [blame] | 1725 | __field(unsigned long, flags) |
Chuck Lever | ece200d | 2018-03-27 10:51:00 -0400 | [diff] [blame] | 1726 | __string(addr, rqst->rq_xprt->xpt_remotebuf) |
Jeff Layton | 860a0d9 | 2014-10-28 14:24:12 -0400 | [diff] [blame] | 1727 | ), |
| 1728 | |
| 1729 | TP_fast_assign( |
Chuck Lever | a30ccf1 | 2017-10-20 10:35:18 -0400 | [diff] [blame] | 1730 | __entry->xid = be32_to_cpu(rqst->rq_xid); |
Jeff Layton | 860a0d9 | 2014-10-28 14:24:12 -0400 | [diff] [blame] | 1731 | __entry->status = status; |
Jeff Layton | 4d152e2 | 2014-11-19 07:51:14 -0500 | [diff] [blame] | 1732 | __entry->flags = rqst->rq_flags; |
Chuck Lever | ece200d | 2018-03-27 10:51:00 -0400 | [diff] [blame] | 1733 | __assign_str(addr, rqst->rq_xprt->xpt_remotebuf); |
Jeff Layton | 860a0d9 | 2014-10-28 14:24:12 -0400 | [diff] [blame] | 1734 | ), |
| 1735 | |
Chuck Lever | ece200d | 2018-03-27 10:51:00 -0400 | [diff] [blame] | 1736 | TP_printk("addr=%s xid=0x%08x status=%d flags=%s", |
| 1737 | __get_str(addr), __entry->xid, |
| 1738 | __entry->status, show_rqstp_flags(__entry->flags)) |
Jeff Layton | 860a0d9 | 2014-10-28 14:24:12 -0400 | [diff] [blame] | 1739 | ); |
| 1740 | |
Jeff Layton | 860a0d9 | 2014-10-28 14:24:12 -0400 | [diff] [blame] | 1741 | DEFINE_EVENT(svc_rqst_status, svc_send, |
| 1742 | TP_PROTO(struct svc_rqst *rqst, int status), |
| 1743 | TP_ARGS(rqst, status)); |
| 1744 | |
Jeff Layton | 83a712e | 2014-11-21 14:19:31 -0500 | [diff] [blame] | 1745 | #define show_svc_xprt_flags(flags) \ |
| 1746 | __print_flags(flags, "|", \ |
| 1747 | { (1UL << XPT_BUSY), "XPT_BUSY"}, \ |
| 1748 | { (1UL << XPT_CONN), "XPT_CONN"}, \ |
| 1749 | { (1UL << XPT_CLOSE), "XPT_CLOSE"}, \ |
| 1750 | { (1UL << XPT_DATA), "XPT_DATA"}, \ |
| 1751 | { (1UL << XPT_TEMP), "XPT_TEMP"}, \ |
| 1752 | { (1UL << XPT_DEAD), "XPT_DEAD"}, \ |
| 1753 | { (1UL << XPT_CHNGBUF), "XPT_CHNGBUF"}, \ |
| 1754 | { (1UL << XPT_DEFERRED), "XPT_DEFERRED"}, \ |
| 1755 | { (1UL << XPT_OLD), "XPT_OLD"}, \ |
| 1756 | { (1UL << XPT_LISTENER), "XPT_LISTENER"}, \ |
| 1757 | { (1UL << XPT_CACHE_AUTH), "XPT_CACHE_AUTH"}, \ |
Chuck Lever | 03edb90 | 2018-03-27 10:49:53 -0400 | [diff] [blame] | 1758 | { (1UL << XPT_LOCAL), "XPT_LOCAL"}, \ |
| 1759 | { (1UL << XPT_KILL_TEMP), "XPT_KILL_TEMP"}, \ |
| 1760 | { (1UL << XPT_CONG_CTRL), "XPT_CONG_CTRL"}) |
Jeff Layton | 83a712e | 2014-11-21 14:19:31 -0500 | [diff] [blame] | 1761 | |
Chuck Lever | 4b8f380 | 2020-04-28 17:13:32 -0400 | [diff] [blame] | 1762 | TRACE_EVENT(svc_xprt_create_err, |
| 1763 | TP_PROTO( |
| 1764 | const char *program, |
| 1765 | const char *protocol, |
| 1766 | struct sockaddr *sap, |
Chuck Lever | dc6c6fb | 2022-01-09 13:26:51 -0500 | [diff] [blame] | 1767 | size_t salen, |
Chuck Lever | 4b8f380 | 2020-04-28 17:13:32 -0400 | [diff] [blame] | 1768 | const struct svc_xprt *xprt |
| 1769 | ), |
| 1770 | |
Chuck Lever | dc6c6fb | 2022-01-09 13:26:51 -0500 | [diff] [blame] | 1771 | TP_ARGS(program, protocol, sap, salen, xprt), |
Chuck Lever | 4b8f380 | 2020-04-28 17:13:32 -0400 | [diff] [blame] | 1772 | |
| 1773 | TP_STRUCT__entry( |
| 1774 | __field(long, error) |
| 1775 | __string(program, program) |
| 1776 | __string(protocol, protocol) |
| 1777 | __array(unsigned char, addr, sizeof(struct sockaddr_in6)) |
| 1778 | ), |
| 1779 | |
| 1780 | TP_fast_assign( |
| 1781 | __entry->error = PTR_ERR(xprt); |
| 1782 | __assign_str(program, program); |
| 1783 | __assign_str(protocol, protocol); |
Chuck Lever | dc6c6fb | 2022-01-09 13:26:51 -0500 | [diff] [blame] | 1784 | memcpy(__entry->addr, sap, min(salen, sizeof(__entry->addr))); |
Chuck Lever | 4b8f380 | 2020-04-28 17:13:32 -0400 | [diff] [blame] | 1785 | ), |
| 1786 | |
| 1787 | TP_printk("addr=%pISpc program=%s protocol=%s error=%ld", |
| 1788 | __entry->addr, __get_str(program), __get_str(protocol), |
| 1789 | __entry->error) |
| 1790 | ); |
| 1791 | |
Chuck Lever | 5089f3d | 2021-10-19 15:17:21 -0400 | [diff] [blame] | 1792 | TRACE_EVENT(svc_xprt_enqueue, |
Jeff Layton | 83a712e | 2014-11-21 14:19:31 -0500 | [diff] [blame] | 1793 | TP_PROTO(struct svc_xprt *xprt, struct svc_rqst *rqst), |
| 1794 | |
| 1795 | TP_ARGS(xprt, rqst), |
| 1796 | |
| 1797 | TP_STRUCT__entry( |
Pratyush Anand | 051ac38 | 2015-08-27 10:01:33 +0530 | [diff] [blame] | 1798 | __field(int, pid) |
| 1799 | __field(unsigned long, flags) |
Chuck Lever | ece200d | 2018-03-27 10:51:00 -0400 | [diff] [blame] | 1800 | __string(addr, xprt->xpt_remotebuf) |
Jeff Layton | 83a712e | 2014-11-21 14:19:31 -0500 | [diff] [blame] | 1801 | ), |
| 1802 | |
| 1803 | TP_fast_assign( |
Pratyush Anand | 051ac38 | 2015-08-27 10:01:33 +0530 | [diff] [blame] | 1804 | __entry->pid = rqst? rqst->rq_task->pid : 0; |
Chuck Lever | ece200d | 2018-03-27 10:51:00 -0400 | [diff] [blame] | 1805 | __entry->flags = xprt->xpt_flags; |
| 1806 | __assign_str(addr, xprt->xpt_remotebuf); |
Jeff Layton | 83a712e | 2014-11-21 14:19:31 -0500 | [diff] [blame] | 1807 | ), |
| 1808 | |
Chuck Lever | e3e6762 | 2020-04-28 17:38:13 -0400 | [diff] [blame] | 1809 | TP_printk("addr=%s pid=%d flags=%s", __get_str(addr), |
| 1810 | __entry->pid, show_svc_xprt_flags(__entry->flags)) |
Jeff Layton | 83a712e | 2014-11-21 14:19:31 -0500 | [diff] [blame] | 1811 | ); |
| 1812 | |
Trond Myklebust | 82ea2d7 | 2016-06-24 10:55:45 -0400 | [diff] [blame] | 1813 | DECLARE_EVENT_CLASS(svc_xprt_event, |
Jeff Layton | 83a712e | 2014-11-21 14:19:31 -0500 | [diff] [blame] | 1814 | TP_PROTO(struct svc_xprt *xprt), |
| 1815 | |
| 1816 | TP_ARGS(xprt), |
| 1817 | |
| 1818 | TP_STRUCT__entry( |
Jeff Layton | 83a712e | 2014-11-21 14:19:31 -0500 | [diff] [blame] | 1819 | __field(unsigned long, flags) |
Chuck Lever | ece200d | 2018-03-27 10:51:00 -0400 | [diff] [blame] | 1820 | __string(addr, xprt->xpt_remotebuf) |
Jeff Layton | 83a712e | 2014-11-21 14:19:31 -0500 | [diff] [blame] | 1821 | ), |
| 1822 | |
| 1823 | TP_fast_assign( |
Chuck Lever | caa3e106d | 2018-03-27 10:50:07 -0400 | [diff] [blame] | 1824 | __entry->flags = xprt->xpt_flags; |
Chuck Lever | ece200d | 2018-03-27 10:51:00 -0400 | [diff] [blame] | 1825 | __assign_str(addr, xprt->xpt_remotebuf); |
Jeff Layton | 83a712e | 2014-11-21 14:19:31 -0500 | [diff] [blame] | 1826 | ), |
| 1827 | |
Chuck Lever | e3e6762 | 2020-04-28 17:38:13 -0400 | [diff] [blame] | 1828 | TP_printk("addr=%s flags=%s", __get_str(addr), |
| 1829 | show_svc_xprt_flags(__entry->flags)) |
Jeff Layton | 83a712e | 2014-11-21 14:19:31 -0500 | [diff] [blame] | 1830 | ); |
| 1831 | |
Chuck Lever | 11bbb0f | 2020-03-17 17:41:43 -0400 | [diff] [blame] | 1832 | #define DEFINE_SVC_XPRT_EVENT(name) \ |
| 1833 | DEFINE_EVENT(svc_xprt_event, svc_xprt_##name, \ |
| 1834 | TP_PROTO( \ |
| 1835 | struct svc_xprt *xprt \ |
| 1836 | ), \ |
| 1837 | TP_ARGS(xprt)) |
| 1838 | |
| 1839 | DEFINE_SVC_XPRT_EVENT(no_write_space); |
| 1840 | DEFINE_SVC_XPRT_EVENT(close); |
| 1841 | DEFINE_SVC_XPRT_EVENT(detach); |
| 1842 | DEFINE_SVC_XPRT_EVENT(free); |
| 1843 | |
| 1844 | TRACE_EVENT(svc_xprt_accept, |
| 1845 | TP_PROTO( |
| 1846 | const struct svc_xprt *xprt, |
| 1847 | const char *service |
| 1848 | ), |
| 1849 | |
| 1850 | TP_ARGS(xprt, service), |
| 1851 | |
| 1852 | TP_STRUCT__entry( |
| 1853 | __string(addr, xprt->xpt_remotebuf) |
| 1854 | __string(protocol, xprt->xpt_class->xcl_name) |
| 1855 | __string(service, service) |
| 1856 | ), |
| 1857 | |
| 1858 | TP_fast_assign( |
| 1859 | __assign_str(addr, xprt->xpt_remotebuf); |
Joe Perches | 78c14b3 | 2021-06-12 08:42:27 -0700 | [diff] [blame] | 1860 | __assign_str(protocol, xprt->xpt_class->xcl_name); |
Chuck Lever | 11bbb0f | 2020-03-17 17:41:43 -0400 | [diff] [blame] | 1861 | __assign_str(service, service); |
| 1862 | ), |
| 1863 | |
| 1864 | TP_printk("addr=%s protocol=%s service=%s", |
| 1865 | __get_str(addr), __get_str(protocol), __get_str(service) |
| 1866 | ) |
| 1867 | ); |
Trond Myklebust | 82ea2d7 | 2016-06-24 10:55:45 -0400 | [diff] [blame] | 1868 | |
Chuck Lever | 55f5088 | 2018-03-27 10:52:27 -0400 | [diff] [blame] | 1869 | TRACE_EVENT(svc_xprt_dequeue, |
| 1870 | TP_PROTO(struct svc_rqst *rqst), |
| 1871 | |
| 1872 | TP_ARGS(rqst), |
| 1873 | |
| 1874 | TP_STRUCT__entry( |
Chuck Lever | 55f5088 | 2018-03-27 10:52:27 -0400 | [diff] [blame] | 1875 | __field(unsigned long, flags) |
| 1876 | __field(unsigned long, wakeup) |
| 1877 | __string(addr, rqst->rq_xprt->xpt_remotebuf) |
| 1878 | ), |
| 1879 | |
| 1880 | TP_fast_assign( |
Chuck Lever | 55f5088 | 2018-03-27 10:52:27 -0400 | [diff] [blame] | 1881 | __entry->flags = rqst->rq_xprt->xpt_flags; |
| 1882 | __entry->wakeup = ktime_to_us(ktime_sub(ktime_get(), |
| 1883 | rqst->rq_qtime)); |
| 1884 | __assign_str(addr, rqst->rq_xprt->xpt_remotebuf); |
| 1885 | ), |
| 1886 | |
Chuck Lever | e3e6762 | 2020-04-28 17:38:13 -0400 | [diff] [blame] | 1887 | TP_printk("addr=%s flags=%s wakeup-us=%lu", __get_str(addr), |
| 1888 | show_svc_xprt_flags(__entry->flags), __entry->wakeup) |
Chuck Lever | 55f5088 | 2018-03-27 10:52:27 -0400 | [diff] [blame] | 1889 | ); |
| 1890 | |
Jeff Layton | 83a712e | 2014-11-21 14:19:31 -0500 | [diff] [blame] | 1891 | TRACE_EVENT(svc_wake_up, |
| 1892 | TP_PROTO(int pid), |
| 1893 | |
| 1894 | TP_ARGS(pid), |
| 1895 | |
| 1896 | TP_STRUCT__entry( |
| 1897 | __field(int, pid) |
| 1898 | ), |
| 1899 | |
| 1900 | TP_fast_assign( |
| 1901 | __entry->pid = pid; |
| 1902 | ), |
| 1903 | |
| 1904 | TP_printk("pid=%d", __entry->pid) |
| 1905 | ); |
| 1906 | |
Chuck Lever | 22a027e8 | 2021-10-04 10:16:26 -0400 | [diff] [blame] | 1907 | TRACE_EVENT(svc_alloc_arg_err, |
| 1908 | TP_PROTO( |
| 1909 | unsigned int pages |
| 1910 | ), |
| 1911 | |
| 1912 | TP_ARGS(pages), |
| 1913 | |
| 1914 | TP_STRUCT__entry( |
| 1915 | __field(unsigned int, pages) |
| 1916 | ), |
| 1917 | |
| 1918 | TP_fast_assign( |
| 1919 | __entry->pages = pages; |
| 1920 | ), |
| 1921 | |
| 1922 | TP_printk("pages=%u", __entry->pages) |
| 1923 | ); |
| 1924 | |
Chuck Lever | aaba72c | 2018-03-27 10:51:39 -0400 | [diff] [blame] | 1925 | TRACE_EVENT(svc_stats_latency, |
| 1926 | TP_PROTO(const struct svc_rqst *rqst), |
| 1927 | |
| 1928 | TP_ARGS(rqst), |
| 1929 | |
| 1930 | TP_STRUCT__entry( |
| 1931 | __field(u32, xid) |
| 1932 | __field(unsigned long, execute) |
Chuck Lever | 5c11720 | 2021-08-05 15:11:24 -0400 | [diff] [blame] | 1933 | __string(procedure, svc_proc_name(rqst)) |
Chuck Lever | aaba72c | 2018-03-27 10:51:39 -0400 | [diff] [blame] | 1934 | __string(addr, rqst->rq_xprt->xpt_remotebuf) |
| 1935 | ), |
| 1936 | |
| 1937 | TP_fast_assign( |
| 1938 | __entry->xid = be32_to_cpu(rqst->rq_xid); |
| 1939 | __entry->execute = ktime_to_us(ktime_sub(ktime_get(), |
| 1940 | rqst->rq_stime)); |
Chuck Lever | 5c11720 | 2021-08-05 15:11:24 -0400 | [diff] [blame] | 1941 | __assign_str(procedure, svc_proc_name(rqst)); |
Chuck Lever | aaba72c | 2018-03-27 10:51:39 -0400 | [diff] [blame] | 1942 | __assign_str(addr, rqst->rq_xprt->xpt_remotebuf); |
| 1943 | ), |
| 1944 | |
Chuck Lever | 89ff874 | 2020-12-03 10:22:09 -0500 | [diff] [blame] | 1945 | TP_printk("addr=%s xid=0x%08x proc=%s execute-us=%lu", |
| 1946 | __get_str(addr), __entry->xid, __get_str(procedure), |
| 1947 | __entry->execute) |
Chuck Lever | aaba72c | 2018-03-27 10:51:39 -0400 | [diff] [blame] | 1948 | ); |
Trond Myklebust | 104f635 | 2016-06-24 10:55:46 -0400 | [diff] [blame] | 1949 | |
| 1950 | DECLARE_EVENT_CLASS(svc_deferred_event, |
Chuck Lever | dc5820b | 2018-12-19 11:00:16 -0500 | [diff] [blame] | 1951 | TP_PROTO( |
| 1952 | const struct svc_deferred_req *dr |
| 1953 | ), |
Trond Myklebust | 104f635 | 2016-06-24 10:55:46 -0400 | [diff] [blame] | 1954 | |
| 1955 | TP_ARGS(dr), |
| 1956 | |
| 1957 | TP_STRUCT__entry( |
Chuck Lever | 8954c5c | 2020-04-15 09:05:26 -0400 | [diff] [blame] | 1958 | __field(const void *, dr) |
Chuck Lever | a30ccf1 | 2017-10-20 10:35:18 -0400 | [diff] [blame] | 1959 | __field(u32, xid) |
Chuck Lever | ece200d | 2018-03-27 10:51:00 -0400 | [diff] [blame] | 1960 | __string(addr, dr->xprt->xpt_remotebuf) |
Trond Myklebust | 104f635 | 2016-06-24 10:55:46 -0400 | [diff] [blame] | 1961 | ), |
| 1962 | |
| 1963 | TP_fast_assign( |
Chuck Lever | 8954c5c | 2020-04-15 09:05:26 -0400 | [diff] [blame] | 1964 | __entry->dr = dr; |
Chuck Lever | a30ccf1 | 2017-10-20 10:35:18 -0400 | [diff] [blame] | 1965 | __entry->xid = be32_to_cpu(*(__be32 *)(dr->args + |
| 1966 | (dr->xprt_hlen>>2))); |
Chuck Lever | ece200d | 2018-03-27 10:51:00 -0400 | [diff] [blame] | 1967 | __assign_str(addr, dr->xprt->xpt_remotebuf); |
Trond Myklebust | 104f635 | 2016-06-24 10:55:46 -0400 | [diff] [blame] | 1968 | ), |
| 1969 | |
Chuck Lever | 8954c5c | 2020-04-15 09:05:26 -0400 | [diff] [blame] | 1970 | TP_printk("addr=%s dr=%p xid=0x%08x", __get_str(addr), __entry->dr, |
| 1971 | __entry->xid) |
Trond Myklebust | 104f635 | 2016-06-24 10:55:46 -0400 | [diff] [blame] | 1972 | ); |
Chuck Lever | 8954c5c | 2020-04-15 09:05:26 -0400 | [diff] [blame] | 1973 | |
Chuck Lever | dc5820b | 2018-12-19 11:00:16 -0500 | [diff] [blame] | 1974 | #define DEFINE_SVC_DEFERRED_EVENT(name) \ |
Chuck Lever | 8954c5c | 2020-04-15 09:05:26 -0400 | [diff] [blame] | 1975 | DEFINE_EVENT(svc_deferred_event, svc_defer_##name, \ |
Chuck Lever | dc5820b | 2018-12-19 11:00:16 -0500 | [diff] [blame] | 1976 | TP_PROTO( \ |
| 1977 | const struct svc_deferred_req *dr \ |
| 1978 | ), \ |
| 1979 | TP_ARGS(dr)) |
Trond Myklebust | 104f635 | 2016-06-24 10:55:46 -0400 | [diff] [blame] | 1980 | |
Chuck Lever | dc5820b | 2018-12-19 11:00:16 -0500 | [diff] [blame] | 1981 | DEFINE_SVC_DEFERRED_EVENT(drop); |
Chuck Lever | 8954c5c | 2020-04-15 09:05:26 -0400 | [diff] [blame] | 1982 | DEFINE_SVC_DEFERRED_EVENT(queue); |
| 1983 | DEFINE_SVC_DEFERRED_EVENT(recv); |
Chuck Lever | dc5820b | 2018-12-19 11:00:16 -0500 | [diff] [blame] | 1984 | |
Chuck Lever | 998024d | 2020-03-17 15:06:31 -0400 | [diff] [blame] | 1985 | TRACE_EVENT(svcsock_new_socket, |
| 1986 | TP_PROTO( |
| 1987 | const struct socket *socket |
| 1988 | ), |
| 1989 | |
| 1990 | TP_ARGS(socket), |
| 1991 | |
| 1992 | TP_STRUCT__entry( |
| 1993 | __field(unsigned long, type) |
| 1994 | __field(unsigned long, family) |
| 1995 | __field(bool, listener) |
| 1996 | ), |
| 1997 | |
| 1998 | TP_fast_assign( |
| 1999 | __entry->type = socket->type; |
| 2000 | __entry->family = socket->sk->sk_family; |
| 2001 | __entry->listener = (socket->sk->sk_state == TCP_LISTEN); |
| 2002 | ), |
| 2003 | |
| 2004 | TP_printk("type=%s family=%s%s", |
| 2005 | show_socket_type(__entry->type), |
| 2006 | rpc_show_address_family(__entry->family), |
| 2007 | __entry->listener ? " (listener)" : "" |
| 2008 | ) |
| 2009 | ); |
| 2010 | |
Chuck Lever | a5cda73 | 2020-03-16 14:53:04 -0400 | [diff] [blame] | 2011 | TRACE_EVENT(svcsock_marker, |
| 2012 | TP_PROTO( |
| 2013 | const struct svc_xprt *xprt, |
| 2014 | __be32 marker |
| 2015 | ), |
| 2016 | |
| 2017 | TP_ARGS(xprt, marker), |
| 2018 | |
| 2019 | TP_STRUCT__entry( |
| 2020 | __field(unsigned int, length) |
| 2021 | __field(bool, last) |
| 2022 | __string(addr, xprt->xpt_remotebuf) |
| 2023 | ), |
| 2024 | |
| 2025 | TP_fast_assign( |
| 2026 | __entry->length = be32_to_cpu(marker) & RPC_FRAGMENT_SIZE_MASK; |
| 2027 | __entry->last = be32_to_cpu(marker) & RPC_LAST_STREAM_FRAGMENT; |
| 2028 | __assign_str(addr, xprt->xpt_remotebuf); |
| 2029 | ), |
| 2030 | |
| 2031 | TP_printk("addr=%s length=%u%s", __get_str(addr), |
| 2032 | __entry->length, __entry->last ? " (last)" : "") |
| 2033 | ); |
| 2034 | |
Chuck Lever | 998024d | 2020-03-17 15:06:31 -0400 | [diff] [blame] | 2035 | DECLARE_EVENT_CLASS(svcsock_class, |
| 2036 | TP_PROTO( |
| 2037 | const struct svc_xprt *xprt, |
| 2038 | ssize_t result |
| 2039 | ), |
| 2040 | |
| 2041 | TP_ARGS(xprt, result), |
| 2042 | |
| 2043 | TP_STRUCT__entry( |
| 2044 | __field(ssize_t, result) |
| 2045 | __field(unsigned long, flags) |
| 2046 | __string(addr, xprt->xpt_remotebuf) |
| 2047 | ), |
| 2048 | |
| 2049 | TP_fast_assign( |
| 2050 | __entry->result = result; |
| 2051 | __entry->flags = xprt->xpt_flags; |
| 2052 | __assign_str(addr, xprt->xpt_remotebuf); |
| 2053 | ), |
| 2054 | |
| 2055 | TP_printk("addr=%s result=%zd flags=%s", __get_str(addr), |
| 2056 | __entry->result, show_svc_xprt_flags(__entry->flags) |
| 2057 | ) |
| 2058 | ); |
| 2059 | |
| 2060 | #define DEFINE_SVCSOCK_EVENT(name) \ |
| 2061 | DEFINE_EVENT(svcsock_class, svcsock_##name, \ |
| 2062 | TP_PROTO( \ |
| 2063 | const struct svc_xprt *xprt, \ |
| 2064 | ssize_t result \ |
| 2065 | ), \ |
| 2066 | TP_ARGS(xprt, result)) |
| 2067 | |
| 2068 | DEFINE_SVCSOCK_EVENT(udp_send); |
Chuck Lever | fff1ebb | 2020-05-20 17:30:24 -0400 | [diff] [blame] | 2069 | DEFINE_SVCSOCK_EVENT(udp_recv); |
| 2070 | DEFINE_SVCSOCK_EVENT(udp_recv_err); |
Chuck Lever | 998024d | 2020-03-17 15:06:31 -0400 | [diff] [blame] | 2071 | DEFINE_SVCSOCK_EVENT(tcp_send); |
Chuck Lever | 7dae1dd | 2020-05-20 13:41:02 -0400 | [diff] [blame] | 2072 | DEFINE_SVCSOCK_EVENT(tcp_recv); |
Chuck Lever | 6be8c59 | 2020-05-20 12:29:13 -0400 | [diff] [blame] | 2073 | DEFINE_SVCSOCK_EVENT(tcp_recv_eagain); |
| 2074 | DEFINE_SVCSOCK_EVENT(tcp_recv_err); |
Chuck Lever | 998024d | 2020-03-17 15:06:31 -0400 | [diff] [blame] | 2075 | DEFINE_SVCSOCK_EVENT(data_ready); |
| 2076 | DEFINE_SVCSOCK_EVENT(write_space); |
| 2077 | |
Chuck Lever | 6be8c59 | 2020-05-20 12:29:13 -0400 | [diff] [blame] | 2078 | TRACE_EVENT(svcsock_tcp_recv_short, |
| 2079 | TP_PROTO( |
| 2080 | const struct svc_xprt *xprt, |
| 2081 | u32 expected, |
| 2082 | u32 received |
| 2083 | ), |
| 2084 | |
| 2085 | TP_ARGS(xprt, expected, received), |
| 2086 | |
| 2087 | TP_STRUCT__entry( |
| 2088 | __field(u32, expected) |
| 2089 | __field(u32, received) |
| 2090 | __field(unsigned long, flags) |
| 2091 | __string(addr, xprt->xpt_remotebuf) |
| 2092 | ), |
| 2093 | |
| 2094 | TP_fast_assign( |
| 2095 | __entry->expected = expected; |
| 2096 | __entry->received = received; |
| 2097 | __entry->flags = xprt->xpt_flags; |
| 2098 | __assign_str(addr, xprt->xpt_remotebuf); |
| 2099 | ), |
| 2100 | |
| 2101 | TP_printk("addr=%s flags=%s expected=%u received=%u", |
| 2102 | __get_str(addr), show_svc_xprt_flags(__entry->flags), |
| 2103 | __entry->expected, __entry->received |
| 2104 | ) |
| 2105 | ); |
| 2106 | |
Chuck Lever | a0469f4 | 2020-03-18 11:20:50 -0400 | [diff] [blame] | 2107 | TRACE_EVENT(svcsock_tcp_state, |
| 2108 | TP_PROTO( |
| 2109 | const struct svc_xprt *xprt, |
| 2110 | const struct socket *socket |
| 2111 | ), |
| 2112 | |
| 2113 | TP_ARGS(xprt, socket), |
| 2114 | |
| 2115 | TP_STRUCT__entry( |
| 2116 | __field(unsigned long, socket_state) |
| 2117 | __field(unsigned long, sock_state) |
| 2118 | __field(unsigned long, flags) |
| 2119 | __string(addr, xprt->xpt_remotebuf) |
| 2120 | ), |
| 2121 | |
| 2122 | TP_fast_assign( |
| 2123 | __entry->socket_state = socket->state; |
| 2124 | __entry->sock_state = socket->sk->sk_state; |
| 2125 | __entry->flags = xprt->xpt_flags; |
| 2126 | __assign_str(addr, xprt->xpt_remotebuf); |
| 2127 | ), |
| 2128 | |
| 2129 | TP_printk("addr=%s state=%s sk_state=%s flags=%s", __get_str(addr), |
| 2130 | rpc_show_socket_state(__entry->socket_state), |
| 2131 | rpc_show_sock_state(__entry->sock_state), |
| 2132 | show_svc_xprt_flags(__entry->flags) |
| 2133 | ) |
| 2134 | ); |
| 2135 | |
| 2136 | DECLARE_EVENT_CLASS(svcsock_accept_class, |
| 2137 | TP_PROTO( |
| 2138 | const struct svc_xprt *xprt, |
| 2139 | const char *service, |
| 2140 | long status |
| 2141 | ), |
| 2142 | |
| 2143 | TP_ARGS(xprt, service, status), |
| 2144 | |
| 2145 | TP_STRUCT__entry( |
| 2146 | __field(long, status) |
| 2147 | __string(service, service) |
Chuck Lever | 1672086 | 2022-01-08 16:59:54 -0500 | [diff] [blame] | 2148 | __field(unsigned int, netns_ino) |
Chuck Lever | a0469f4 | 2020-03-18 11:20:50 -0400 | [diff] [blame] | 2149 | ), |
| 2150 | |
| 2151 | TP_fast_assign( |
| 2152 | __entry->status = status; |
| 2153 | __assign_str(service, service); |
Chuck Lever | 1672086 | 2022-01-08 16:59:54 -0500 | [diff] [blame] | 2154 | __entry->netns_ino = xprt->xpt_net->ns.inum; |
Chuck Lever | a0469f4 | 2020-03-18 11:20:50 -0400 | [diff] [blame] | 2155 | ), |
| 2156 | |
Chuck Lever | 1672086 | 2022-01-08 16:59:54 -0500 | [diff] [blame] | 2157 | TP_printk("addr=listener service=%s status=%ld", |
| 2158 | __get_str(service), __entry->status |
Chuck Lever | a0469f4 | 2020-03-18 11:20:50 -0400 | [diff] [blame] | 2159 | ) |
| 2160 | ); |
| 2161 | |
| 2162 | #define DEFINE_ACCEPT_EVENT(name) \ |
| 2163 | DEFINE_EVENT(svcsock_accept_class, svcsock_##name##_err, \ |
| 2164 | TP_PROTO( \ |
| 2165 | const struct svc_xprt *xprt, \ |
| 2166 | const char *service, \ |
| 2167 | long status \ |
| 2168 | ), \ |
| 2169 | TP_ARGS(xprt, service, status)) |
| 2170 | |
| 2171 | DEFINE_ACCEPT_EVENT(accept); |
| 2172 | DEFINE_ACCEPT_EVENT(getpeername); |
| 2173 | |
Trond Myklebust | 78a947f | 2020-03-01 18:21:44 -0500 | [diff] [blame] | 2174 | DECLARE_EVENT_CLASS(cache_event, |
| 2175 | TP_PROTO( |
| 2176 | const struct cache_detail *cd, |
| 2177 | const struct cache_head *h |
| 2178 | ), |
| 2179 | |
| 2180 | TP_ARGS(cd, h), |
| 2181 | |
| 2182 | TP_STRUCT__entry( |
| 2183 | __field(const struct cache_head *, h) |
| 2184 | __string(name, cd->name) |
| 2185 | ), |
| 2186 | |
| 2187 | TP_fast_assign( |
| 2188 | __entry->h = h; |
| 2189 | __assign_str(name, cd->name); |
| 2190 | ), |
| 2191 | |
| 2192 | TP_printk("cache=%s entry=%p", __get_str(name), __entry->h) |
| 2193 | ); |
| 2194 | #define DEFINE_CACHE_EVENT(name) \ |
| 2195 | DEFINE_EVENT(cache_event, name, \ |
| 2196 | TP_PROTO( \ |
| 2197 | const struct cache_detail *cd, \ |
| 2198 | const struct cache_head *h \ |
| 2199 | ), \ |
| 2200 | TP_ARGS(cd, h)) |
| 2201 | DEFINE_CACHE_EVENT(cache_entry_expired); |
| 2202 | DEFINE_CACHE_EVENT(cache_entry_upcall); |
| 2203 | DEFINE_CACHE_EVENT(cache_entry_update); |
| 2204 | DEFINE_CACHE_EVENT(cache_entry_make_negative); |
| 2205 | DEFINE_CACHE_EVENT(cache_entry_no_listener); |
| 2206 | |
Chuck Lever | b4af593 | 2020-05-02 11:59:37 -0400 | [diff] [blame] | 2207 | DECLARE_EVENT_CLASS(register_class, |
| 2208 | TP_PROTO( |
| 2209 | const char *program, |
| 2210 | const u32 version, |
| 2211 | const int family, |
| 2212 | const unsigned short protocol, |
| 2213 | const unsigned short port, |
| 2214 | int error |
| 2215 | ), |
| 2216 | |
| 2217 | TP_ARGS(program, version, family, protocol, port, error), |
| 2218 | |
| 2219 | TP_STRUCT__entry( |
| 2220 | __field(u32, version) |
| 2221 | __field(unsigned long, family) |
| 2222 | __field(unsigned short, protocol) |
| 2223 | __field(unsigned short, port) |
| 2224 | __field(int, error) |
| 2225 | __string(program, program) |
| 2226 | ), |
| 2227 | |
| 2228 | TP_fast_assign( |
| 2229 | __entry->version = version; |
| 2230 | __entry->family = family; |
| 2231 | __entry->protocol = protocol; |
| 2232 | __entry->port = port; |
| 2233 | __entry->error = error; |
| 2234 | __assign_str(program, program); |
| 2235 | ), |
| 2236 | |
| 2237 | TP_printk("program=%sv%u proto=%s port=%u family=%s error=%d", |
| 2238 | __get_str(program), __entry->version, |
| 2239 | __entry->protocol == IPPROTO_UDP ? "udp" : "tcp", |
| 2240 | __entry->port, rpc_show_address_family(__entry->family), |
| 2241 | __entry->error |
| 2242 | ) |
| 2243 | ); |
| 2244 | |
| 2245 | #define DEFINE_REGISTER_EVENT(name) \ |
| 2246 | DEFINE_EVENT(register_class, svc_##name, \ |
| 2247 | TP_PROTO( \ |
| 2248 | const char *program, \ |
| 2249 | const u32 version, \ |
| 2250 | const int family, \ |
| 2251 | const unsigned short protocol, \ |
| 2252 | const unsigned short port, \ |
| 2253 | int error \ |
| 2254 | ), \ |
| 2255 | TP_ARGS(program, version, family, protocol, \ |
| 2256 | port, error)) |
| 2257 | |
| 2258 | DEFINE_REGISTER_EVENT(register); |
| 2259 | DEFINE_REGISTER_EVENT(noregister); |
| 2260 | |
| 2261 | TRACE_EVENT(svc_unregister, |
| 2262 | TP_PROTO( |
| 2263 | const char *program, |
| 2264 | const u32 version, |
| 2265 | int error |
| 2266 | ), |
| 2267 | |
| 2268 | TP_ARGS(program, version, error), |
| 2269 | |
| 2270 | TP_STRUCT__entry( |
| 2271 | __field(u32, version) |
| 2272 | __field(int, error) |
| 2273 | __string(program, program) |
| 2274 | ), |
| 2275 | |
| 2276 | TP_fast_assign( |
| 2277 | __entry->version = version; |
| 2278 | __entry->error = error; |
| 2279 | __assign_str(program, program); |
| 2280 | ), |
| 2281 | |
| 2282 | TP_printk("program=%sv%u error=%d", |
| 2283 | __get_str(program), __entry->version, __entry->error |
| 2284 | ) |
| 2285 | ); |
| 2286 | |
Trond Myklebust | 82b0a4c | 2012-01-20 14:52:23 -0500 | [diff] [blame] | 2287 | #endif /* _TRACE_SUNRPC_H */ |
| 2288 | |
| 2289 | #include <trace/define_trace.h> |