]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
firewire: ohci: add tracepoints event for hardIRQ event
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Tue, 25 Jun 2024 03:18:06 +0000 (12:18 +0900)
committerTakashi Sakamoto <o-takashi@sakamocchi.jp>
Tue, 25 Jun 2024 12:49:43 +0000 (21:49 +0900)
1394 OHCI hardware triggers PCI interrupts to notify any events to
software. Current driver for the hardware is programmed by the typical
way to utilize top- and bottom- halves, thus it has a timing gap to handle
the notification in softIRQ (tasklet).

This commit adds a tracepoint event for the hardIRQ event. The comparison
of the tracepoint event to tracepoints events in firewire subsystem is
helpful to diagnose the timing gap.

Link: https://lore.kernel.org/r/20240625031806.956650-3-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
drivers/firewire/ohci.c
include/trace/events/firewire_ohci.h

index 07adb4ddd4448774c02986d86c5748f1addbea34..df16a8f4ee7f80b75f1df7e5cdf0f40561350662 100644 (file)
@@ -2185,6 +2185,7 @@ static irqreturn_t irq_handler(int irq, void *data)
         */
        reg_write(ohci, OHCI1394_IntEventClear,
                  event & ~(OHCI1394_busReset | OHCI1394_postedWriteErr));
+       trace_irqs(ohci->card.index, event);
        log_irqs(ohci, event);
        // The flag is masked again at bus_reset_work() scheduled by selfID event.
        if (event & OHCI1394_busReset)
index 67fa3c1c8f6d98ba48f5265e9aba9b8794feabf6..483aeeb033afd8a39f3f93ee19652c378c77a15f 100644 (file)
@@ -9,7 +9,38 @@
 
 #include <linux/tracepoint.h>
 
-// Placeholder for future use.
+TRACE_EVENT(irqs,
+       TP_PROTO(unsigned int card_index, u32 events),
+       TP_ARGS(card_index, events),
+       TP_STRUCT__entry(
+               __field(u8, card_index)
+               __field(u32, events)
+       ),
+       TP_fast_assign(
+               __entry->card_index = card_index;
+               __entry->events = events;
+       ),
+       TP_printk(
+               "card_index=%u events=%s",
+               __entry->card_index,
+               __print_flags(__entry->events, "|",
+                       { OHCI1394_selfIDComplete,      "selfIDComplete" },
+                       { OHCI1394_RQPkt,               "RQPkt" },
+                       { OHCI1394_RSPkt,               "RSPkt" },
+                       { OHCI1394_reqTxComplete,       "reqTxComplete" },
+                       { OHCI1394_respTxComplete,      "respTxComplete" },
+                       { OHCI1394_isochRx,             "isochRx" },
+                       { OHCI1394_isochTx,             "isochTx" },
+                       { OHCI1394_postedWriteErr,      "postedWriteErr" },
+                       { OHCI1394_cycleTooLong,        "cycleTooLong" },
+                       { OHCI1394_cycle64Seconds,      "cycle64Seconds" },
+                       { OHCI1394_cycleInconsistent,   "cycleInconsistent" },
+                       { OHCI1394_regAccessFail,       "regAccessFail" },
+                       { OHCI1394_unrecoverableError,  "unrecoverableError" },
+                       { OHCI1394_busReset,            "busReset" }
+               )
+       )
+);
 
 #endif // _FIREWIRE_OHCI_TRACE_EVENT_H