]> www.infradead.org Git - linux.git/commitdiff
firewire: core: add tracepoints events for flushing completions of isochronous context
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Sun, 23 Jun 2024 22:08:56 +0000 (07:08 +0900)
committerTakashi Sakamoto <o-takashi@sakamocchi.jp>
Mon, 24 Jun 2024 22:31:38 +0000 (07:31 +0900)
It is helpful to trace the flushing completions of isochronous context when
the core function is requested them by both in-kernel unit drivers and
userspace applications.

This commit adds some tracepoints events for the aim.

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

index 5bad23fcce0cbb5ebcc424bd7728267afd9dd6ed..93ca0dec1805f01cc859673c544e84f7c07b7e20 100644 (file)
@@ -207,6 +207,10 @@ EXPORT_SYMBOL(fw_iso_context_queue_flush);
 
 int fw_iso_context_flush_completions(struct fw_iso_context *ctx)
 {
+       trace_isoc_outbound_flush_completions(ctx);
+       trace_isoc_inbound_single_flush_completions(ctx);
+       trace_isoc_inbound_multiple_flush_completions(ctx);
+
        return ctx->card->driver->flush_iso_completions(ctx);
 }
 EXPORT_SYMBOL(fw_iso_context_flush_completions);
index 1f6097a6366cf90392e5677dbe5459332b99a33c..f35d6e193bcb26f3e8d5c41fa5b46823e60096b8 100644 (file)
@@ -43,6 +43,8 @@
 #include "packet-header-definitions.h"
 #include "phy-packet-definitions.h"
 
+#include <trace/events/firewire.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)
index b404e6324671c7eaf934f30b7c0c3d1bf84663c4..ad1546120aa338c4194bd9e41298990c340e6b66 100644 (file)
@@ -706,6 +706,42 @@ DEFINE_EVENT_CONDITION(isoc_flush_template, isoc_inbound_multiple_flush,
        TP_CONDITION(ctx->type == FW_ISO_CONTEXT_RECEIVE_MULTICHANNEL)
 );
 
+DECLARE_EVENT_CLASS(isoc_flush_completions_template,
+       TP_PROTO(const struct fw_iso_context *ctx),
+       TP_ARGS(ctx),
+       TP_STRUCT__entry(
+               __field(u64, context)
+               __field(u8, card_index)
+       ),
+       TP_fast_assign(
+               __entry->context = (uintptr_t)ctx;
+               __entry->card_index = ctx->card->index;
+       ),
+       TP_printk(
+               "context=0x%llx card_index=%u",
+               __entry->context,
+               __entry->card_index
+       )
+);
+
+DEFINE_EVENT_CONDITION(isoc_flush_completions_template, isoc_outbound_flush_completions,
+       TP_PROTO(const struct fw_iso_context *ctx),
+       TP_ARGS(ctx),
+       TP_CONDITION(ctx->type == FW_ISO_CONTEXT_TRANSMIT)
+);
+
+DEFINE_EVENT_CONDITION(isoc_flush_completions_template, isoc_inbound_single_flush_completions,
+       TP_PROTO(const struct fw_iso_context *ctx),
+       TP_ARGS(ctx),
+       TP_CONDITION(ctx->type == FW_ISO_CONTEXT_RECEIVE)
+);
+
+DEFINE_EVENT_CONDITION(isoc_flush_completions_template, isoc_inbound_multiple_flush_completions,
+       TP_PROTO(const struct fw_iso_context *ctx),
+       TP_ARGS(ctx),
+       TP_CONDITION(ctx->type == FW_ISO_CONTEXT_RECEIVE_MULTICHANNEL)
+);
+
 #undef QUADLET_SIZE
 
 #endif // _FIREWIRE_TRACE_EVENT_H