1 /* SPDX-License-Identifier: GPL-2.0 */ 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> 10 #include <linux/sunrpc/svc.h> 11 #include <linux/sunrpc/xprtsock.h> 12 #include <linux/sunrpc/svc_xprt.h> 13 #include <net/tcp_states.h> 14 #include <linux/net.h> 15 #include <linux/tracepoint.h> 16 17 DECLARE_EVENT_CLASS(rpc_task_status, 18 19 TP_PROTO(struct rpc_task *task), 20 21 TP_ARGS(task), 22 23 TP_STRUCT__entry( 24 __field(unsigned int, task_id) 25 __field(unsigned int, client_id) 26 __field(int, status) 27 ), 28 29 TP_fast_assign( 30 __entry->task_id = task->tk_pid; 31 __entry->client_id = task->tk_client->cl_clid; 32 __entry->status = task->tk_status; 33 ), 34 35 TP_printk("task:%u@%u status=%d", 36 __entry->task_id, __entry->client_id, 37 __entry->status) 38 ); 39 40 DEFINE_EVENT(rpc_task_status, rpc_call_status, 41 TP_PROTO(struct rpc_task *task), 42 43 TP_ARGS(task) 44 ); 45 46 DEFINE_EVENT(rpc_task_status, rpc_bind_status, 47 TP_PROTO(struct rpc_task *task), 48 49 TP_ARGS(task) 50 ); 51 52 TRACE_EVENT(rpc_connect_status, 53 TP_PROTO(struct rpc_task *task, int status), 54 55 TP_ARGS(task, status), 56 57 TP_STRUCT__entry( 58 __field(unsigned int, task_id) 59 __field(unsigned int, client_id) 60 __field(int, status) 61 ), 62 63 TP_fast_assign( 64 __entry->task_id = task->tk_pid; 65 __entry->client_id = task->tk_client->cl_clid; 66 __entry->status = status; 67 ), 68 69 TP_printk("task:%u@%u status=%d", 70 __entry->task_id, __entry->client_id, 71 __entry->status) 72 ); 73 74 TRACE_EVENT(rpc_request, 75 TP_PROTO(const struct rpc_task *task), 76 77 TP_ARGS(task), 78 79 TP_STRUCT__entry( 80 __field(unsigned int, task_id) 81 __field(unsigned int, client_id) 82 __field(int, version) 83 __field(bool, async) 84 __string(progname, task->tk_client->cl_program->name) 85 __string(procname, rpc_proc_name(task)) 86 ), 87 88 TP_fast_assign( 89 __entry->task_id = task->tk_pid; 90 __entry->client_id = task->tk_client->cl_clid; 91 __entry->version = task->tk_client->cl_vers; 92 __entry->async = RPC_IS_ASYNC(task); 93 __assign_str(progname, task->tk_client->cl_program->name) 94 __assign_str(procname, rpc_proc_name(task)) 95 ), 96 97 TP_printk("task:%u@%u %sv%d %s (%ssync)", 98 __entry->task_id, __entry->client_id, 99 __get_str(progname), __entry->version, 100 __get_str(procname), __entry->async ? "a": "" 101 ) 102 ); 103 104 DECLARE_EVENT_CLASS(rpc_task_running, 105 106 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action), 107 108 TP_ARGS(clnt, task, action), 109 110 TP_STRUCT__entry( 111 __field(unsigned int, task_id) 112 __field(unsigned int, client_id) 113 __field(const void *, action) 114 __field(unsigned long, runstate) 115 __field(int, status) 116 __field(unsigned short, flags) 117 ), 118 119 TP_fast_assign( 120 __entry->client_id = clnt ? clnt->cl_clid : -1; 121 __entry->task_id = task->tk_pid; 122 __entry->action = action; 123 __entry->runstate = task->tk_runstate; 124 __entry->status = task->tk_status; 125 __entry->flags = task->tk_flags; 126 ), 127 128 TP_printk("task:%u@%d flags=%4.4x state=%4.4lx status=%d action=%pf", 129 __entry->task_id, __entry->client_id, 130 __entry->flags, 131 __entry->runstate, 132 __entry->status, 133 __entry->action 134 ) 135 ); 136 137 DEFINE_EVENT(rpc_task_running, rpc_task_begin, 138 139 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action), 140 141 TP_ARGS(clnt, task, action) 142 143 ); 144 145 DEFINE_EVENT(rpc_task_running, rpc_task_run_action, 146 147 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action), 148 149 TP_ARGS(clnt, task, action) 150 151 ); 152 153 DEFINE_EVENT(rpc_task_running, rpc_task_complete, 154 155 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action), 156 157 TP_ARGS(clnt, task, action) 158 159 ); 160 161 DECLARE_EVENT_CLASS(rpc_task_queued, 162 163 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q), 164 165 TP_ARGS(clnt, task, q), 166 167 TP_STRUCT__entry( 168 __field(unsigned int, task_id) 169 __field(unsigned int, client_id) 170 __field(unsigned long, timeout) 171 __field(unsigned long, runstate) 172 __field(int, status) 173 __field(unsigned short, flags) 174 __string(q_name, rpc_qname(q)) 175 ), 176 177 TP_fast_assign( 178 __entry->client_id = clnt ? clnt->cl_clid : -1; 179 __entry->task_id = task->tk_pid; 180 __entry->timeout = task->tk_timeout; 181 __entry->runstate = task->tk_runstate; 182 __entry->status = task->tk_status; 183 __entry->flags = task->tk_flags; 184 __assign_str(q_name, rpc_qname(q)); 185 ), 186 187 TP_printk("task:%u@%d flags=%4.4x state=%4.4lx status=%d timeout=%lu queue=%s", 188 __entry->task_id, __entry->client_id, 189 __entry->flags, 190 __entry->runstate, 191 __entry->status, 192 __entry->timeout, 193 __get_str(q_name) 194 ) 195 ); 196 197 DEFINE_EVENT(rpc_task_queued, rpc_task_sleep, 198 199 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q), 200 201 TP_ARGS(clnt, task, q) 202 203 ); 204 205 DEFINE_EVENT(rpc_task_queued, rpc_task_wakeup, 206 207 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q), 208 209 TP_ARGS(clnt, task, q) 210 211 ); 212 213 /* 214 * First define the enums in the below macros to be exported to userspace 215 * via TRACE_DEFINE_ENUM(). 216 */ 217 #undef EM 218 #undef EMe 219 #define EM(a, b) TRACE_DEFINE_ENUM(a); 220 #define EMe(a, b) TRACE_DEFINE_ENUM(a); 221 222 #define RPC_SHOW_SOCKET \ 223 EM( SS_FREE, "FREE" ) \ 224 EM( SS_UNCONNECTED, "UNCONNECTED" ) \ 225 EM( SS_CONNECTING, "CONNECTING," ) \ 226 EM( SS_CONNECTED, "CONNECTED," ) \ 227 EMe(SS_DISCONNECTING, "DISCONNECTING" ) 228 229 #define rpc_show_socket_state(state) \ 230 __print_symbolic(state, RPC_SHOW_SOCKET) 231 232 RPC_SHOW_SOCKET 233 234 #define RPC_SHOW_SOCK \ 235 EM( TCP_ESTABLISHED, "ESTABLISHED" ) \ 236 EM( TCP_SYN_SENT, "SYN_SENT" ) \ 237 EM( TCP_SYN_RECV, "SYN_RECV" ) \ 238 EM( TCP_FIN_WAIT1, "FIN_WAIT1" ) \ 239 EM( TCP_FIN_WAIT2, "FIN_WAIT2" ) \ 240 EM( TCP_TIME_WAIT, "TIME_WAIT" ) \ 241 EM( TCP_CLOSE, "CLOSE" ) \ 242 EM( TCP_CLOSE_WAIT, "CLOSE_WAIT" ) \ 243 EM( TCP_LAST_ACK, "LAST_ACK" ) \ 244 EM( TCP_LISTEN, "LISTEN" ) \ 245 EMe( TCP_CLOSING, "CLOSING" ) 246 247 #define rpc_show_sock_state(state) \ 248 __print_symbolic(state, RPC_SHOW_SOCK) 249 250 RPC_SHOW_SOCK 251 252 /* 253 * Now redefine the EM() and EMe() macros to map the enums to the strings 254 * that will be printed in the output. 255 */ 256 #undef EM 257 #undef EMe 258 #define EM(a, b) {a, b}, 259 #define EMe(a, b) {a, b} 260 261 DECLARE_EVENT_CLASS(xs_socket_event, 262 263 TP_PROTO( 264 struct rpc_xprt *xprt, 265 struct socket *socket 266 ), 267 268 TP_ARGS(xprt, socket), 269 270 TP_STRUCT__entry( 271 __field(unsigned int, socket_state) 272 __field(unsigned int, sock_state) 273 __field(unsigned long long, ino) 274 __string(dstaddr, 275 xprt->address_strings[RPC_DISPLAY_ADDR]) 276 __string(dstport, 277 xprt->address_strings[RPC_DISPLAY_PORT]) 278 ), 279 280 TP_fast_assign( 281 struct inode *inode = SOCK_INODE(socket); 282 __entry->socket_state = socket->state; 283 __entry->sock_state = socket->sk->sk_state; 284 __entry->ino = (unsigned long long)inode->i_ino; 285 __assign_str(dstaddr, 286 xprt->address_strings[RPC_DISPLAY_ADDR]); 287 __assign_str(dstport, 288 xprt->address_strings[RPC_DISPLAY_PORT]); 289 ), 290 291 TP_printk( 292 "socket:[%llu] dstaddr=%s/%s " 293 "state=%u (%s) sk_state=%u (%s)", 294 __entry->ino, __get_str(dstaddr), __get_str(dstport), 295 __entry->socket_state, 296 rpc_show_socket_state(__entry->socket_state), 297 __entry->sock_state, 298 rpc_show_sock_state(__entry->sock_state) 299 ) 300 ); 301 #define DEFINE_RPC_SOCKET_EVENT(name) \ 302 DEFINE_EVENT(xs_socket_event, name, \ 303 TP_PROTO( \ 304 struct rpc_xprt *xprt, \ 305 struct socket *socket \ 306 ), \ 307 TP_ARGS(xprt, socket)) 308 309 DECLARE_EVENT_CLASS(xs_socket_event_done, 310 311 TP_PROTO( 312 struct rpc_xprt *xprt, 313 struct socket *socket, 314 int error 315 ), 316 317 TP_ARGS(xprt, socket, error), 318 319 TP_STRUCT__entry( 320 __field(int, error) 321 __field(unsigned int, socket_state) 322 __field(unsigned int, sock_state) 323 __field(unsigned long long, ino) 324 __string(dstaddr, 325 xprt->address_strings[RPC_DISPLAY_ADDR]) 326 __string(dstport, 327 xprt->address_strings[RPC_DISPLAY_PORT]) 328 ), 329 330 TP_fast_assign( 331 struct inode *inode = SOCK_INODE(socket); 332 __entry->socket_state = socket->state; 333 __entry->sock_state = socket->sk->sk_state; 334 __entry->ino = (unsigned long long)inode->i_ino; 335 __entry->error = error; 336 __assign_str(dstaddr, 337 xprt->address_strings[RPC_DISPLAY_ADDR]); 338 __assign_str(dstport, 339 xprt->address_strings[RPC_DISPLAY_PORT]); 340 ), 341 342 TP_printk( 343 "error=%d socket:[%llu] dstaddr=%s/%s " 344 "state=%u (%s) sk_state=%u (%s)", 345 __entry->error, 346 __entry->ino, __get_str(dstaddr), __get_str(dstport), 347 __entry->socket_state, 348 rpc_show_socket_state(__entry->socket_state), 349 __entry->sock_state, 350 rpc_show_sock_state(__entry->sock_state) 351 ) 352 ); 353 #define DEFINE_RPC_SOCKET_EVENT_DONE(name) \ 354 DEFINE_EVENT(xs_socket_event_done, name, \ 355 TP_PROTO( \ 356 struct rpc_xprt *xprt, \ 357 struct socket *socket, \ 358 int error \ 359 ), \ 360 TP_ARGS(xprt, socket, error)) 361 362 DEFINE_RPC_SOCKET_EVENT(rpc_socket_state_change); 363 DEFINE_RPC_SOCKET_EVENT_DONE(rpc_socket_connect); 364 DEFINE_RPC_SOCKET_EVENT_DONE(rpc_socket_error); 365 DEFINE_RPC_SOCKET_EVENT_DONE(rpc_socket_reset_connection); 366 DEFINE_RPC_SOCKET_EVENT(rpc_socket_close); 367 DEFINE_RPC_SOCKET_EVENT(rpc_socket_shutdown); 368 369 DECLARE_EVENT_CLASS(rpc_xprt_event, 370 TP_PROTO(struct rpc_xprt *xprt, __be32 xid, int status), 371 372 TP_ARGS(xprt, xid, status), 373 374 TP_STRUCT__entry( 375 __field(u32, xid) 376 __field(int, status) 377 __string(addr, xprt->address_strings[RPC_DISPLAY_ADDR]) 378 __string(port, xprt->address_strings[RPC_DISPLAY_PORT]) 379 ), 380 381 TP_fast_assign( 382 __entry->xid = be32_to_cpu(xid); 383 __entry->status = status; 384 __assign_str(addr, xprt->address_strings[RPC_DISPLAY_ADDR]); 385 __assign_str(port, xprt->address_strings[RPC_DISPLAY_PORT]); 386 ), 387 388 TP_printk("peer=[%s]:%s xid=0x%08x status=%d", __get_str(addr), 389 __get_str(port), __entry->xid, 390 __entry->status) 391 ); 392 393 DEFINE_EVENT(rpc_xprt_event, xprt_timer, 394 TP_PROTO(struct rpc_xprt *xprt, __be32 xid, int status), 395 TP_ARGS(xprt, xid, status)); 396 397 DEFINE_EVENT(rpc_xprt_event, xprt_lookup_rqst, 398 TP_PROTO(struct rpc_xprt *xprt, __be32 xid, int status), 399 TP_ARGS(xprt, xid, status)); 400 401 DEFINE_EVENT(rpc_xprt_event, xprt_transmit, 402 TP_PROTO(struct rpc_xprt *xprt, __be32 xid, int status), 403 TP_ARGS(xprt, xid, status)); 404 405 DEFINE_EVENT(rpc_xprt_event, xprt_complete_rqst, 406 TP_PROTO(struct rpc_xprt *xprt, __be32 xid, int status), 407 TP_ARGS(xprt, xid, status)); 408 409 TRACE_EVENT(xs_tcp_data_ready, 410 TP_PROTO(struct rpc_xprt *xprt, int err, unsigned int total), 411 412 TP_ARGS(xprt, err, total), 413 414 TP_STRUCT__entry( 415 __field(int, err) 416 __field(unsigned int, total) 417 __string(addr, xprt ? xprt->address_strings[RPC_DISPLAY_ADDR] : 418 "(null)") 419 __string(port, xprt ? xprt->address_strings[RPC_DISPLAY_PORT] : 420 "(null)") 421 ), 422 423 TP_fast_assign( 424 __entry->err = err; 425 __entry->total = total; 426 __assign_str(addr, xprt ? 427 xprt->address_strings[RPC_DISPLAY_ADDR] : "(null)"); 428 __assign_str(port, xprt ? 429 xprt->address_strings[RPC_DISPLAY_PORT] : "(null)"); 430 ), 431 432 TP_printk("peer=[%s]:%s err=%d total=%u", __get_str(addr), 433 __get_str(port), __entry->err, __entry->total) 434 ); 435 436 #define rpc_show_sock_xprt_flags(flags) \ 437 __print_flags(flags, "|", \ 438 { TCP_RCV_LAST_FRAG, "TCP_RCV_LAST_FRAG" }, \ 439 { TCP_RCV_COPY_FRAGHDR, "TCP_RCV_COPY_FRAGHDR" }, \ 440 { TCP_RCV_COPY_XID, "TCP_RCV_COPY_XID" }, \ 441 { TCP_RCV_COPY_DATA, "TCP_RCV_COPY_DATA" }, \ 442 { TCP_RCV_READ_CALLDIR, "TCP_RCV_READ_CALLDIR" }, \ 443 { TCP_RCV_COPY_CALLDIR, "TCP_RCV_COPY_CALLDIR" }, \ 444 { TCP_RPC_REPLY, "TCP_RPC_REPLY" }) 445 446 TRACE_EVENT(xs_tcp_data_recv, 447 TP_PROTO(struct sock_xprt *xs), 448 449 TP_ARGS(xs), 450 451 TP_STRUCT__entry( 452 __string(addr, xs->xprt.address_strings[RPC_DISPLAY_ADDR]) 453 __string(port, xs->xprt.address_strings[RPC_DISPLAY_PORT]) 454 __field(u32, xid) 455 __field(unsigned long, flags) 456 __field(unsigned long, copied) 457 __field(unsigned int, reclen) 458 __field(unsigned long, offset) 459 ), 460 461 TP_fast_assign( 462 __assign_str(addr, xs->xprt.address_strings[RPC_DISPLAY_ADDR]); 463 __assign_str(port, xs->xprt.address_strings[RPC_DISPLAY_PORT]); 464 __entry->xid = be32_to_cpu(xs->tcp_xid); 465 __entry->flags = xs->tcp_flags; 466 __entry->copied = xs->tcp_copied; 467 __entry->reclen = xs->tcp_reclen; 468 __entry->offset = xs->tcp_offset; 469 ), 470 471 TP_printk("peer=[%s]:%s xid=0x%08x flags=%s copied=%lu reclen=%u offset=%lu", 472 __get_str(addr), __get_str(port), __entry->xid, 473 rpc_show_sock_xprt_flags(__entry->flags), 474 __entry->copied, __entry->reclen, __entry->offset) 475 ); 476 477 #define show_rqstp_flags(flags) \ 478 __print_flags(flags, "|", \ 479 { (1UL << RQ_SECURE), "RQ_SECURE"}, \ 480 { (1UL << RQ_LOCAL), "RQ_LOCAL"}, \ 481 { (1UL << RQ_USEDEFERRAL), "RQ_USEDEFERRAL"}, \ 482 { (1UL << RQ_DROPME), "RQ_DROPME"}, \ 483 { (1UL << RQ_SPLICE_OK), "RQ_SPLICE_OK"}, \ 484 { (1UL << RQ_VICTIM), "RQ_VICTIM"}, \ 485 { (1UL << RQ_BUSY), "RQ_BUSY"}) 486 487 TRACE_EVENT(svc_recv, 488 TP_PROTO(struct svc_rqst *rqst, int status), 489 490 TP_ARGS(rqst, status), 491 492 TP_STRUCT__entry( 493 __field(u32, xid) 494 __field(int, status) 495 __field(unsigned long, flags) 496 __dynamic_array(unsigned char, addr, rqst->rq_addrlen) 497 ), 498 499 TP_fast_assign( 500 __entry->xid = status > 0 ? be32_to_cpu(rqst->rq_xid) : 0; 501 __entry->status = status; 502 __entry->flags = rqst->rq_flags; 503 memcpy(__get_dynamic_array(addr), 504 &rqst->rq_addr, rqst->rq_addrlen); 505 ), 506 507 TP_printk("addr=%pIScp xid=0x%08x status=%d flags=%s", 508 (struct sockaddr *)__get_dynamic_array(addr), 509 __entry->xid, __entry->status, 510 show_rqstp_flags(__entry->flags)) 511 ); 512 513 DECLARE_EVENT_CLASS(svc_rqst_event, 514 515 TP_PROTO(struct svc_rqst *rqst), 516 517 TP_ARGS(rqst), 518 519 TP_STRUCT__entry( 520 __field(u32, xid) 521 __field(unsigned long, flags) 522 __dynamic_array(unsigned char, addr, rqst->rq_addrlen) 523 ), 524 525 TP_fast_assign( 526 __entry->xid = be32_to_cpu(rqst->rq_xid); 527 __entry->flags = rqst->rq_flags; 528 memcpy(__get_dynamic_array(addr), 529 &rqst->rq_addr, rqst->rq_addrlen); 530 ), 531 532 TP_printk("addr=%pIScp rq_xid=0x%08x flags=%s", 533 (struct sockaddr *)__get_dynamic_array(addr), 534 __entry->xid, 535 show_rqstp_flags(__entry->flags)) 536 ); 537 538 DEFINE_EVENT(svc_rqst_event, svc_defer, 539 TP_PROTO(struct svc_rqst *rqst), 540 TP_ARGS(rqst)); 541 542 DEFINE_EVENT(svc_rqst_event, svc_drop, 543 TP_PROTO(struct svc_rqst *rqst), 544 TP_ARGS(rqst)); 545 546 DECLARE_EVENT_CLASS(svc_rqst_status, 547 548 TP_PROTO(struct svc_rqst *rqst, int status), 549 550 TP_ARGS(rqst, status), 551 552 TP_STRUCT__entry( 553 __field(u32, xid) 554 __field(int, status) 555 __field(unsigned long, flags) 556 __dynamic_array(unsigned char, addr, rqst->rq_addrlen) 557 ), 558 559 TP_fast_assign( 560 __entry->xid = be32_to_cpu(rqst->rq_xid); 561 __entry->status = status; 562 __entry->flags = rqst->rq_flags; 563 memcpy(__get_dynamic_array(addr), 564 &rqst->rq_addr, rqst->rq_addrlen); 565 ), 566 567 TP_printk("addr=%pIScp rq_xid=0x%08x status=%d flags=%s", 568 (struct sockaddr *)__get_dynamic_array(addr), 569 __entry->xid, 570 __entry->status, show_rqstp_flags(__entry->flags)) 571 ); 572 573 DEFINE_EVENT(svc_rqst_status, svc_process, 574 TP_PROTO(struct svc_rqst *rqst, int status), 575 TP_ARGS(rqst, status)); 576 577 DEFINE_EVENT(svc_rqst_status, svc_send, 578 TP_PROTO(struct svc_rqst *rqst, int status), 579 TP_ARGS(rqst, status)); 580 581 #define show_svc_xprt_flags(flags) \ 582 __print_flags(flags, "|", \ 583 { (1UL << XPT_BUSY), "XPT_BUSY"}, \ 584 { (1UL << XPT_CONN), "XPT_CONN"}, \ 585 { (1UL << XPT_CLOSE), "XPT_CLOSE"}, \ 586 { (1UL << XPT_DATA), "XPT_DATA"}, \ 587 { (1UL << XPT_TEMP), "XPT_TEMP"}, \ 588 { (1UL << XPT_DEAD), "XPT_DEAD"}, \ 589 { (1UL << XPT_CHNGBUF), "XPT_CHNGBUF"}, \ 590 { (1UL << XPT_DEFERRED), "XPT_DEFERRED"}, \ 591 { (1UL << XPT_OLD), "XPT_OLD"}, \ 592 { (1UL << XPT_LISTENER), "XPT_LISTENER"}, \ 593 { (1UL << XPT_CACHE_AUTH), "XPT_CACHE_AUTH"}, \ 594 { (1UL << XPT_LOCAL), "XPT_LOCAL"}) 595 596 TRACE_EVENT(svc_xprt_do_enqueue, 597 TP_PROTO(struct svc_xprt *xprt, struct svc_rqst *rqst), 598 599 TP_ARGS(xprt, rqst), 600 601 TP_STRUCT__entry( 602 __field(struct svc_xprt *, xprt) 603 __field(int, pid) 604 __field(unsigned long, flags) 605 __dynamic_array(unsigned char, addr, xprt != NULL ? 606 xprt->xpt_remotelen : 0) 607 ), 608 609 TP_fast_assign( 610 __entry->xprt = xprt; 611 __entry->pid = rqst? rqst->rq_task->pid : 0; 612 if (xprt) { 613 memcpy(__get_dynamic_array(addr), 614 &xprt->xpt_remote, 615 xprt->xpt_remotelen); 616 __entry->flags = xprt->xpt_flags; 617 } else 618 __entry->flags = 0; 619 ), 620 621 TP_printk("xprt=0x%p addr=%pIScp pid=%d flags=%s", __entry->xprt, 622 __get_dynamic_array_len(addr) != 0 ? 623 (struct sockaddr *)__get_dynamic_array(addr) : NULL, 624 __entry->pid, show_svc_xprt_flags(__entry->flags)) 625 ); 626 627 DECLARE_EVENT_CLASS(svc_xprt_event, 628 TP_PROTO(struct svc_xprt *xprt), 629 630 TP_ARGS(xprt), 631 632 TP_STRUCT__entry( 633 __field(struct svc_xprt *, xprt) 634 __field(unsigned long, flags) 635 __dynamic_array(unsigned char, addr, xprt != NULL ? 636 xprt->xpt_remotelen : 0) 637 ), 638 639 TP_fast_assign( 640 __entry->xprt = xprt; 641 if (xprt) { 642 memcpy(__get_dynamic_array(addr), 643 &xprt->xpt_remote, 644 xprt->xpt_remotelen); 645 __entry->flags = xprt->xpt_flags; 646 } else 647 __entry->flags = 0; 648 ), 649 650 TP_printk("xprt=0x%p addr=%pIScp flags=%s", __entry->xprt, 651 __get_dynamic_array_len(addr) != 0 ? 652 (struct sockaddr *)__get_dynamic_array(addr) : NULL, 653 show_svc_xprt_flags(__entry->flags)) 654 ); 655 656 DEFINE_EVENT(svc_xprt_event, svc_xprt_dequeue, 657 TP_PROTO(struct svc_xprt *xprt), 658 TP_ARGS(xprt)); 659 660 DEFINE_EVENT(svc_xprt_event, svc_xprt_no_write_space, 661 TP_PROTO(struct svc_xprt *xprt), 662 TP_ARGS(xprt)); 663 664 TRACE_EVENT(svc_wake_up, 665 TP_PROTO(int pid), 666 667 TP_ARGS(pid), 668 669 TP_STRUCT__entry( 670 __field(int, pid) 671 ), 672 673 TP_fast_assign( 674 __entry->pid = pid; 675 ), 676 677 TP_printk("pid=%d", __entry->pid) 678 ); 679 680 TRACE_EVENT(svc_handle_xprt, 681 TP_PROTO(struct svc_xprt *xprt, int len), 682 683 TP_ARGS(xprt, len), 684 685 TP_STRUCT__entry( 686 __field(struct svc_xprt *, xprt) 687 __field(int, len) 688 __field(unsigned long, flags) 689 __dynamic_array(unsigned char, addr, xprt != NULL ? 690 xprt->xpt_remotelen : 0) 691 ), 692 693 TP_fast_assign( 694 __entry->xprt = xprt; 695 __entry->len = len; 696 if (xprt) { 697 memcpy(__get_dynamic_array(addr), 698 &xprt->xpt_remote, 699 xprt->xpt_remotelen); 700 __entry->flags = xprt->xpt_flags; 701 } else 702 __entry->flags = 0; 703 ), 704 705 TP_printk("xprt=0x%p addr=%pIScp len=%d flags=%s", __entry->xprt, 706 __get_dynamic_array_len(addr) != 0 ? 707 (struct sockaddr *)__get_dynamic_array(addr) : NULL, 708 __entry->len, show_svc_xprt_flags(__entry->flags)) 709 ); 710 711 712 DECLARE_EVENT_CLASS(svc_deferred_event, 713 TP_PROTO(struct svc_deferred_req *dr), 714 715 TP_ARGS(dr), 716 717 TP_STRUCT__entry( 718 __field(u32, xid) 719 __dynamic_array(unsigned char, addr, dr->addrlen) 720 ), 721 722 TP_fast_assign( 723 __entry->xid = be32_to_cpu(*(__be32 *)(dr->args + 724 (dr->xprt_hlen>>2))); 725 memcpy(__get_dynamic_array(addr), &dr->addr, dr->addrlen); 726 ), 727 728 TP_printk("addr=%pIScp xid=0x%08x", 729 (struct sockaddr *)__get_dynamic_array(addr), 730 __entry->xid) 731 ); 732 733 DEFINE_EVENT(svc_deferred_event, svc_drop_deferred, 734 TP_PROTO(struct svc_deferred_req *dr), 735 TP_ARGS(dr)); 736 DEFINE_EVENT(svc_deferred_event, svc_revisit_deferred, 737 TP_PROTO(struct svc_deferred_req *dr), 738 TP_ARGS(dr)); 739 #endif /* _TRACE_SUNRPC_H */ 740 741 #include <trace/define_trace.h> 742