Skip to content

Commit

Permalink
firewire: core: record card index in tracepoinrts events derived from…
Browse files Browse the repository at this point in the history
… 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: Takashi Sakamoto <o-takashi@sakamocchi.jp>
  • Loading branch information
Takashi Sakamoto committed Jun 15, 2024
1 parent abbb4bd commit 7507dbc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
6 changes: 3 additions & 3 deletions drivers/firewire/core-card.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down
21 changes: 12 additions & 9 deletions include/trace/events/firewire.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 7507dbc

Please sign in to comment.