Commit 893098b2 authored by Takashi Sakamoto's avatar Takashi Sakamoto

firewire: core: record card index in bus_reset_handle tracepoints event

The bus reset event occurs in the bus managed by one of 1394 OHCI
controller in Linux system, however 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/20240613131440.431766-9-o-takashi@sakamocchi.jpSigned-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
parent 7507dbc4
...@@ -508,7 +508,7 @@ void fw_core_handle_bus_reset(struct fw_card *card, int node_id, int generation, ...@@ -508,7 +508,7 @@ void fw_core_handle_bus_reset(struct fw_card *card, int node_id, int generation,
struct fw_node *local_node; struct fw_node *local_node;
unsigned long flags; unsigned long flags;
trace_bus_reset_handle(generation, node_id, bm_abdicate, self_ids, self_id_count); trace_bus_reset_handle(card->index, generation, node_id, bm_abdicate, self_ids, self_id_count);
spin_lock_irqsave(&card->lock, flags); spin_lock_irqsave(&card->lock, flags);
......
...@@ -339,22 +339,25 @@ DEFINE_EVENT(bus_reset_arrange_template, bus_reset_postpone, ...@@ -339,22 +339,25 @@ DEFINE_EVENT(bus_reset_arrange_template, bus_reset_postpone,
); );
TRACE_EVENT(bus_reset_handle, TRACE_EVENT(bus_reset_handle,
TP_PROTO(unsigned int generation, unsigned int node_id, bool bm_abdicate, u32 *self_ids, unsigned int self_id_count), TP_PROTO(unsigned int card_index, unsigned int generation, unsigned int node_id, bool bm_abdicate, u32 *self_ids, unsigned int self_id_count),
TP_ARGS(generation, node_id, bm_abdicate, self_ids, self_id_count), TP_ARGS(card_index, generation, node_id, bm_abdicate, self_ids, self_id_count),
TP_STRUCT__entry( TP_STRUCT__entry(
__field(u8, card_index)
__field(u8, generation) __field(u8, generation)
__field(u8, node_id) __field(u8, node_id)
__field(bool, bm_abdicate) __field(bool, bm_abdicate)
__dynamic_array(u32, self_ids, self_id_count) __dynamic_array(u32, self_ids, self_id_count)
), ),
TP_fast_assign( TP_fast_assign(
__entry->card_index = card_index;
__entry->generation = generation; __entry->generation = generation;
__entry->node_id = node_id; __entry->node_id = node_id;
__entry->bm_abdicate = bm_abdicate; __entry->bm_abdicate = bm_abdicate;
memcpy(__get_dynamic_array(self_ids), self_ids, __get_dynamic_array_len(self_ids)); memcpy(__get_dynamic_array(self_ids), self_ids, __get_dynamic_array_len(self_ids));
), ),
TP_printk( TP_printk(
"generation=%u node_id=0x%04x bm_abdicate=%s self_ids=%s", "card_index=%u generation=%u node_id=0x%04x bm_abdicate=%s self_ids=%s",
__entry->card_index,
__entry->generation, __entry->generation,
__entry->node_id, __entry->node_id,
__entry->bm_abdicate ? "true" : "false", __entry->bm_abdicate ? "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