Thread: [PATCH 0/2] firewire: ohci: add support for tracepoints events
Brought to you by:
aeb,
bencollins
From: Takashi S. <o-t...@sa...> - 2024-06-25 03:18:19
|
Hi, 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). The Linux Kernel Tracepoints framework is enough useful to trace the interaction between 1394 OHCI hardware and its driver. This series of changes adds support for tracepoints events to the driver, and adds an event, 'irqs', so that comparison of the event and any event in firewire subsystem is helpful to diagnose the timing gap. Takashi Sakamoto (2): firewire: ohci: add support for Linux kernel tracepoints firewire: ohci: add tracepoints event for hardIRQ event drivers/firewire/ohci.c | 4 +++ include/trace/events/firewire.h | 1 + include/trace/events/firewire_ohci.h | 47 ++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 include/trace/events/firewire_ohci.h -- 2.43.0 |
From: Takashi S. <o-t...@sa...> - 2024-06-25 03:18:19
|
The Linux Kernel Tracepoints framework is enough useful to trace the interaction between 1394 OHCI hardware and its driver. This commit adds firewire_ohci subsystem to use the framework. It is defined as the different subsystem from the existing firewire subsystem. The definition file for the existing subsystem is slightly changed so that both subsystems are available in 1394 OHCI driver. Signed-off-by: Takashi Sakamoto <o-t...@sa...> --- drivers/firewire/ohci.c | 3 +++ include/trace/events/firewire.h | 1 + include/trace/events/firewire_ohci.h | 16 ++++++++++++++++ 3 files changed, 20 insertions(+) create mode 100644 include/trace/events/firewire_ohci.h diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c index bdb206157118..07adb4ddd444 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c @@ -45,6 +45,9 @@ #include <trace/events/firewire.h> +#define CREATE_TRACE_POINTS +#include <trace/events/firewire_ohci.h> + #define ohci_info(ohci, f, args...) dev_info(ohci->card.device, f, ##args) #define ohci_notice(ohci, f, args...) dev_notice(ohci->card.device, f, ##args) #define ohci_err(ohci, f, args...) dev_err(ohci->card.device, f, ##args) diff --git a/include/trace/events/firewire.h b/include/trace/events/firewire.h index d9158a134beb..aa00c9f33551 100644 --- a/include/trace/events/firewire.h +++ b/include/trace/events/firewire.h @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later // Copyright (c) 2024 Takashi Sakamoto +#undef TRACE_SYSTEM #define TRACE_SYSTEM firewire #if !defined(_FIREWIRE_TRACE_EVENT_H) || defined(TRACE_HEADER_MULTI_READ) diff --git a/include/trace/events/firewire_ohci.h b/include/trace/events/firewire_ohci.h new file mode 100644 index 000000000000..67fa3c1c8f6d --- /dev/null +++ b/include/trace/events/firewire_ohci.h @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +// Copyright (c) 2024 Takashi Sakamoto + +#undef TRACE_SYSTEM +#define TRACE_SYSTEM firewire_ohci + +#if !defined(_FIREWIRE_OHCI_TRACE_EVENT_H) || defined(TRACE_HEADER_MULTI_READ) +#define _FIREWIRE_OHCI_TRACE_EVENT_H + +#include <linux/tracepoint.h> + +// Placeholder for future use. + +#endif // _FIREWIRE_OHCI_TRACE_EVENT_H + +#include <trace/define_trace.h> -- 2.43.0 |
From: Takashi S. <o-t...@sa...> - 2024-06-25 03:18:25
|
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. Signed-off-by: Takashi Sakamoto <o-t...@sa...> --- drivers/firewire/ohci.c | 1 + include/trace/events/firewire_ohci.h | 33 +++++++++++++++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c index 07adb4ddd444..df16a8f4ee7f 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c @@ -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) diff --git a/include/trace/events/firewire_ohci.h b/include/trace/events/firewire_ohci.h index 67fa3c1c8f6d..483aeeb033af 100644 --- a/include/trace/events/firewire_ohci.h +++ b/include/trace/events/firewire_ohci.h @@ -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 -- 2.43.0 |
From: Takashi S. <o-t...@sa...> - 2024-06-27 13:21:44
|
On Tue, Jun 25, 2024 at 12:18:04PM +0900, Takashi Sakamoto wrote: > Hi, > > 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). The Linux Kernel Tracepoints > framework is enough useful to trace the interaction between 1394 OHCI > hardware and its driver. > > This series of changes adds support for tracepoints events to the > driver, and adds an event, 'irqs', so that comparison of the event and > any event in firewire subsystem is helpful to diagnose the timing gap. > > Takashi Sakamoto (2): > firewire: ohci: add support for Linux kernel tracepoints > firewire: ohci: add tracepoints event for hardIRQ event > > drivers/firewire/ohci.c | 4 +++ > include/trace/events/firewire.h | 1 + > include/trace/events/firewire_ohci.h | 47 ++++++++++++++++++++++++++++ > 3 files changed, 52 insertions(+) > create mode 100644 include/trace/events/firewire_ohci.h Applied to for-next branch. Regards Takashi Sakamoto |