Commit 65ec7ebe authored by Takashi Sakamoto's avatar Takashi Sakamoto

firewire: core: record card index in tracepoinrts events derived from async_inbound_template

The asynchronous transaction is initiated on one of 1394 OHCI controller,
however the existing tracepoints events has the lack of data about it.

This commit adds card_index member into event structure to store the index
of host controller in use, and prints it.

Link: https://lore.kernel.org/r/20240613131440.431766-4-o-takashi@sakamocchi.jpSigned-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
parent 64e02b64
...@@ -1009,8 +1009,8 @@ void fw_core_handle_request(struct fw_card *card, struct fw_packet *p) ...@@ -1009,8 +1009,8 @@ void fw_core_handle_request(struct fw_card *card, struct fw_packet *p)
return; return;
} }
trace_async_request_inbound((uintptr_t)request, p->generation, p->speed, p->ack, trace_async_request_inbound((uintptr_t)request, card->index, p->generation, p->speed,
p->timestamp, p->header, request->data, p->ack, p->timestamp, p->header, request->data,
tcode_is_read_request(tcode) ? 0 : request->length / 4); tcode_is_read_request(tcode) ? 0 : request->length / 4);
offset = async_header_get_offset(p->header); offset = async_header_get_offset(p->header);
...@@ -1080,8 +1080,8 @@ void fw_core_handle_response(struct fw_card *card, struct fw_packet *p) ...@@ -1080,8 +1080,8 @@ void fw_core_handle_response(struct fw_card *card, struct fw_packet *p)
} }
spin_unlock_irqrestore(&card->lock, flags); spin_unlock_irqrestore(&card->lock, flags);
trace_async_response_inbound((uintptr_t)t, p->generation, p->speed, p->ack, p->timestamp, trace_async_response_inbound((uintptr_t)t, card->index, p->generation, p->speed, p->ack,
p->header, data, data_length / 4); p->timestamp, p->header, data, data_length / 4);
if (!t) { if (!t) {
timed_out: timed_out:
......
...@@ -105,10 +105,11 @@ DECLARE_EVENT_CLASS(async_outbound_complete_template, ...@@ -105,10 +105,11 @@ DECLARE_EVENT_CLASS(async_outbound_complete_template,
// The value of status is one of ack codes and rcodes specific to Linux FireWire subsystem. // The value of status is one of ack codes and rcodes specific to Linux FireWire subsystem.
DECLARE_EVENT_CLASS(async_inbound_template, DECLARE_EVENT_CLASS(async_inbound_template,
TP_PROTO(u64 transaction, unsigned int generation, unsigned int scode, unsigned int status, unsigned int timestamp, const u32 *header, const u32 *data, unsigned int data_count), TP_PROTO(u64 transaction, unsigned int card_index, unsigned int generation, unsigned int scode, unsigned int status, unsigned int timestamp, const u32 *header, const u32 *data, unsigned int data_count),
TP_ARGS(transaction, generation, scode, status, timestamp, header, data, data_count), TP_ARGS(transaction, card_index, generation, scode, status, timestamp, header, data, data_count),
TP_STRUCT__entry( TP_STRUCT__entry(
__field(u64, transaction) __field(u64, transaction)
__field(u8, card_index)
__field(u8, generation) __field(u8, generation)
__field(u8, scode) __field(u8, scode)
__field(u8, status) __field(u8, status)
...@@ -118,6 +119,7 @@ DECLARE_EVENT_CLASS(async_inbound_template, ...@@ -118,6 +119,7 @@ DECLARE_EVENT_CLASS(async_inbound_template,
), ),
TP_fast_assign( TP_fast_assign(
__entry->transaction = transaction; __entry->transaction = transaction;
__entry->card_index = card_index;
__entry->generation = generation; __entry->generation = generation;
__entry->scode = scode; __entry->scode = scode;
__entry->status = status; __entry->status = status;
...@@ -127,8 +129,9 @@ DECLARE_EVENT_CLASS(async_inbound_template, ...@@ -127,8 +129,9 @@ DECLARE_EVENT_CLASS(async_inbound_template,
), ),
// This format is for the response subaction. // This format is for the response subaction.
TP_printk( TP_printk(
"transaction=0x%llx generation=%u scode=%u status=%u timestamp=0x%04x dst_id=0x%04x tlabel=%u tcode=%u src_id=0x%04x rcode=%u header=%s data=%s", "transaction=0x%llx card_index=%u generation=%u scode=%u status=%u timestamp=0x%04x dst_id=0x%04x tlabel=%u tcode=%u src_id=0x%04x rcode=%u header=%s data=%s",
__entry->transaction, __entry->transaction,
__entry->card_index,
__entry->generation, __entry->generation,
__entry->scode, __entry->scode,
__entry->status, __entry->status,
...@@ -155,16 +158,17 @@ DEFINE_EVENT(async_outbound_complete_template, async_request_outbound_complete, ...@@ -155,16 +158,17 @@ DEFINE_EVENT(async_outbound_complete_template, async_request_outbound_complete,
); );
DEFINE_EVENT(async_inbound_template, async_response_inbound, DEFINE_EVENT(async_inbound_template, async_response_inbound,
TP_PROTO(u64 transaction, unsigned int generation, unsigned int scode, unsigned int status, unsigned int timestamp, const u32 *header, const u32 *data, unsigned int data_count), TP_PROTO(u64 transaction, unsigned int card_index, unsigned int generation, unsigned int scode, unsigned int status, unsigned int timestamp, const u32 *header, const u32 *data, unsigned int data_count),
TP_ARGS(transaction, generation, scode, status, timestamp, header, data, data_count) TP_ARGS(transaction, card_index, generation, scode, status, timestamp, header, data, data_count)
); );
DEFINE_EVENT_PRINT(async_inbound_template, async_request_inbound, DEFINE_EVENT_PRINT(async_inbound_template, async_request_inbound,
TP_PROTO(u64 transaction, unsigned int generation, unsigned int scode, unsigned int status, unsigned int timestamp, const u32 *header, const u32 *data, unsigned int data_count), TP_PROTO(u64 transaction, unsigned int card_index, unsigned int generation, unsigned int scode, unsigned int status, unsigned int timestamp, const u32 *header, const u32 *data, unsigned int data_count),
TP_ARGS(transaction, generation, scode, status, timestamp, header, data, data_count), TP_ARGS(transaction, card_index, generation, scode, status, timestamp, header, data, data_count),
TP_printk( TP_printk(
"transaction=0x%llx generation=%u scode=%u status=%u timestamp=0x%04x dst_id=0x%04x tlabel=%u tcode=%u src_id=0x%04x offset=0x%012llx header=%s data=%s", "transaction=0x%llx card_index=%u generation=%u scode=%u status=%u timestamp=0x%04x dst_id=0x%04x tlabel=%u tcode=%u src_id=0x%04x offset=0x%012llx header=%s data=%s",
__entry->transaction, __entry->transaction,
__entry->card_index,
__entry->generation, __entry->generation,
__entry->scode, __entry->scode,
__entry->status, __entry->status,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment