]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
firewire: core: record card index in tracepoinrts events derived from bus_reset_arran...
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Thu, 13 Jun 2024 13:14:39 +0000 (22:14 +0900)
committerTakashi Sakamoto <o-takashi@sakamocchi.jp>
Sat, 15 Jun 2024 05:59:17 +0000 (14:59 +0900)
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>
drivers/firewire/core-card.c
include/trace/events/firewire.h

index 127d87e3a1530f44b7108e6e403180fce56fedbf..f8b99dd6cd827d67e060efc65ff603cb6ceb2860 100644 (file)
@@ -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);
index e5524fc71880167773e5d8d9995641b94ae19d58..e6485051f546dff075ff0c5e9fe527a829eb759f 100644 (file)
@@ -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,