Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

firewire: core: add tracepoints events for queueing packets of isochronous context

It is helpful to trace the queueing packets 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-7-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>

+83
+4
drivers/firewire/core-iso.c
··· 191 191 struct fw_iso_buffer *buffer, 192 192 unsigned long payload) 193 193 { 194 + trace_isoc_outbound_queue(ctx, payload, packet); 195 + trace_isoc_inbound_single_queue(ctx, payload, packet); 196 + trace_isoc_inbound_multiple_queue(ctx, payload, packet); 197 + 194 198 return ctx->card->driver->queue_iso(ctx, packet, buffer, payload); 195 199 } 196 200 EXPORT_SYMBOL(fw_iso_context_queue);
+79
include/trace/events/firewire.h
··· 742 742 TP_CONDITION(ctx->type == FW_ISO_CONTEXT_RECEIVE_MULTICHANNEL) 743 743 ); 744 744 745 + #define TP_STRUCT__entry_iso_packet(ctx, buffer_offset, packet) \ 746 + TP_STRUCT__entry( \ 747 + __field(u64, context) \ 748 + __field(u8, card_index) \ 749 + __field(u32, buffer_offset) \ 750 + __field(bool, interrupt) \ 751 + __field(bool, skip) \ 752 + __field(u8, sy) \ 753 + __field(u8, tag) \ 754 + __dynamic_array(u32, header, packet->header_length / QUADLET_SIZE) \ 755 + ) 756 + 757 + #define TP_fast_assign_iso_packet(ctx, buffer_offset, packet) \ 758 + TP_fast_assign( \ 759 + __entry->context = (uintptr_t)ctx; \ 760 + __entry->card_index = ctx->card->index; \ 761 + __entry->buffer_offset = buffer_offset; \ 762 + __entry->interrupt = packet->interrupt; \ 763 + __entry->skip = packet->skip; \ 764 + __entry->sy = packet->sy; \ 765 + __entry->tag = packet->tag; \ 766 + memcpy(__get_dynamic_array(header), packet->header, \ 767 + __get_dynamic_array_len(header)); \ 768 + ) 769 + 770 + TRACE_EVENT_CONDITION(isoc_outbound_queue, 771 + TP_PROTO(const struct fw_iso_context *ctx, unsigned long buffer_offset, const struct fw_iso_packet *packet), 772 + TP_ARGS(ctx, buffer_offset, packet), 773 + TP_CONDITION(ctx->type == FW_ISO_CONTEXT_TRANSMIT), 774 + TP_STRUCT__entry_iso_packet(ctx, buffer_offset, packet), 775 + TP_fast_assign_iso_packet(ctx, buffer_offset, packet), 776 + TP_printk( 777 + "context=0x%llx card_index=%u buffer_offset=0x%x interrupt=%s skip=%s sy=%d tag=%u header=%s", 778 + __entry->context, 779 + __entry->card_index, 780 + __entry->buffer_offset, 781 + __entry->interrupt ? "true" : "false", 782 + __entry->skip ? "true" : "false", 783 + __entry->sy, 784 + __entry->tag, 785 + __print_array(__get_dynamic_array(header), 786 + __get_dynamic_array_len(header) / QUADLET_SIZE, QUADLET_SIZE) 787 + ) 788 + ); 789 + 790 + TRACE_EVENT_CONDITION(isoc_inbound_single_queue, 791 + TP_PROTO(const struct fw_iso_context *ctx, unsigned long buffer_offset, const struct fw_iso_packet *packet), 792 + TP_ARGS(ctx, buffer_offset, packet), 793 + TP_CONDITION(ctx->type == FW_ISO_CONTEXT_RECEIVE), 794 + TP_STRUCT__entry_iso_packet(ctx, buffer_offset, packet), 795 + TP_fast_assign_iso_packet(ctx, buffer_offset, packet), 796 + TP_printk( 797 + "context=0x%llx card_index=%u buffer_offset=0x%x interrupt=%s skip=%s", 798 + __entry->context, 799 + __entry->card_index, 800 + __entry->buffer_offset, 801 + __entry->interrupt ? "true" : "false", 802 + __entry->skip ? "true" : "false" 803 + ) 804 + ); 805 + 806 + TRACE_EVENT_CONDITION(isoc_inbound_multiple_queue, 807 + TP_PROTO(const struct fw_iso_context *ctx, unsigned long buffer_offset, const struct fw_iso_packet *packet), 808 + TP_ARGS(ctx, buffer_offset, packet), 809 + TP_CONDITION(ctx->type == FW_ISO_CONTEXT_RECEIVE_MULTICHANNEL), 810 + TP_STRUCT__entry_iso_packet(ctx, buffer_offset, packet), 811 + TP_fast_assign_iso_packet(ctx, buffer_offset, packet), 812 + TP_printk( 813 + "context=0x%llx card_index=%u buffer_offset=0x%x interrupt=%s", 814 + __entry->context, 815 + __entry->card_index, 816 + __entry->buffer_offset, 817 + __entry->interrupt ? "true" : "false" 818 + ) 819 + ); 820 + 821 + #undef TP_STRUCT__entry_iso_packet 822 + #undef TP_fast_assign_iso_packet 823 + 745 824 #undef QUADLET_SIZE 746 825 747 826 #endif // _FIREWIRE_TRACE_EVENT_H