| .. | .. |
|---|
| 1 | | -// SPDX-License-Identifier: GPL-2.0 |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0 */ |
|---|
| 2 | 2 | /* |
|---|
| 3 | 3 | * xHCI host controller driver |
|---|
| 4 | 4 | * |
|---|
| .. | .. |
|---|
| 24 | 24 | #include <linux/tracepoint.h> |
|---|
| 25 | 25 | #include "xhci.h" |
|---|
| 26 | 26 | #include "xhci-dbgcap.h" |
|---|
| 27 | | - |
|---|
| 28 | | -#define XHCI_MSG_MAX 500 |
|---|
| 29 | 27 | |
|---|
| 30 | 28 | DECLARE_EVENT_CLASS(xhci_log_msg, |
|---|
| 31 | 29 | TP_PROTO(struct va_format *vaf), |
|---|
| .. | .. |
|---|
| 122 | 120 | __field(u32, field1) |
|---|
| 123 | 121 | __field(u32, field2) |
|---|
| 124 | 122 | __field(u32, field3) |
|---|
| 123 | + __dynamic_array(char, str, XHCI_MSG_MAX) |
|---|
| 125 | 124 | ), |
|---|
| 126 | 125 | TP_fast_assign( |
|---|
| 127 | 126 | __entry->type = ring->type; |
|---|
| .. | .. |
|---|
| 131 | 130 | __entry->field3 = le32_to_cpu(trb->field[3]); |
|---|
| 132 | 131 | ), |
|---|
| 133 | 132 | TP_printk("%s: %s", xhci_ring_type_string(__entry->type), |
|---|
| 134 | | - xhci_decode_trb(__entry->field0, __entry->field1, |
|---|
| 133 | + xhci_decode_trb(__get_str(str), XHCI_MSG_MAX, __entry->field0, __entry->field1, |
|---|
| 135 | 134 | __entry->field2, __entry->field3) |
|---|
| 136 | 135 | ) |
|---|
| 137 | 136 | ); |
|---|
| .. | .. |
|---|
| 323 | 322 | __field(u32, info2) |
|---|
| 324 | 323 | __field(u64, deq) |
|---|
| 325 | 324 | __field(u32, tx_info) |
|---|
| 325 | + __dynamic_array(char, str, XHCI_MSG_MAX) |
|---|
| 326 | 326 | ), |
|---|
| 327 | 327 | TP_fast_assign( |
|---|
| 328 | 328 | __entry->info = le32_to_cpu(ctx->ep_info); |
|---|
| .. | .. |
|---|
| 330 | 330 | __entry->deq = le64_to_cpu(ctx->deq); |
|---|
| 331 | 331 | __entry->tx_info = le32_to_cpu(ctx->tx_info); |
|---|
| 332 | 332 | ), |
|---|
| 333 | | - TP_printk("%s", xhci_decode_ep_context(__entry->info, |
|---|
| 334 | | - __entry->info2, __entry->deq, __entry->tx_info) |
|---|
| 333 | + TP_printk("%s", xhci_decode_ep_context(__get_str(str), |
|---|
| 334 | + __entry->info, __entry->info2, __entry->deq, __entry->tx_info) |
|---|
| 335 | 335 | ) |
|---|
| 336 | 336 | ); |
|---|
| 337 | 337 | |
|---|
| .. | .. |
|---|
| 355 | 355 | TP_ARGS(ctx) |
|---|
| 356 | 356 | ); |
|---|
| 357 | 357 | |
|---|
| 358 | +DEFINE_EVENT(xhci_log_ep_ctx, xhci_add_endpoint, |
|---|
| 359 | + TP_PROTO(struct xhci_ep_ctx *ctx), |
|---|
| 360 | + TP_ARGS(ctx) |
|---|
| 361 | +); |
|---|
| 362 | + |
|---|
| 358 | 363 | DECLARE_EVENT_CLASS(xhci_log_slot_ctx, |
|---|
| 359 | 364 | TP_PROTO(struct xhci_slot_ctx *ctx), |
|---|
| 360 | 365 | TP_ARGS(ctx), |
|---|
| .. | .. |
|---|
| 363 | 368 | __field(u32, info2) |
|---|
| 364 | 369 | __field(u32, tt_info) |
|---|
| 365 | 370 | __field(u32, state) |
|---|
| 371 | + __dynamic_array(char, str, XHCI_MSG_MAX) |
|---|
| 366 | 372 | ), |
|---|
| 367 | 373 | TP_fast_assign( |
|---|
| 368 | 374 | __entry->info = le32_to_cpu(ctx->dev_info); |
|---|
| .. | .. |
|---|
| 370 | 376 | __entry->tt_info = le64_to_cpu(ctx->tt_info); |
|---|
| 371 | 377 | __entry->state = le32_to_cpu(ctx->dev_state); |
|---|
| 372 | 378 | ), |
|---|
| 373 | | - TP_printk("%s", xhci_decode_slot_context(__entry->info, |
|---|
| 374 | | - __entry->info2, __entry->tt_info, |
|---|
| 375 | | - __entry->state) |
|---|
| 379 | + TP_printk("%s", xhci_decode_slot_context(__get_str(str), |
|---|
| 380 | + __entry->info, __entry->info2, |
|---|
| 381 | + __entry->tt_info, __entry->state) |
|---|
| 376 | 382 | ) |
|---|
| 377 | 383 | ); |
|---|
| 378 | 384 | |
|---|
| .. | .. |
|---|
| 419 | 425 | DEFINE_EVENT(xhci_log_slot_ctx, xhci_configure_endpoint, |
|---|
| 420 | 426 | TP_PROTO(struct xhci_slot_ctx *ctx), |
|---|
| 421 | 427 | TP_ARGS(ctx) |
|---|
| 428 | +); |
|---|
| 429 | + |
|---|
| 430 | +DECLARE_EVENT_CLASS(xhci_log_ctrl_ctx, |
|---|
| 431 | + TP_PROTO(struct xhci_input_control_ctx *ctrl_ctx), |
|---|
| 432 | + TP_ARGS(ctrl_ctx), |
|---|
| 433 | + TP_STRUCT__entry( |
|---|
| 434 | + __field(u32, drop) |
|---|
| 435 | + __field(u32, add) |
|---|
| 436 | + __dynamic_array(char, str, XHCI_MSG_MAX) |
|---|
| 437 | + ), |
|---|
| 438 | + TP_fast_assign( |
|---|
| 439 | + __entry->drop = le32_to_cpu(ctrl_ctx->drop_flags); |
|---|
| 440 | + __entry->add = le32_to_cpu(ctrl_ctx->add_flags); |
|---|
| 441 | + ), |
|---|
| 442 | + TP_printk("%s", xhci_decode_ctrl_ctx(__get_str(str), __entry->drop, __entry->add) |
|---|
| 443 | + ) |
|---|
| 444 | +); |
|---|
| 445 | + |
|---|
| 446 | +DEFINE_EVENT(xhci_log_ctrl_ctx, xhci_address_ctrl_ctx, |
|---|
| 447 | + TP_PROTO(struct xhci_input_control_ctx *ctrl_ctx), |
|---|
| 448 | + TP_ARGS(ctrl_ctx) |
|---|
| 449 | +); |
|---|
| 450 | + |
|---|
| 451 | +DEFINE_EVENT(xhci_log_ctrl_ctx, xhci_configure_endpoint_ctrl_ctx, |
|---|
| 452 | + TP_PROTO(struct xhci_input_control_ctx *ctrl_ctx), |
|---|
| 453 | + TP_ARGS(ctrl_ctx) |
|---|
| 422 | 454 | ); |
|---|
| 423 | 455 | |
|---|
| 424 | 456 | DECLARE_EVENT_CLASS(xhci_log_ring, |
|---|
| .. | .. |
|---|
| 493 | 525 | TP_STRUCT__entry( |
|---|
| 494 | 526 | __field(u32, portnum) |
|---|
| 495 | 527 | __field(u32, portsc) |
|---|
| 528 | + __dynamic_array(char, str, XHCI_MSG_MAX) |
|---|
| 496 | 529 | ), |
|---|
| 497 | 530 | TP_fast_assign( |
|---|
| 498 | 531 | __entry->portnum = portnum; |
|---|
| .. | .. |
|---|
| 500 | 533 | ), |
|---|
| 501 | 534 | TP_printk("port-%d: %s", |
|---|
| 502 | 535 | __entry->portnum, |
|---|
| 503 | | - xhci_decode_portsc(__entry->portsc) |
|---|
| 536 | + xhci_decode_portsc(__get_str(str), __entry->portsc) |
|---|
| 504 | 537 | ) |
|---|
| 505 | 538 | ); |
|---|
| 506 | 539 | |
|---|
| .. | .. |
|---|
| 519 | 552 | TP_ARGS(portnum, portsc) |
|---|
| 520 | 553 | ); |
|---|
| 521 | 554 | |
|---|
| 555 | +DECLARE_EVENT_CLASS(xhci_log_doorbell, |
|---|
| 556 | + TP_PROTO(u32 slot, u32 doorbell), |
|---|
| 557 | + TP_ARGS(slot, doorbell), |
|---|
| 558 | + TP_STRUCT__entry( |
|---|
| 559 | + __field(u32, slot) |
|---|
| 560 | + __field(u32, doorbell) |
|---|
| 561 | + __dynamic_array(char, str, XHCI_MSG_MAX) |
|---|
| 562 | + ), |
|---|
| 563 | + TP_fast_assign( |
|---|
| 564 | + __entry->slot = slot; |
|---|
| 565 | + __entry->doorbell = doorbell; |
|---|
| 566 | + ), |
|---|
| 567 | + TP_printk("Ring doorbell for %s", |
|---|
| 568 | + xhci_decode_doorbell(__get_str(str), __entry->slot, __entry->doorbell) |
|---|
| 569 | + ) |
|---|
| 570 | +); |
|---|
| 571 | + |
|---|
| 572 | +DEFINE_EVENT(xhci_log_doorbell, xhci_ring_ep_doorbell, |
|---|
| 573 | + TP_PROTO(u32 slot, u32 doorbell), |
|---|
| 574 | + TP_ARGS(slot, doorbell) |
|---|
| 575 | +); |
|---|
| 576 | + |
|---|
| 577 | +DEFINE_EVENT(xhci_log_doorbell, xhci_ring_host_doorbell, |
|---|
| 578 | + TP_PROTO(u32 slot, u32 doorbell), |
|---|
| 579 | + TP_ARGS(slot, doorbell) |
|---|
| 580 | +); |
|---|
| 581 | + |
|---|
| 522 | 582 | DECLARE_EVENT_CLASS(xhci_dbc_log_request, |
|---|
| 523 | 583 | TP_PROTO(struct dbc_request *req), |
|---|
| 524 | 584 | TP_ARGS(req), |
|---|