usb: xhci: change some trace event __dynamic_array() to __get_buf()
some __dynamic_array() buffer will only used at trace event output time, change to __get_buf() which will allocate tempary trace seq buffer for output purpose. Signed-off-by: Linyu Yuan <quic_linyyuan@quicinc.com> Link: https://lore.kernel.org/r/1677465850-1396-5-git-send-email-quic_linyyuan@quicinc.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
f09d24aa46
commit
7d1a898f52
@@ -120,7 +120,6 @@ DECLARE_EVENT_CLASS(xhci_log_trb,
|
||||
__field(u32, field1)
|
||||
__field(u32, field2)
|
||||
__field(u32, field3)
|
||||
__dynamic_array(char, str, XHCI_MSG_MAX)
|
||||
),
|
||||
TP_fast_assign(
|
||||
__entry->type = ring->type;
|
||||
@@ -130,8 +129,8 @@ DECLARE_EVENT_CLASS(xhci_log_trb,
|
||||
__entry->field3 = le32_to_cpu(trb->field[3]);
|
||||
),
|
||||
TP_printk("%s: %s", xhci_ring_type_string(__entry->type),
|
||||
xhci_decode_trb(__get_str(str), XHCI_MSG_MAX, __entry->field0, __entry->field1,
|
||||
__entry->field2, __entry->field3)
|
||||
xhci_decode_trb(__get_buf(XHCI_MSG_MAX), XHCI_MSG_MAX, __entry->field0,
|
||||
__entry->field1, __entry->field2, __entry->field3)
|
||||
)
|
||||
);
|
||||
|
||||
@@ -322,7 +321,6 @@ DECLARE_EVENT_CLASS(xhci_log_ep_ctx,
|
||||
__field(u32, info2)
|
||||
__field(u64, deq)
|
||||
__field(u32, tx_info)
|
||||
__dynamic_array(char, str, XHCI_MSG_MAX)
|
||||
),
|
||||
TP_fast_assign(
|
||||
__entry->info = le32_to_cpu(ctx->ep_info);
|
||||
@@ -330,7 +328,7 @@ DECLARE_EVENT_CLASS(xhci_log_ep_ctx,
|
||||
__entry->deq = le64_to_cpu(ctx->deq);
|
||||
__entry->tx_info = le32_to_cpu(ctx->tx_info);
|
||||
),
|
||||
TP_printk("%s", xhci_decode_ep_context(__get_str(str),
|
||||
TP_printk("%s", xhci_decode_ep_context(__get_buf(XHCI_MSG_MAX),
|
||||
__entry->info, __entry->info2, __entry->deq, __entry->tx_info)
|
||||
)
|
||||
);
|
||||
@@ -368,7 +366,6 @@ DECLARE_EVENT_CLASS(xhci_log_slot_ctx,
|
||||
__field(u32, info2)
|
||||
__field(u32, tt_info)
|
||||
__field(u32, state)
|
||||
__dynamic_array(char, str, XHCI_MSG_MAX)
|
||||
),
|
||||
TP_fast_assign(
|
||||
__entry->info = le32_to_cpu(ctx->dev_info);
|
||||
@@ -376,7 +373,7 @@ DECLARE_EVENT_CLASS(xhci_log_slot_ctx,
|
||||
__entry->tt_info = le64_to_cpu(ctx->tt_info);
|
||||
__entry->state = le32_to_cpu(ctx->dev_state);
|
||||
),
|
||||
TP_printk("%s", xhci_decode_slot_context(__get_str(str),
|
||||
TP_printk("%s", xhci_decode_slot_context(__get_buf(XHCI_MSG_MAX),
|
||||
__entry->info, __entry->info2,
|
||||
__entry->tt_info, __entry->state)
|
||||
)
|
||||
@@ -433,13 +430,12 @@ DECLARE_EVENT_CLASS(xhci_log_ctrl_ctx,
|
||||
TP_STRUCT__entry(
|
||||
__field(u32, drop)
|
||||
__field(u32, add)
|
||||
__dynamic_array(char, str, XHCI_MSG_MAX)
|
||||
),
|
||||
TP_fast_assign(
|
||||
__entry->drop = le32_to_cpu(ctrl_ctx->drop_flags);
|
||||
__entry->add = le32_to_cpu(ctrl_ctx->add_flags);
|
||||
),
|
||||
TP_printk("%s", xhci_decode_ctrl_ctx(__get_str(str), __entry->drop, __entry->add)
|
||||
TP_printk("%s", xhci_decode_ctrl_ctx(__get_buf(XHCI_MSG_MAX), __entry->drop, __entry->add)
|
||||
)
|
||||
);
|
||||
|
||||
@@ -525,7 +521,6 @@ DECLARE_EVENT_CLASS(xhci_log_portsc,
|
||||
TP_STRUCT__entry(
|
||||
__field(u32, portnum)
|
||||
__field(u32, portsc)
|
||||
__dynamic_array(char, str, XHCI_MSG_MAX)
|
||||
),
|
||||
TP_fast_assign(
|
||||
__entry->portnum = portnum;
|
||||
@@ -533,7 +528,7 @@ DECLARE_EVENT_CLASS(xhci_log_portsc,
|
||||
),
|
||||
TP_printk("port-%d: %s",
|
||||
__entry->portnum,
|
||||
xhci_decode_portsc(__get_str(str), __entry->portsc)
|
||||
xhci_decode_portsc(__get_buf(XHCI_MSG_MAX), __entry->portsc)
|
||||
)
|
||||
);
|
||||
|
||||
@@ -558,14 +553,13 @@ DECLARE_EVENT_CLASS(xhci_log_doorbell,
|
||||
TP_STRUCT__entry(
|
||||
__field(u32, slot)
|
||||
__field(u32, doorbell)
|
||||
__dynamic_array(char, str, XHCI_MSG_MAX)
|
||||
),
|
||||
TP_fast_assign(
|
||||
__entry->slot = slot;
|
||||
__entry->doorbell = doorbell;
|
||||
),
|
||||
TP_printk("Ring doorbell for %s",
|
||||
xhci_decode_doorbell(__get_str(str), __entry->slot, __entry->doorbell)
|
||||
xhci_decode_doorbell(__get_buf(XHCI_MSG_MAX), __entry->slot, __entry->doorbell)
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user