Skip to content

Commit 8320b63

Browse files
committed
firewire: core: add tracepoints events for flushing completions of isochronous context
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/[email protected] Signed-off-by: Takashi Sakamoto <[email protected]>
1 parent c0b0ce6 commit 8320b63

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed

drivers/firewire/core-iso.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,10 @@ EXPORT_SYMBOL(fw_iso_context_queue_flush);
207207

208208
int fw_iso_context_flush_completions(struct fw_iso_context *ctx)
209209
{
210+
trace_isoc_outbound_flush_completions(ctx);
211+
trace_isoc_inbound_single_flush_completions(ctx);
212+
trace_isoc_inbound_multiple_flush_completions(ctx);
213+
210214
return ctx->card->driver->flush_iso_completions(ctx);
211215
}
212216
EXPORT_SYMBOL(fw_iso_context_flush_completions);

drivers/firewire/ohci.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343
#include "packet-header-definitions.h"
4444
#include "phy-packet-definitions.h"
4545

46+
#include <trace/events/firewire.h>
47+
4648
#define ohci_info(ohci, f, args...) dev_info(ohci->card.device, f, ##args)
4749
#define ohci_notice(ohci, f, args...) dev_notice(ohci->card.device, f, ##args)
4850
#define ohci_err(ohci, f, args...) dev_err(ohci->card.device, f, ##args)

include/trace/events/firewire.h

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -706,6 +706,42 @@ DEFINE_EVENT_CONDITION(isoc_flush_template, isoc_inbound_multiple_flush,
706706
TP_CONDITION(ctx->type == FW_ISO_CONTEXT_RECEIVE_MULTICHANNEL)
707707
);
708708

709+
DECLARE_EVENT_CLASS(isoc_flush_completions_template,
710+
TP_PROTO(const struct fw_iso_context *ctx),
711+
TP_ARGS(ctx),
712+
TP_STRUCT__entry(
713+
__field(u64, context)
714+
__field(u8, card_index)
715+
),
716+
TP_fast_assign(
717+
__entry->context = (uintptr_t)ctx;
718+
__entry->card_index = ctx->card->index;
719+
),
720+
TP_printk(
721+
"context=0x%llx card_index=%u",
722+
__entry->context,
723+
__entry->card_index
724+
)
725+
);
726+
727+
DEFINE_EVENT_CONDITION(isoc_flush_completions_template, isoc_outbound_flush_completions,
728+
TP_PROTO(const struct fw_iso_context *ctx),
729+
TP_ARGS(ctx),
730+
TP_CONDITION(ctx->type == FW_ISO_CONTEXT_TRANSMIT)
731+
);
732+
733+
DEFINE_EVENT_CONDITION(isoc_flush_completions_template, isoc_inbound_single_flush_completions,
734+
TP_PROTO(const struct fw_iso_context *ctx),
735+
TP_ARGS(ctx),
736+
TP_CONDITION(ctx->type == FW_ISO_CONTEXT_RECEIVE)
737+
);
738+
739+
DEFINE_EVENT_CONDITION(isoc_flush_completions_template, isoc_inbound_multiple_flush_completions,
740+
TP_PROTO(const struct fw_iso_context *ctx),
741+
TP_ARGS(ctx),
742+
TP_CONDITION(ctx->type == FW_ISO_CONTEXT_RECEIVE_MULTICHANNEL)
743+
);
744+
709745
#undef QUADLET_SIZE
710746

711747
#endif // _FIREWIRE_TRACE_EVENT_H

0 commit comments

Comments
 (0)