]> www.infradead.org Git - linux.git/commitdiff
firewire: core: add tracepoints events for setting channels of multichannel context
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Sun, 23 Jun 2024 22:08:53 +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 channel setting for the multichannel isochronous
context when the core function is requested it 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-3-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
drivers/firewire/core-iso.c
include/trace/events/firewire.h

index ddb999297c72c4368703043d4990e5c1751713b8..7ec84de846e608229be33307eadc75c6e7ad2c5e 100644 (file)
@@ -177,6 +177,8 @@ EXPORT_SYMBOL(fw_iso_context_start);
 
 int fw_iso_context_set_channels(struct fw_iso_context *ctx, u64 *channels)
 {
+       trace_isoc_inbound_multiple_channels(ctx, *channels);
+
        return ctx->card->driver->set_iso_channels(ctx, channels);
 }
 
index 0cca1ef841f3568eafad33be636665cbd008462f..0334e02f9d9424f330c0720a74c6c598d6eac75e 100644 (file)
@@ -541,6 +541,27 @@ DEFINE_EVENT_CONDITION(isoc_destroy_template, isoc_inbound_multiple_destroy,
        TP_CONDITION(ctx->type == FW_ISO_CONTEXT_RECEIVE_MULTICHANNEL)
 );
 
+TRACE_EVENT(isoc_inbound_multiple_channels,
+       TP_PROTO(const struct fw_iso_context *ctx, u64 channels),
+       TP_ARGS(ctx, channels),
+       TP_STRUCT__entry(
+               __field(u64, context)
+               __field(u8, card_index)
+               __field(u64, channels)
+       ),
+       TP_fast_assign(
+               __entry->context = (uintptr_t)ctx;
+               __entry->card_index = ctx->card->index;
+               __entry->channels = channels;
+       ),
+       TP_printk(
+               "context=0x%llx card_index=%u channels=0x%016llx",
+               __entry->context,
+               __entry->card_index,
+               __entry->channels
+       )
+);
+
 #undef QUADLET_SIZE
 
 #endif // _FIREWIRE_TRACE_EVENT_H