Commit 2fd22faf authored by Takashi Sakamoto's avatar Takashi Sakamoto

firewire: core: record card index in tracepoints event for self ID sequence

This patch is for for-next branch.

The selfIDComplete event occurs in the bus managed by one of 1394 OHCI
controller in Linux system, while the existing tracepoints events has
the lack of data about it to distinguish the issued hardware from the
others.

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/20240614004251.460649-1-o-takashi@sakamocchi.jpSigned-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
parent 67e51784
...@@ -140,7 +140,7 @@ static struct fw_node *build_tree(struct fw_card *card, const u32 *sid, int self ...@@ -140,7 +140,7 @@ static struct fw_node *build_tree(struct fw_card *card, const u32 *sid, int self
} }
port_capacity = self_id_sequence_get_port_capacity(quadlet_count); port_capacity = self_id_sequence_get_port_capacity(quadlet_count);
trace_self_id_sequence(self_id_sequence, quadlet_count, generation); trace_self_id_sequence(card->index, self_id_sequence, quadlet_count, generation);
for (port_index = 0; port_index < port_capacity; ++port_index) { for (port_index = 0; port_index < port_capacity; ++port_index) {
port_status = self_id_sequence_get_port_status(self_id_sequence, quadlet_count, port_status = self_id_sequence_get_port_status(self_id_sequence, quadlet_count,
......
...@@ -395,14 +395,16 @@ void copy_port_status(u8 *port_status, unsigned int port_capacity, const u32 *se ...@@ -395,14 +395,16 @@ void copy_port_status(u8 *port_status, unsigned int port_capacity, const u32 *se
unsigned int quadlet_count); unsigned int quadlet_count);
TRACE_EVENT(self_id_sequence, TRACE_EVENT(self_id_sequence,
TP_PROTO(const u32 *self_id_sequence, unsigned int quadlet_count, unsigned int generation), TP_PROTO(unsigned int card_index, const u32 *self_id_sequence, unsigned int quadlet_count, unsigned int generation),
TP_ARGS(self_id_sequence, quadlet_count, generation), TP_ARGS(card_index, self_id_sequence, quadlet_count, generation),
TP_STRUCT__entry( TP_STRUCT__entry(
__field(u8, card_index)
__field(u8, generation) __field(u8, generation)
__dynamic_array(u8, port_status, self_id_sequence_get_port_capacity(quadlet_count)) __dynamic_array(u8, port_status, self_id_sequence_get_port_capacity(quadlet_count))
__dynamic_array(u32, self_id_sequence, quadlet_count) __dynamic_array(u32, self_id_sequence, quadlet_count)
), ),
TP_fast_assign( TP_fast_assign(
__entry->card_index = card_index;
__entry->generation = generation; __entry->generation = generation;
copy_port_status(__get_dynamic_array(port_status), __get_dynamic_array_len(port_status), copy_port_status(__get_dynamic_array(port_status), __get_dynamic_array_len(port_status),
self_id_sequence, quadlet_count); self_id_sequence, quadlet_count);
...@@ -410,7 +412,8 @@ TRACE_EVENT(self_id_sequence, ...@@ -410,7 +412,8 @@ TRACE_EVENT(self_id_sequence,
__get_dynamic_array_len(self_id_sequence)); __get_dynamic_array_len(self_id_sequence));
), ),
TP_printk( TP_printk(
"generation=%u phy_id=0x%02x link_active=%s gap_count=%u scode=%u contender=%s power_class=%u initiated_reset=%s port_status=%s self_id_sequence=%s", "card_index=%u generation=%u phy_id=0x%02x link_active=%s gap_count=%u scode=%u contender=%s power_class=%u initiated_reset=%s port_status=%s self_id_sequence=%s",
__entry->card_index,
__entry->generation, __entry->generation,
PHY_PACKET_SELF_ID_GET_PHY_ID(__get_dynamic_array(self_id_sequence)), PHY_PACKET_SELF_ID_GET_PHY_ID(__get_dynamic_array(self_id_sequence)),
PHY_PACKET_SELF_ID_GET_LINK_ACTIVE(__get_dynamic_array(self_id_sequence)) ? "true" : "false", PHY_PACKET_SELF_ID_GET_LINK_ACTIVE(__get_dynamic_array(self_id_sequence)) ? "true" : "false",
......
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