1 /* AF_RXRPC tracepoints 2 * 3 * Copyright (C) 2016 Red Hat, Inc. All Rights Reserved. 4 * Written by David Howells (dhowells@redhat.com) 5 * 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public Licence 8 * as published by the Free Software Foundation; either version 9 * 2 of the Licence, or (at your option) any later version. 10 */ 11 #undef TRACE_SYSTEM 12 #define TRACE_SYSTEM rxrpc 13 14 #if !defined(_TRACE_RXRPC_H) || defined(TRACE_HEADER_MULTI_READ) 15 #define _TRACE_RXRPC_H 16 17 #include <linux/tracepoint.h> 18 19 /* 20 * Define enums for tracing information. 21 * 22 * These should all be kept sorted, making it easier to match the string 23 * mapping tables further on. 24 */ 25 #ifndef __RXRPC_DECLARE_TRACE_ENUMS_ONCE_ONLY 26 #define __RXRPC_DECLARE_TRACE_ENUMS_ONCE_ONLY 27 28 enum rxrpc_skb_trace { 29 rxrpc_skb_rx_cleaned, 30 rxrpc_skb_rx_freed, 31 rxrpc_skb_rx_got, 32 rxrpc_skb_rx_lost, 33 rxrpc_skb_rx_purged, 34 rxrpc_skb_rx_received, 35 rxrpc_skb_rx_rotated, 36 rxrpc_skb_rx_seen, 37 rxrpc_skb_tx_cleaned, 38 rxrpc_skb_tx_freed, 39 rxrpc_skb_tx_got, 40 rxrpc_skb_tx_new, 41 rxrpc_skb_tx_rotated, 42 rxrpc_skb_tx_seen, 43 }; 44 45 enum rxrpc_conn_trace { 46 rxrpc_conn_got, 47 rxrpc_conn_new_client, 48 rxrpc_conn_new_service, 49 rxrpc_conn_put_client, 50 rxrpc_conn_put_service, 51 rxrpc_conn_queued, 52 rxrpc_conn_seen, 53 }; 54 55 enum rxrpc_client_trace { 56 rxrpc_client_activate_chans, 57 rxrpc_client_alloc, 58 rxrpc_client_chan_activate, 59 rxrpc_client_chan_disconnect, 60 rxrpc_client_chan_pass, 61 rxrpc_client_chan_unstarted, 62 rxrpc_client_cleanup, 63 rxrpc_client_count, 64 rxrpc_client_discard, 65 rxrpc_client_duplicate, 66 rxrpc_client_exposed, 67 rxrpc_client_replace, 68 rxrpc_client_to_active, 69 rxrpc_client_to_culled, 70 rxrpc_client_to_idle, 71 rxrpc_client_to_inactive, 72 rxrpc_client_to_upgrade, 73 rxrpc_client_to_waiting, 74 rxrpc_client_uncount, 75 }; 76 77 enum rxrpc_call_trace { 78 rxrpc_call_connected, 79 rxrpc_call_error, 80 rxrpc_call_got, 81 rxrpc_call_got_kernel, 82 rxrpc_call_got_userid, 83 rxrpc_call_new_client, 84 rxrpc_call_new_service, 85 rxrpc_call_put, 86 rxrpc_call_put_kernel, 87 rxrpc_call_put_noqueue, 88 rxrpc_call_put_userid, 89 rxrpc_call_queued, 90 rxrpc_call_queued_ref, 91 rxrpc_call_release, 92 rxrpc_call_seen, 93 }; 94 95 enum rxrpc_transmit_trace { 96 rxrpc_transmit_await_reply, 97 rxrpc_transmit_end, 98 rxrpc_transmit_queue, 99 rxrpc_transmit_queue_last, 100 rxrpc_transmit_rotate, 101 rxrpc_transmit_rotate_last, 102 rxrpc_transmit_wait, 103 }; 104 105 enum rxrpc_receive_trace { 106 rxrpc_receive_end, 107 rxrpc_receive_front, 108 rxrpc_receive_incoming, 109 rxrpc_receive_queue, 110 rxrpc_receive_queue_last, 111 rxrpc_receive_rotate, 112 }; 113 114 enum rxrpc_recvmsg_trace { 115 rxrpc_recvmsg_cont, 116 rxrpc_recvmsg_data_return, 117 rxrpc_recvmsg_dequeue, 118 rxrpc_recvmsg_enter, 119 rxrpc_recvmsg_full, 120 rxrpc_recvmsg_hole, 121 rxrpc_recvmsg_next, 122 rxrpc_recvmsg_requeue, 123 rxrpc_recvmsg_return, 124 rxrpc_recvmsg_terminal, 125 rxrpc_recvmsg_to_be_accepted, 126 rxrpc_recvmsg_wait, 127 }; 128 129 enum rxrpc_rtt_tx_trace { 130 rxrpc_rtt_tx_data, 131 rxrpc_rtt_tx_ping, 132 }; 133 134 enum rxrpc_rtt_rx_trace { 135 rxrpc_rtt_rx_ping_response, 136 rxrpc_rtt_rx_requested_ack, 137 }; 138 139 enum rxrpc_timer_trace { 140 rxrpc_timer_begin, 141 rxrpc_timer_expired, 142 rxrpc_timer_init_for_reply, 143 rxrpc_timer_init_for_send_reply, 144 rxrpc_timer_set_for_ack, 145 rxrpc_timer_set_for_ping, 146 rxrpc_timer_set_for_resend, 147 rxrpc_timer_set_for_send, 148 }; 149 150 enum rxrpc_propose_ack_trace { 151 rxrpc_propose_ack_client_tx_end, 152 rxrpc_propose_ack_input_data, 153 rxrpc_propose_ack_ping_for_lost_ack, 154 rxrpc_propose_ack_ping_for_lost_reply, 155 rxrpc_propose_ack_ping_for_params, 156 rxrpc_propose_ack_processing_op, 157 rxrpc_propose_ack_respond_to_ack, 158 rxrpc_propose_ack_respond_to_ping, 159 rxrpc_propose_ack_retry_tx, 160 rxrpc_propose_ack_rotate_rx, 161 rxrpc_propose_ack_terminal_ack, 162 }; 163 164 enum rxrpc_propose_ack_outcome { 165 rxrpc_propose_ack_subsume, 166 rxrpc_propose_ack_update, 167 rxrpc_propose_ack_use, 168 }; 169 170 enum rxrpc_congest_change { 171 rxrpc_cong_begin_retransmission, 172 rxrpc_cong_cleared_nacks, 173 rxrpc_cong_new_low_nack, 174 rxrpc_cong_no_change, 175 rxrpc_cong_progress, 176 rxrpc_cong_retransmit_again, 177 rxrpc_cong_rtt_window_end, 178 rxrpc_cong_saw_nack, 179 }; 180 181 #endif /* end __RXRPC_DECLARE_TRACE_ENUMS_ONCE_ONLY */ 182 183 /* 184 * Declare tracing information enums and their string mappings for display. 185 */ 186 #define rxrpc_skb_traces \ 187 EM(rxrpc_skb_rx_cleaned, "Rx CLN") \ 188 EM(rxrpc_skb_rx_freed, "Rx FRE") \ 189 EM(rxrpc_skb_rx_got, "Rx GOT") \ 190 EM(rxrpc_skb_rx_lost, "Rx *L*") \ 191 EM(rxrpc_skb_rx_purged, "Rx PUR") \ 192 EM(rxrpc_skb_rx_received, "Rx RCV") \ 193 EM(rxrpc_skb_rx_rotated, "Rx ROT") \ 194 EM(rxrpc_skb_rx_seen, "Rx SEE") \ 195 EM(rxrpc_skb_tx_cleaned, "Tx CLN") \ 196 EM(rxrpc_skb_tx_freed, "Tx FRE") \ 197 EM(rxrpc_skb_tx_got, "Tx GOT") \ 198 EM(rxrpc_skb_tx_new, "Tx NEW") \ 199 EM(rxrpc_skb_tx_rotated, "Tx ROT") \ 200 E_(rxrpc_skb_tx_seen, "Tx SEE") 201 202 #define rxrpc_conn_traces \ 203 EM(rxrpc_conn_got, "GOT") \ 204 EM(rxrpc_conn_new_client, "NWc") \ 205 EM(rxrpc_conn_new_service, "NWs") \ 206 EM(rxrpc_conn_put_client, "PTc") \ 207 EM(rxrpc_conn_put_service, "PTs") \ 208 EM(rxrpc_conn_queued, "QUE") \ 209 E_(rxrpc_conn_seen, "SEE") 210 211 #define rxrpc_client_traces \ 212 EM(rxrpc_client_activate_chans, "Activa") \ 213 EM(rxrpc_client_alloc, "Alloc ") \ 214 EM(rxrpc_client_chan_activate, "ChActv") \ 215 EM(rxrpc_client_chan_disconnect, "ChDisc") \ 216 EM(rxrpc_client_chan_pass, "ChPass") \ 217 EM(rxrpc_client_chan_unstarted, "ChUnst") \ 218 EM(rxrpc_client_cleanup, "Clean ") \ 219 EM(rxrpc_client_count, "Count ") \ 220 EM(rxrpc_client_discard, "Discar") \ 221 EM(rxrpc_client_duplicate, "Duplic") \ 222 EM(rxrpc_client_exposed, "Expose") \ 223 EM(rxrpc_client_replace, "Replac") \ 224 EM(rxrpc_client_to_active, "->Actv") \ 225 EM(rxrpc_client_to_culled, "->Cull") \ 226 EM(rxrpc_client_to_idle, "->Idle") \ 227 EM(rxrpc_client_to_inactive, "->Inac") \ 228 EM(rxrpc_client_to_upgrade, "->Upgd") \ 229 EM(rxrpc_client_to_waiting, "->Wait") \ 230 E_(rxrpc_client_uncount, "Uncoun") 231 232 #define rxrpc_conn_cache_states \ 233 EM(RXRPC_CONN_CLIENT_INACTIVE, "Inac") \ 234 EM(RXRPC_CONN_CLIENT_WAITING, "Wait") \ 235 EM(RXRPC_CONN_CLIENT_ACTIVE, "Actv") \ 236 EM(RXRPC_CONN_CLIENT_CULLED, "Cull") \ 237 E_(RXRPC_CONN_CLIENT_IDLE, "Idle") \ 238 239 #define rxrpc_call_traces \ 240 EM(rxrpc_call_connected, "CON") \ 241 EM(rxrpc_call_error, "*E*") \ 242 EM(rxrpc_call_got, "GOT") \ 243 EM(rxrpc_call_got_kernel, "Gke") \ 244 EM(rxrpc_call_got_userid, "Gus") \ 245 EM(rxrpc_call_new_client, "NWc") \ 246 EM(rxrpc_call_new_service, "NWs") \ 247 EM(rxrpc_call_put, "PUT") \ 248 EM(rxrpc_call_put_kernel, "Pke") \ 249 EM(rxrpc_call_put_noqueue, "PNQ") \ 250 EM(rxrpc_call_put_userid, "Pus") \ 251 EM(rxrpc_call_queued, "QUE") \ 252 EM(rxrpc_call_queued_ref, "QUR") \ 253 EM(rxrpc_call_release, "RLS") \ 254 E_(rxrpc_call_seen, "SEE") 255 256 #define rxrpc_transmit_traces \ 257 EM(rxrpc_transmit_await_reply, "AWR") \ 258 EM(rxrpc_transmit_end, "END") \ 259 EM(rxrpc_transmit_queue, "QUE") \ 260 EM(rxrpc_transmit_queue_last, "QLS") \ 261 EM(rxrpc_transmit_rotate, "ROT") \ 262 EM(rxrpc_transmit_rotate_last, "RLS") \ 263 E_(rxrpc_transmit_wait, "WAI") 264 265 #define rxrpc_receive_traces \ 266 EM(rxrpc_receive_end, "END") \ 267 EM(rxrpc_receive_front, "FRN") \ 268 EM(rxrpc_receive_incoming, "INC") \ 269 EM(rxrpc_receive_queue, "QUE") \ 270 EM(rxrpc_receive_queue_last, "QLS") \ 271 E_(rxrpc_receive_rotate, "ROT") 272 273 #define rxrpc_recvmsg_traces \ 274 EM(rxrpc_recvmsg_cont, "CONT") \ 275 EM(rxrpc_recvmsg_data_return, "DATA") \ 276 EM(rxrpc_recvmsg_dequeue, "DEQU") \ 277 EM(rxrpc_recvmsg_enter, "ENTR") \ 278 EM(rxrpc_recvmsg_full, "FULL") \ 279 EM(rxrpc_recvmsg_hole, "HOLE") \ 280 EM(rxrpc_recvmsg_next, "NEXT") \ 281 EM(rxrpc_recvmsg_requeue, "REQU") \ 282 EM(rxrpc_recvmsg_return, "RETN") \ 283 EM(rxrpc_recvmsg_terminal, "TERM") \ 284 EM(rxrpc_recvmsg_to_be_accepted, "TBAC") \ 285 E_(rxrpc_recvmsg_wait, "WAIT") 286 287 #define rxrpc_rtt_tx_traces \ 288 EM(rxrpc_rtt_tx_data, "DATA") \ 289 E_(rxrpc_rtt_tx_ping, "PING") 290 291 #define rxrpc_rtt_rx_traces \ 292 EM(rxrpc_rtt_rx_ping_response, "PONG") \ 293 E_(rxrpc_rtt_rx_requested_ack, "RACK") 294 295 #define rxrpc_timer_traces \ 296 EM(rxrpc_timer_begin, "Begin ") \ 297 EM(rxrpc_timer_expired, "*EXPR*") \ 298 EM(rxrpc_timer_init_for_reply, "IniRpl") \ 299 EM(rxrpc_timer_init_for_send_reply, "SndRpl") \ 300 EM(rxrpc_timer_set_for_ack, "SetAck") \ 301 EM(rxrpc_timer_set_for_ping, "SetPng") \ 302 EM(rxrpc_timer_set_for_resend, "SetRTx") \ 303 E_(rxrpc_timer_set_for_send, "SetTx ") 304 305 #define rxrpc_propose_ack_traces \ 306 EM(rxrpc_propose_ack_client_tx_end, "ClTxEnd") \ 307 EM(rxrpc_propose_ack_input_data, "DataIn ") \ 308 EM(rxrpc_propose_ack_ping_for_lost_ack, "LostAck") \ 309 EM(rxrpc_propose_ack_ping_for_lost_reply, "LostRpl") \ 310 EM(rxrpc_propose_ack_ping_for_params, "Params ") \ 311 EM(rxrpc_propose_ack_processing_op, "ProcOp ") \ 312 EM(rxrpc_propose_ack_respond_to_ack, "Rsp2Ack") \ 313 EM(rxrpc_propose_ack_respond_to_ping, "Rsp2Png") \ 314 EM(rxrpc_propose_ack_retry_tx, "RetryTx") \ 315 EM(rxrpc_propose_ack_rotate_rx, "RxAck ") \ 316 E_(rxrpc_propose_ack_terminal_ack, "ClTerm ") 317 318 #define rxrpc_propose_ack_outcomes \ 319 EM(rxrpc_propose_ack_subsume, " Subsume") \ 320 EM(rxrpc_propose_ack_update, " Update") \ 321 E_(rxrpc_propose_ack_use, "") 322 323 #define rxrpc_congest_modes \ 324 EM(RXRPC_CALL_CONGEST_AVOIDANCE, "CongAvoid") \ 325 EM(RXRPC_CALL_FAST_RETRANSMIT, "FastReTx ") \ 326 EM(RXRPC_CALL_PACKET_LOSS, "PktLoss ") \ 327 E_(RXRPC_CALL_SLOW_START, "SlowStart") 328 329 #define rxrpc_congest_changes \ 330 EM(rxrpc_cong_begin_retransmission, " Retrans") \ 331 EM(rxrpc_cong_cleared_nacks, " Cleared") \ 332 EM(rxrpc_cong_new_low_nack, " NewLowN") \ 333 EM(rxrpc_cong_no_change, "") \ 334 EM(rxrpc_cong_progress, " Progres") \ 335 EM(rxrpc_cong_retransmit_again, " ReTxAgn") \ 336 EM(rxrpc_cong_rtt_window_end, " RttWinE") \ 337 E_(rxrpc_cong_saw_nack, " SawNack") 338 339 #define rxrpc_pkts \ 340 EM(0, "?00") \ 341 EM(RXRPC_PACKET_TYPE_DATA, "DATA") \ 342 EM(RXRPC_PACKET_TYPE_ACK, "ACK") \ 343 EM(RXRPC_PACKET_TYPE_BUSY, "BUSY") \ 344 EM(RXRPC_PACKET_TYPE_ABORT, "ABORT") \ 345 EM(RXRPC_PACKET_TYPE_ACKALL, "ACKALL") \ 346 EM(RXRPC_PACKET_TYPE_CHALLENGE, "CHALL") \ 347 EM(RXRPC_PACKET_TYPE_RESPONSE, "RESP") \ 348 EM(RXRPC_PACKET_TYPE_DEBUG, "DEBUG") \ 349 EM(9, "?09") \ 350 EM(10, "?10") \ 351 EM(11, "?11") \ 352 EM(12, "?12") \ 353 EM(RXRPC_PACKET_TYPE_VERSION, "VERSION") \ 354 EM(14, "?14") \ 355 E_(15, "?15") 356 357 #define rxrpc_ack_names \ 358 EM(0, "-0-") \ 359 EM(RXRPC_ACK_REQUESTED, "REQ") \ 360 EM(RXRPC_ACK_DUPLICATE, "DUP") \ 361 EM(RXRPC_ACK_OUT_OF_SEQUENCE, "OOS") \ 362 EM(RXRPC_ACK_EXCEEDS_WINDOW, "WIN") \ 363 EM(RXRPC_ACK_NOSPACE, "MEM") \ 364 EM(RXRPC_ACK_PING, "PNG") \ 365 EM(RXRPC_ACK_PING_RESPONSE, "PNR") \ 366 EM(RXRPC_ACK_DELAY, "DLY") \ 367 EM(RXRPC_ACK_IDLE, "IDL") \ 368 E_(RXRPC_ACK__INVALID, "-?-") 369 370 /* 371 * Export enum symbols via userspace. 372 */ 373 #undef EM 374 #undef E_ 375 #define EM(a, b) TRACE_DEFINE_ENUM(a); 376 #define E_(a, b) TRACE_DEFINE_ENUM(a); 377 378 rxrpc_skb_traces; 379 rxrpc_conn_traces; 380 rxrpc_client_traces; 381 rxrpc_call_traces; 382 rxrpc_transmit_traces; 383 rxrpc_receive_traces; 384 rxrpc_recvmsg_traces; 385 rxrpc_rtt_tx_traces; 386 rxrpc_rtt_rx_traces; 387 rxrpc_timer_traces; 388 rxrpc_propose_ack_traces; 389 rxrpc_propose_ack_outcomes; 390 rxrpc_congest_changes; 391 392 /* 393 * Now redefine the EM() and E_() macros to map the enums to the strings that 394 * will be printed in the output. 395 */ 396 #undef EM 397 #undef E_ 398 #define EM(a, b) { a, b }, 399 #define E_(a, b) { a, b } 400 401 TRACE_EVENT(rxrpc_conn, 402 TP_PROTO(struct rxrpc_connection *conn, enum rxrpc_conn_trace op, 403 int usage, const void *where), 404 405 TP_ARGS(conn, op, usage, where), 406 407 TP_STRUCT__entry( 408 __field(struct rxrpc_connection *, conn ) 409 __field(int, op ) 410 __field(int, usage ) 411 __field(const void *, where ) 412 ), 413 414 TP_fast_assign( 415 __entry->conn = conn; 416 __entry->op = op; 417 __entry->usage = usage; 418 __entry->where = where; 419 ), 420 421 TP_printk("C=%p %s u=%d sp=%pSR", 422 __entry->conn, 423 __print_symbolic(__entry->op, rxrpc_conn_traces), 424 __entry->usage, 425 __entry->where) 426 ); 427 428 TRACE_EVENT(rxrpc_client, 429 TP_PROTO(struct rxrpc_connection *conn, int channel, 430 enum rxrpc_client_trace op), 431 432 TP_ARGS(conn, channel, op), 433 434 TP_STRUCT__entry( 435 __field(struct rxrpc_connection *, conn ) 436 __field(u32, cid ) 437 __field(int, channel ) 438 __field(int, usage ) 439 __field(enum rxrpc_client_trace, op ) 440 __field(enum rxrpc_conn_cache_state, cs ) 441 ), 442 443 TP_fast_assign( 444 __entry->conn = conn; 445 __entry->channel = channel; 446 __entry->usage = atomic_read(&conn->usage); 447 __entry->op = op; 448 __entry->cid = conn->proto.cid; 449 __entry->cs = conn->cache_state; 450 ), 451 452 TP_printk("C=%p h=%2d %s %s i=%08x u=%d", 453 __entry->conn, 454 __entry->channel, 455 __print_symbolic(__entry->op, rxrpc_client_traces), 456 __print_symbolic(__entry->cs, rxrpc_conn_cache_states), 457 __entry->cid, 458 __entry->usage) 459 ); 460 461 TRACE_EVENT(rxrpc_call, 462 TP_PROTO(struct rxrpc_call *call, enum rxrpc_call_trace op, 463 int usage, const void *where, const void *aux), 464 465 TP_ARGS(call, op, usage, where, aux), 466 467 TP_STRUCT__entry( 468 __field(struct rxrpc_call *, call ) 469 __field(int, op ) 470 __field(int, usage ) 471 __field(const void *, where ) 472 __field(const void *, aux ) 473 ), 474 475 TP_fast_assign( 476 __entry->call = call; 477 __entry->op = op; 478 __entry->usage = usage; 479 __entry->where = where; 480 __entry->aux = aux; 481 ), 482 483 TP_printk("c=%p %s u=%d sp=%pSR a=%p", 484 __entry->call, 485 __print_symbolic(__entry->op, rxrpc_call_traces), 486 __entry->usage, 487 __entry->where, 488 __entry->aux) 489 ); 490 491 TRACE_EVENT(rxrpc_skb, 492 TP_PROTO(struct sk_buff *skb, enum rxrpc_skb_trace op, 493 int usage, int mod_count, const void *where), 494 495 TP_ARGS(skb, op, usage, mod_count, where), 496 497 TP_STRUCT__entry( 498 __field(struct sk_buff *, skb ) 499 __field(enum rxrpc_skb_trace, op ) 500 __field(int, usage ) 501 __field(int, mod_count ) 502 __field(const void *, where ) 503 ), 504 505 TP_fast_assign( 506 __entry->skb = skb; 507 __entry->op = op; 508 __entry->usage = usage; 509 __entry->mod_count = mod_count; 510 __entry->where = where; 511 ), 512 513 TP_printk("s=%p %s u=%d m=%d p=%pSR", 514 __entry->skb, 515 __print_symbolic(__entry->op, rxrpc_skb_traces), 516 __entry->usage, 517 __entry->mod_count, 518 __entry->where) 519 ); 520 521 TRACE_EVENT(rxrpc_rx_packet, 522 TP_PROTO(struct rxrpc_skb_priv *sp), 523 524 TP_ARGS(sp), 525 526 TP_STRUCT__entry( 527 __field_struct(struct rxrpc_host_header, hdr ) 528 ), 529 530 TP_fast_assign( 531 memcpy(&__entry->hdr, &sp->hdr, sizeof(__entry->hdr)); 532 ), 533 534 TP_printk("%08x:%08x:%08x:%04x %08x %08x %02x %02x %s", 535 __entry->hdr.epoch, __entry->hdr.cid, 536 __entry->hdr.callNumber, __entry->hdr.serviceId, 537 __entry->hdr.serial, __entry->hdr.seq, 538 __entry->hdr.type, __entry->hdr.flags, 539 __entry->hdr.type <= 15 ? 540 __print_symbolic(__entry->hdr.type, rxrpc_pkts) : "?UNK") 541 ); 542 543 TRACE_EVENT(rxrpc_rx_done, 544 TP_PROTO(int result, int abort_code), 545 546 TP_ARGS(result, abort_code), 547 548 TP_STRUCT__entry( 549 __field(int, result ) 550 __field(int, abort_code ) 551 ), 552 553 TP_fast_assign( 554 __entry->result = result; 555 __entry->abort_code = abort_code; 556 ), 557 558 TP_printk("r=%d a=%d", __entry->result, __entry->abort_code) 559 ); 560 561 TRACE_EVENT(rxrpc_abort, 562 TP_PROTO(const char *why, u32 cid, u32 call_id, rxrpc_seq_t seq, 563 int abort_code, int error), 564 565 TP_ARGS(why, cid, call_id, seq, abort_code, error), 566 567 TP_STRUCT__entry( 568 __array(char, why, 4 ) 569 __field(u32, cid ) 570 __field(u32, call_id ) 571 __field(rxrpc_seq_t, seq ) 572 __field(int, abort_code ) 573 __field(int, error ) 574 ), 575 576 TP_fast_assign( 577 memcpy(__entry->why, why, 4); 578 __entry->cid = cid; 579 __entry->call_id = call_id; 580 __entry->abort_code = abort_code; 581 __entry->error = error; 582 __entry->seq = seq; 583 ), 584 585 TP_printk("%08x:%08x s=%u a=%d e=%d %s", 586 __entry->cid, __entry->call_id, __entry->seq, 587 __entry->abort_code, __entry->error, __entry->why) 588 ); 589 590 TRACE_EVENT(rxrpc_transmit, 591 TP_PROTO(struct rxrpc_call *call, enum rxrpc_transmit_trace why), 592 593 TP_ARGS(call, why), 594 595 TP_STRUCT__entry( 596 __field(struct rxrpc_call *, call ) 597 __field(enum rxrpc_transmit_trace, why ) 598 __field(rxrpc_seq_t, tx_hard_ack ) 599 __field(rxrpc_seq_t, tx_top ) 600 __field(int, tx_winsize ) 601 ), 602 603 TP_fast_assign( 604 __entry->call = call; 605 __entry->why = why; 606 __entry->tx_hard_ack = call->tx_hard_ack; 607 __entry->tx_top = call->tx_top; 608 __entry->tx_winsize = call->tx_winsize; 609 ), 610 611 TP_printk("c=%p %s f=%08x n=%u/%u", 612 __entry->call, 613 __print_symbolic(__entry->why, rxrpc_transmit_traces), 614 __entry->tx_hard_ack + 1, 615 __entry->tx_top - __entry->tx_hard_ack, 616 __entry->tx_winsize) 617 ); 618 619 TRACE_EVENT(rxrpc_rx_data, 620 TP_PROTO(struct rxrpc_call *call, rxrpc_seq_t seq, 621 rxrpc_serial_t serial, u8 flags, u8 anno), 622 623 TP_ARGS(call, seq, serial, flags, anno), 624 625 TP_STRUCT__entry( 626 __field(struct rxrpc_call *, call ) 627 __field(rxrpc_seq_t, seq ) 628 __field(rxrpc_serial_t, serial ) 629 __field(u8, flags ) 630 __field(u8, anno ) 631 ), 632 633 TP_fast_assign( 634 __entry->call = call; 635 __entry->seq = seq; 636 __entry->serial = serial; 637 __entry->flags = flags; 638 __entry->anno = anno; 639 ), 640 641 TP_printk("c=%p DATA %08x q=%08x fl=%02x a=%02x", 642 __entry->call, 643 __entry->serial, 644 __entry->seq, 645 __entry->flags, 646 __entry->anno) 647 ); 648 649 TRACE_EVENT(rxrpc_rx_ack, 650 TP_PROTO(struct rxrpc_call *call, 651 rxrpc_serial_t serial, rxrpc_serial_t ack_serial, 652 rxrpc_seq_t first, rxrpc_seq_t prev, u8 reason, u8 n_acks), 653 654 TP_ARGS(call, serial, ack_serial, first, prev, reason, n_acks), 655 656 TP_STRUCT__entry( 657 __field(struct rxrpc_call *, call ) 658 __field(rxrpc_serial_t, serial ) 659 __field(rxrpc_serial_t, ack_serial ) 660 __field(rxrpc_seq_t, first ) 661 __field(rxrpc_seq_t, prev ) 662 __field(u8, reason ) 663 __field(u8, n_acks ) 664 ), 665 666 TP_fast_assign( 667 __entry->call = call; 668 __entry->serial = serial; 669 __entry->ack_serial = ack_serial; 670 __entry->first = first; 671 __entry->prev = prev; 672 __entry->reason = reason; 673 __entry->n_acks = n_acks; 674 ), 675 676 TP_printk("c=%p %08x %s r=%08x f=%08x p=%08x n=%u", 677 __entry->call, 678 __entry->serial, 679 __print_symbolic(__entry->reason, rxrpc_ack_names), 680 __entry->ack_serial, 681 __entry->first, 682 __entry->prev, 683 __entry->n_acks) 684 ); 685 686 TRACE_EVENT(rxrpc_rx_abort, 687 TP_PROTO(struct rxrpc_call *call, rxrpc_serial_t serial, 688 u32 abort_code), 689 690 TP_ARGS(call, serial, abort_code), 691 692 TP_STRUCT__entry( 693 __field(struct rxrpc_call *, call ) 694 __field(rxrpc_serial_t, serial ) 695 __field(u32, abort_code ) 696 ), 697 698 TP_fast_assign( 699 __entry->call = call; 700 __entry->serial = serial; 701 __entry->abort_code = abort_code; 702 ), 703 704 TP_printk("c=%p ABORT %08x ac=%d", 705 __entry->call, 706 __entry->serial, 707 __entry->abort_code) 708 ); 709 710 TRACE_EVENT(rxrpc_rx_rwind_change, 711 TP_PROTO(struct rxrpc_call *call, rxrpc_serial_t serial, 712 u32 rwind, bool wake), 713 714 TP_ARGS(call, serial, rwind, wake), 715 716 TP_STRUCT__entry( 717 __field(struct rxrpc_call *, call ) 718 __field(rxrpc_serial_t, serial ) 719 __field(u32, rwind ) 720 __field(bool, wake ) 721 ), 722 723 TP_fast_assign( 724 __entry->call = call; 725 __entry->serial = serial; 726 __entry->rwind = rwind; 727 __entry->wake = wake; 728 ), 729 730 TP_printk("c=%p %08x rw=%u%s", 731 __entry->call, 732 __entry->serial, 733 __entry->rwind, 734 __entry->wake ? " wake" : "") 735 ); 736 737 TRACE_EVENT(rxrpc_tx_data, 738 TP_PROTO(struct rxrpc_call *call, rxrpc_seq_t seq, 739 rxrpc_serial_t serial, u8 flags, bool retrans, bool lose), 740 741 TP_ARGS(call, seq, serial, flags, retrans, lose), 742 743 TP_STRUCT__entry( 744 __field(struct rxrpc_call *, call ) 745 __field(rxrpc_seq_t, seq ) 746 __field(rxrpc_serial_t, serial ) 747 __field(u8, flags ) 748 __field(bool, retrans ) 749 __field(bool, lose ) 750 ), 751 752 TP_fast_assign( 753 __entry->call = call; 754 __entry->seq = seq; 755 __entry->serial = serial; 756 __entry->flags = flags; 757 __entry->retrans = retrans; 758 __entry->lose = lose; 759 ), 760 761 TP_printk("c=%p DATA %08x q=%08x fl=%02x%s%s", 762 __entry->call, 763 __entry->serial, 764 __entry->seq, 765 __entry->flags, 766 __entry->retrans ? " *RETRANS*" : "", 767 __entry->lose ? " *LOSE*" : "") 768 ); 769 770 TRACE_EVENT(rxrpc_tx_ack, 771 TP_PROTO(struct rxrpc_call *call, rxrpc_serial_t serial, 772 rxrpc_seq_t ack_first, rxrpc_serial_t ack_serial, 773 u8 reason, u8 n_acks), 774 775 TP_ARGS(call, serial, ack_first, ack_serial, reason, n_acks), 776 777 TP_STRUCT__entry( 778 __field(struct rxrpc_call *, call ) 779 __field(rxrpc_serial_t, serial ) 780 __field(rxrpc_seq_t, ack_first ) 781 __field(rxrpc_serial_t, ack_serial ) 782 __field(u8, reason ) 783 __field(u8, n_acks ) 784 ), 785 786 TP_fast_assign( 787 __entry->call = call; 788 __entry->serial = serial; 789 __entry->ack_first = ack_first; 790 __entry->ack_serial = ack_serial; 791 __entry->reason = reason; 792 __entry->n_acks = n_acks; 793 ), 794 795 TP_printk(" c=%p ACK %08x %s f=%08x r=%08x n=%u", 796 __entry->call, 797 __entry->serial, 798 __print_symbolic(__entry->reason, rxrpc_ack_names), 799 __entry->ack_first, 800 __entry->ack_serial, 801 __entry->n_acks) 802 ); 803 804 TRACE_EVENT(rxrpc_receive, 805 TP_PROTO(struct rxrpc_call *call, enum rxrpc_receive_trace why, 806 rxrpc_serial_t serial, rxrpc_seq_t seq), 807 808 TP_ARGS(call, why, serial, seq), 809 810 TP_STRUCT__entry( 811 __field(struct rxrpc_call *, call ) 812 __field(enum rxrpc_receive_trace, why ) 813 __field(rxrpc_serial_t, serial ) 814 __field(rxrpc_seq_t, seq ) 815 __field(rxrpc_seq_t, hard_ack ) 816 __field(rxrpc_seq_t, top ) 817 ), 818 819 TP_fast_assign( 820 __entry->call = call; 821 __entry->why = why; 822 __entry->serial = serial; 823 __entry->seq = seq; 824 __entry->hard_ack = call->rx_hard_ack; 825 __entry->top = call->rx_top; 826 ), 827 828 TP_printk("c=%p %s r=%08x q=%08x w=%08x-%08x", 829 __entry->call, 830 __print_symbolic(__entry->why, rxrpc_receive_traces), 831 __entry->serial, 832 __entry->seq, 833 __entry->hard_ack, 834 __entry->top) 835 ); 836 837 TRACE_EVENT(rxrpc_recvmsg, 838 TP_PROTO(struct rxrpc_call *call, enum rxrpc_recvmsg_trace why, 839 rxrpc_seq_t seq, unsigned int offset, unsigned int len, 840 int ret), 841 842 TP_ARGS(call, why, seq, offset, len, ret), 843 844 TP_STRUCT__entry( 845 __field(struct rxrpc_call *, call ) 846 __field(enum rxrpc_recvmsg_trace, why ) 847 __field(rxrpc_seq_t, seq ) 848 __field(unsigned int, offset ) 849 __field(unsigned int, len ) 850 __field(int, ret ) 851 ), 852 853 TP_fast_assign( 854 __entry->call = call; 855 __entry->why = why; 856 __entry->seq = seq; 857 __entry->offset = offset; 858 __entry->len = len; 859 __entry->ret = ret; 860 ), 861 862 TP_printk("c=%p %s q=%08x o=%u l=%u ret=%d", 863 __entry->call, 864 __print_symbolic(__entry->why, rxrpc_recvmsg_traces), 865 __entry->seq, 866 __entry->offset, 867 __entry->len, 868 __entry->ret) 869 ); 870 871 TRACE_EVENT(rxrpc_rtt_tx, 872 TP_PROTO(struct rxrpc_call *call, enum rxrpc_rtt_tx_trace why, 873 rxrpc_serial_t send_serial), 874 875 TP_ARGS(call, why, send_serial), 876 877 TP_STRUCT__entry( 878 __field(struct rxrpc_call *, call ) 879 __field(enum rxrpc_rtt_tx_trace, why ) 880 __field(rxrpc_serial_t, send_serial ) 881 ), 882 883 TP_fast_assign( 884 __entry->call = call; 885 __entry->why = why; 886 __entry->send_serial = send_serial; 887 ), 888 889 TP_printk("c=%p %s sr=%08x", 890 __entry->call, 891 __print_symbolic(__entry->why, rxrpc_rtt_tx_traces), 892 __entry->send_serial) 893 ); 894 895 TRACE_EVENT(rxrpc_rtt_rx, 896 TP_PROTO(struct rxrpc_call *call, enum rxrpc_rtt_rx_trace why, 897 rxrpc_serial_t send_serial, rxrpc_serial_t resp_serial, 898 s64 rtt, u8 nr, s64 avg), 899 900 TP_ARGS(call, why, send_serial, resp_serial, rtt, nr, avg), 901 902 TP_STRUCT__entry( 903 __field(struct rxrpc_call *, call ) 904 __field(enum rxrpc_rtt_rx_trace, why ) 905 __field(u8, nr ) 906 __field(rxrpc_serial_t, send_serial ) 907 __field(rxrpc_serial_t, resp_serial ) 908 __field(s64, rtt ) 909 __field(u64, avg ) 910 ), 911 912 TP_fast_assign( 913 __entry->call = call; 914 __entry->why = why; 915 __entry->send_serial = send_serial; 916 __entry->resp_serial = resp_serial; 917 __entry->rtt = rtt; 918 __entry->nr = nr; 919 __entry->avg = avg; 920 ), 921 922 TP_printk("c=%p %s sr=%08x rr=%08x rtt=%lld nr=%u avg=%lld", 923 __entry->call, 924 __print_symbolic(__entry->why, rxrpc_rtt_rx_traces), 925 __entry->send_serial, 926 __entry->resp_serial, 927 __entry->rtt, 928 __entry->nr, 929 __entry->avg) 930 ); 931 932 TRACE_EVENT(rxrpc_timer, 933 TP_PROTO(struct rxrpc_call *call, enum rxrpc_timer_trace why, 934 ktime_t now, unsigned long now_j), 935 936 TP_ARGS(call, why, now, now_j), 937 938 TP_STRUCT__entry( 939 __field(struct rxrpc_call *, call ) 940 __field(enum rxrpc_timer_trace, why ) 941 __field_struct(ktime_t, now ) 942 __field_struct(ktime_t, expire_at ) 943 __field_struct(ktime_t, ack_at ) 944 __field_struct(ktime_t, resend_at ) 945 __field(unsigned long, now_j ) 946 __field(unsigned long, timer ) 947 ), 948 949 TP_fast_assign( 950 __entry->call = call; 951 __entry->why = why; 952 __entry->now = now; 953 __entry->expire_at = call->expire_at; 954 __entry->ack_at = call->ack_at; 955 __entry->resend_at = call->resend_at; 956 __entry->now_j = now_j; 957 __entry->timer = call->timer.expires; 958 ), 959 960 TP_printk("c=%p %s x=%lld a=%lld r=%lld t=%ld", 961 __entry->call, 962 __print_symbolic(__entry->why, rxrpc_timer_traces), 963 ktime_to_ns(ktime_sub(__entry->expire_at, __entry->now)), 964 ktime_to_ns(ktime_sub(__entry->ack_at, __entry->now)), 965 ktime_to_ns(ktime_sub(__entry->resend_at, __entry->now)), 966 __entry->timer - __entry->now_j) 967 ); 968 969 TRACE_EVENT(rxrpc_rx_lose, 970 TP_PROTO(struct rxrpc_skb_priv *sp), 971 972 TP_ARGS(sp), 973 974 TP_STRUCT__entry( 975 __field_struct(struct rxrpc_host_header, hdr ) 976 ), 977 978 TP_fast_assign( 979 memcpy(&__entry->hdr, &sp->hdr, sizeof(__entry->hdr)); 980 ), 981 982 TP_printk("%08x:%08x:%08x:%04x %08x %08x %02x %02x %s *LOSE*", 983 __entry->hdr.epoch, __entry->hdr.cid, 984 __entry->hdr.callNumber, __entry->hdr.serviceId, 985 __entry->hdr.serial, __entry->hdr.seq, 986 __entry->hdr.type, __entry->hdr.flags, 987 __entry->hdr.type <= 15 ? 988 __print_symbolic(__entry->hdr.type, rxrpc_pkts) : "?UNK") 989 ); 990 991 TRACE_EVENT(rxrpc_propose_ack, 992 TP_PROTO(struct rxrpc_call *call, enum rxrpc_propose_ack_trace why, 993 u8 ack_reason, rxrpc_serial_t serial, bool immediate, 994 bool background, enum rxrpc_propose_ack_outcome outcome), 995 996 TP_ARGS(call, why, ack_reason, serial, immediate, background, 997 outcome), 998 999 TP_STRUCT__entry( 1000 __field(struct rxrpc_call *, call ) 1001 __field(enum rxrpc_propose_ack_trace, why ) 1002 __field(rxrpc_serial_t, serial ) 1003 __field(u8, ack_reason ) 1004 __field(bool, immediate ) 1005 __field(bool, background ) 1006 __field(enum rxrpc_propose_ack_outcome, outcome ) 1007 ), 1008 1009 TP_fast_assign( 1010 __entry->call = call; 1011 __entry->why = why; 1012 __entry->serial = serial; 1013 __entry->ack_reason = ack_reason; 1014 __entry->immediate = immediate; 1015 __entry->background = background; 1016 __entry->outcome = outcome; 1017 ), 1018 1019 TP_printk("c=%p %s %s r=%08x i=%u b=%u%s", 1020 __entry->call, 1021 __print_symbolic(__entry->why, rxrpc_propose_ack_traces), 1022 __print_symbolic(__entry->ack_reason, rxrpc_ack_names), 1023 __entry->serial, 1024 __entry->immediate, 1025 __entry->background, 1026 __print_symbolic(__entry->outcome, rxrpc_propose_ack_outcomes)) 1027 ); 1028 1029 TRACE_EVENT(rxrpc_retransmit, 1030 TP_PROTO(struct rxrpc_call *call, rxrpc_seq_t seq, u8 annotation, 1031 s64 expiry), 1032 1033 TP_ARGS(call, seq, annotation, expiry), 1034 1035 TP_STRUCT__entry( 1036 __field(struct rxrpc_call *, call ) 1037 __field(rxrpc_seq_t, seq ) 1038 __field(u8, annotation ) 1039 __field(s64, expiry ) 1040 ), 1041 1042 TP_fast_assign( 1043 __entry->call = call; 1044 __entry->seq = seq; 1045 __entry->annotation = annotation; 1046 __entry->expiry = expiry; 1047 ), 1048 1049 TP_printk("c=%p q=%x a=%02x xp=%lld", 1050 __entry->call, 1051 __entry->seq, 1052 __entry->annotation, 1053 __entry->expiry) 1054 ); 1055 1056 TRACE_EVENT(rxrpc_congest, 1057 TP_PROTO(struct rxrpc_call *call, struct rxrpc_ack_summary *summary, 1058 rxrpc_serial_t ack_serial, enum rxrpc_congest_change change), 1059 1060 TP_ARGS(call, summary, ack_serial, change), 1061 1062 TP_STRUCT__entry( 1063 __field(struct rxrpc_call *, call ) 1064 __field(enum rxrpc_congest_change, change ) 1065 __field(rxrpc_seq_t, hard_ack ) 1066 __field(rxrpc_seq_t, top ) 1067 __field(rxrpc_seq_t, lowest_nak ) 1068 __field(rxrpc_serial_t, ack_serial ) 1069 __field_struct(struct rxrpc_ack_summary, sum ) 1070 ), 1071 1072 TP_fast_assign( 1073 __entry->call = call; 1074 __entry->change = change; 1075 __entry->hard_ack = call->tx_hard_ack; 1076 __entry->top = call->tx_top; 1077 __entry->lowest_nak = call->acks_lowest_nak; 1078 __entry->ack_serial = ack_serial; 1079 memcpy(&__entry->sum, summary, sizeof(__entry->sum)); 1080 ), 1081 1082 TP_printk("c=%p %08x %s %08x %s cw=%u ss=%u nr=%u,%u nw=%u,%u r=%u b=%u u=%u d=%u l=%x%s%s%s", 1083 __entry->call, 1084 __entry->ack_serial, 1085 __print_symbolic(__entry->sum.ack_reason, rxrpc_ack_names), 1086 __entry->hard_ack, 1087 __print_symbolic(__entry->sum.mode, rxrpc_congest_modes), 1088 __entry->sum.cwnd, 1089 __entry->sum.ssthresh, 1090 __entry->sum.nr_acks, __entry->sum.nr_nacks, 1091 __entry->sum.nr_new_acks, __entry->sum.nr_new_nacks, 1092 __entry->sum.nr_rot_new_acks, 1093 __entry->top - __entry->hard_ack, 1094 __entry->sum.cumulative_acks, 1095 __entry->sum.dup_acks, 1096 __entry->lowest_nak, __entry->sum.new_low_nack ? "!" : "", 1097 __print_symbolic(__entry->change, rxrpc_congest_changes), 1098 __entry->sum.retrans_timeo ? " rTxTo" : "") 1099 ); 1100 1101 TRACE_EVENT(rxrpc_disconnect_call, 1102 TP_PROTO(struct rxrpc_call *call), 1103 1104 TP_ARGS(call), 1105 1106 TP_STRUCT__entry( 1107 __field(struct rxrpc_call *, call ) 1108 __field(u32, abort_code ) 1109 ), 1110 1111 TP_fast_assign( 1112 __entry->call = call; 1113 __entry->abort_code = call->abort_code; 1114 ), 1115 1116 TP_printk("c=%p ab=%08x", 1117 __entry->call, 1118 __entry->abort_code) 1119 ); 1120 1121 TRACE_EVENT(rxrpc_improper_term, 1122 TP_PROTO(struct rxrpc_call *call), 1123 1124 TP_ARGS(call), 1125 1126 TP_STRUCT__entry( 1127 __field(struct rxrpc_call *, call ) 1128 __field(u32, abort_code ) 1129 ), 1130 1131 TP_fast_assign( 1132 __entry->call = call; 1133 __entry->abort_code = call->abort_code; 1134 ), 1135 1136 TP_printk("c=%p ab=%08x", 1137 __entry->call, 1138 __entry->abort_code) 1139 ); 1140 1141 TRACE_EVENT(rxrpc_rx_eproto, 1142 TP_PROTO(struct rxrpc_call *call, rxrpc_serial_t serial, 1143 const char *why), 1144 1145 TP_ARGS(call, serial, why), 1146 1147 TP_STRUCT__entry( 1148 __field(struct rxrpc_call *, call ) 1149 __field(rxrpc_serial_t, serial ) 1150 __field(const char *, why ) 1151 ), 1152 1153 TP_fast_assign( 1154 __entry->call = call; 1155 __entry->serial = serial; 1156 __entry->why = why; 1157 ), 1158 1159 TP_printk("c=%p EPROTO %08x %s", 1160 __entry->call, 1161 __entry->serial, 1162 __entry->why) 1163 ); 1164 1165 TRACE_EVENT(rxrpc_connect_call, 1166 TP_PROTO(struct rxrpc_call *call), 1167 1168 TP_ARGS(call), 1169 1170 TP_STRUCT__entry( 1171 __field(struct rxrpc_call *, call ) 1172 __field(unsigned long, user_call_ID ) 1173 __field(u32, cid ) 1174 __field(u32, call_id ) 1175 ), 1176 1177 TP_fast_assign( 1178 __entry->call = call; 1179 __entry->user_call_ID = call->user_call_ID; 1180 __entry->cid = call->cid; 1181 __entry->call_id = call->call_id; 1182 ), 1183 1184 TP_printk("c=%p u=%p %08x:%08x", 1185 __entry->call, 1186 (void *)__entry->user_call_ID, 1187 __entry->cid, 1188 __entry->call_id) 1189 ); 1190 1191 #endif /* _TRACE_RXRPC_H */ 1192 1193 /* This part must be outside protection */ 1194 #include <trace/define_trace.h> 1195