Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 65ec7eb

Browse files
committed
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.jp Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
1 parent 64e02b6 commit 65ec7eb

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

drivers/firewire/core-transaction.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,8 +1009,8 @@ void fw_core_handle_request(struct fw_card *card, struct fw_packet *p)
10091009
return;
10101010
}
10111011

1012-
trace_async_request_inbound((uintptr_t)request, p->generation, p->speed, p->ack,
1013-
p->timestamp, p->header, request->data,
1012+
trace_async_request_inbound((uintptr_t)request, card->index, p->generation, p->speed,
1013+
p->ack, p->timestamp, p->header, request->data,
10141014
tcode_is_read_request(tcode) ? 0 : request->length / 4);
10151015

10161016
offset = async_header_get_offset(p->header);
@@ -1080,8 +1080,8 @@ void fw_core_handle_response(struct fw_card *card, struct fw_packet *p)
10801080
}
10811081
spin_unlock_irqrestore(&card->lock, flags);
10821082

1083-
trace_async_response_inbound((uintptr_t)t, p->generation, p->speed, p->ack, p->timestamp,
1084-
p->header, data, data_length / 4);
1083+
trace_async_response_inbound((uintptr_t)t, card->index, p->generation, p->speed, p->ack,
1084+
p->timestamp, p->header, data, data_length / 4);
10851085

10861086
if (!t) {
10871087
timed_out:

include/trace/events/firewire.h

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,11 @@ DECLARE_EVENT_CLASS(async_outbound_complete_template,
105105

106106
// The value of status is one of ack codes and rcodes specific to Linux FireWire subsystem.
107107
DECLARE_EVENT_CLASS(async_inbound_template,
108-
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),
109-
TP_ARGS(transaction, generation, scode, status, timestamp, header, data, data_count),
108+
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),
109+
TP_ARGS(transaction, card_index, generation, scode, status, timestamp, header, data, data_count),
110110
TP_STRUCT__entry(
111111
__field(u64, transaction)
112+
__field(u8, card_index)
112113
__field(u8, generation)
113114
__field(u8, scode)
114115
__field(u8, status)
@@ -118,6 +119,7 @@ DECLARE_EVENT_CLASS(async_inbound_template,
118119
),
119120
TP_fast_assign(
120121
__entry->transaction = transaction;
122+
__entry->card_index = card_index;
121123
__entry->generation = generation;
122124
__entry->scode = scode;
123125
__entry->status = status;
@@ -127,8 +129,9 @@ DECLARE_EVENT_CLASS(async_inbound_template,
127129
),
128130
// This format is for the response subaction.
129131
TP_printk(
130-
"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",
132+
"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",
131133
__entry->transaction,
134+
__entry->card_index,
132135
__entry->generation,
133136
__entry->scode,
134137
__entry->status,
@@ -155,16 +158,17 @@ DEFINE_EVENT(async_outbound_complete_template, async_request_outbound_complete,
155158
);
156159

157160
DEFINE_EVENT(async_inbound_template, async_response_inbound,
158-
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),
159-
TP_ARGS(transaction, generation, scode, status, timestamp, header, data, data_count)
161+
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),
162+
TP_ARGS(transaction, card_index, generation, scode, status, timestamp, header, data, data_count)
160163
);
161164

162165
DEFINE_EVENT_PRINT(async_inbound_template, async_request_inbound,
163-
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),
164-
TP_ARGS(transaction, generation, scode, status, timestamp, header, data, data_count),
166+
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),
167+
TP_ARGS(transaction, card_index, generation, scode, status, timestamp, header, data, data_count),
165168
TP_printk(
166-
"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",
169+
"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",
167170
__entry->transaction,
171+
__entry->card_index,
168172
__entry->generation,
169173
__entry->scode,
170174
__entry->status,

0 commit comments

Comments
 (0)