forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-09 95099d4622f8cb224d94e314c7a8e0df60b13f87
kernel/drivers/usb/host/xhci-trace.h
....@@ -1,4 +1,4 @@
1
-// SPDX-License-Identifier: GPL-2.0
1
+/* SPDX-License-Identifier: GPL-2.0 */
22 /*
33 * xHCI host controller driver
44 *
....@@ -24,8 +24,6 @@
2424 #include <linux/tracepoint.h>
2525 #include "xhci.h"
2626 #include "xhci-dbgcap.h"
27
-
28
-#define XHCI_MSG_MAX 500
2927
3028 DECLARE_EVENT_CLASS(xhci_log_msg,
3129 TP_PROTO(struct va_format *vaf),
....@@ -122,6 +120,7 @@
122120 __field(u32, field1)
123121 __field(u32, field2)
124122 __field(u32, field3)
123
+ __dynamic_array(char, str, XHCI_MSG_MAX)
125124 ),
126125 TP_fast_assign(
127126 __entry->type = ring->type;
....@@ -131,7 +130,7 @@
131130 __entry->field3 = le32_to_cpu(trb->field[3]);
132131 ),
133132 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,
135134 __entry->field2, __entry->field3)
136135 )
137136 );
....@@ -323,6 +322,7 @@
323322 __field(u32, info2)
324323 __field(u64, deq)
325324 __field(u32, tx_info)
325
+ __dynamic_array(char, str, XHCI_MSG_MAX)
326326 ),
327327 TP_fast_assign(
328328 __entry->info = le32_to_cpu(ctx->ep_info);
....@@ -330,8 +330,8 @@
330330 __entry->deq = le64_to_cpu(ctx->deq);
331331 __entry->tx_info = le32_to_cpu(ctx->tx_info);
332332 ),
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)
335335 )
336336 );
337337
....@@ -355,6 +355,11 @@
355355 TP_ARGS(ctx)
356356 );
357357
358
+DEFINE_EVENT(xhci_log_ep_ctx, xhci_add_endpoint,
359
+ TP_PROTO(struct xhci_ep_ctx *ctx),
360
+ TP_ARGS(ctx)
361
+);
362
+
358363 DECLARE_EVENT_CLASS(xhci_log_slot_ctx,
359364 TP_PROTO(struct xhci_slot_ctx *ctx),
360365 TP_ARGS(ctx),
....@@ -363,6 +368,7 @@
363368 __field(u32, info2)
364369 __field(u32, tt_info)
365370 __field(u32, state)
371
+ __dynamic_array(char, str, XHCI_MSG_MAX)
366372 ),
367373 TP_fast_assign(
368374 __entry->info = le32_to_cpu(ctx->dev_info);
....@@ -370,9 +376,9 @@
370376 __entry->tt_info = le64_to_cpu(ctx->tt_info);
371377 __entry->state = le32_to_cpu(ctx->dev_state);
372378 ),
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)
376382 )
377383 );
378384
....@@ -419,6 +425,32 @@
419425 DEFINE_EVENT(xhci_log_slot_ctx, xhci_configure_endpoint,
420426 TP_PROTO(struct xhci_slot_ctx *ctx),
421427 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)
422454 );
423455
424456 DECLARE_EVENT_CLASS(xhci_log_ring,
....@@ -493,6 +525,7 @@
493525 TP_STRUCT__entry(
494526 __field(u32, portnum)
495527 __field(u32, portsc)
528
+ __dynamic_array(char, str, XHCI_MSG_MAX)
496529 ),
497530 TP_fast_assign(
498531 __entry->portnum = portnum;
....@@ -500,7 +533,7 @@
500533 ),
501534 TP_printk("port-%d: %s",
502535 __entry->portnum,
503
- xhci_decode_portsc(__entry->portsc)
536
+ xhci_decode_portsc(__get_str(str), __entry->portsc)
504537 )
505538 );
506539
....@@ -519,6 +552,33 @@
519552 TP_ARGS(portnum, portsc)
520553 );
521554
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
+
522582 DECLARE_EVENT_CLASS(xhci_dbc_log_request,
523583 TP_PROTO(struct dbc_request *req),
524584 TP_ARGS(req),