Commit 7507dbc4 authored by Takashi Sakamoto's avatar Takashi Sakamoto
Browse files

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

The asynchronous transmission of phy packet 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-8-o-takashi@sakamocchi.jp


Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
parent abbb4bd9
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -222,14 +222,14 @@ static int reset_bus(struct fw_card *card, bool short_reset)
	int reg = short_reset ? 5 : 1;
	int bit = short_reset ? PHY_BUS_SHORT_RESET : PHY_BUS_RESET;

	trace_bus_reset_initiate(card->generation, short_reset);
	trace_bus_reset_initiate(card->index, card->generation, short_reset);

	return card->driver->update_phy_reg(card, reg, 0, bit);
}

void fw_schedule_bus_reset(struct fw_card *card, bool delayed, bool short_reset)
{
	trace_bus_reset_schedule(card->generation, short_reset);
	trace_bus_reset_schedule(card->index, card->generation, short_reset);

	/* We don't try hard to sort out requests of long vs. short resets. */
	card->br_short = short_reset;
@@ -249,7 +249,7 @@ static void br_work(struct work_struct *work)
	/* Delay for 2s after last reset per IEEE 1394 clause 8.2.1. */
	if (card->reset_jiffies != 0 &&
	    time_before64(get_jiffies_64(), card->reset_jiffies + 2 * HZ)) {
		trace_bus_reset_postpone(card->generation, card->br_short);
		trace_bus_reset_postpone(card->index, card->generation, card->br_short);

		if (!queue_delayed_work(fw_workqueue, &card->br_work, 2 * HZ))
			fw_card_put(card);
+12 −9
Original line number Diff line number Diff line
@@ -303,36 +303,39 @@ TRACE_EVENT(async_phy_inbound,
);

DECLARE_EVENT_CLASS(bus_reset_arrange_template,
	TP_PROTO(unsigned int generation, bool short_reset),
	TP_ARGS(generation, short_reset),
	TP_PROTO(unsigned int card_index, unsigned int generation, bool short_reset),
	TP_ARGS(card_index, generation, short_reset),
	TP_STRUCT__entry(
		__field(u8, card_index)
		__field(u8, generation)
		__field(bool, short_reset)
	),
	TP_fast_assign(
		__entry->card_index = card_index;
		__entry->generation = generation;
		__entry->short_reset = short_reset;
	),
	TP_printk(
		"generation=%u short_reset=%s",
		"card_index=%u generation=%u short_reset=%s",
		__entry->card_index,
		__entry->generation,
		__entry->short_reset ? "true" : "false"
	)
);

DEFINE_EVENT(bus_reset_arrange_template, bus_reset_initiate,
	TP_PROTO(unsigned int generation, bool short_reset),
	TP_ARGS(generation, short_reset)
	TP_PROTO(unsigned int card_index, unsigned int generation, bool short_reset),
	TP_ARGS(card_index, generation, short_reset)
);

DEFINE_EVENT(bus_reset_arrange_template, bus_reset_schedule,
	TP_PROTO(unsigned int generation, bool short_reset),
	TP_ARGS(generation, short_reset)
	TP_PROTO(unsigned int card_index, unsigned int generation, bool short_reset),
	TP_ARGS(card_index, generation, short_reset)
);

DEFINE_EVENT(bus_reset_arrange_template, bus_reset_postpone,
	TP_PROTO(unsigned int generation, bool short_reset),
	TP_ARGS(generation, short_reset)
	TP_PROTO(unsigned int card_index, unsigned int generation, bool short_reset),
	TP_ARGS(card_index, generation, short_reset)
);

TRACE_EVENT(bus_reset_handle,