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 starting/stopping of isochronous context

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

+116
+8
drivers/firewire/core-iso.c
··· 171 171 int fw_iso_context_start(struct fw_iso_context *ctx, 172 172 int cycle, int sync, int tags) 173 173 { 174 + trace_isoc_outbound_start(ctx, cycle); 175 + trace_isoc_inbound_single_start(ctx, cycle, sync, tags); 176 + trace_isoc_inbound_multiple_start(ctx, cycle, sync, tags); 177 + 174 178 return ctx->card->driver->start_iso(ctx, cycle, sync, tags); 175 179 } 176 180 EXPORT_SYMBOL(fw_iso_context_start); ··· 209 205 210 206 int fw_iso_context_stop(struct fw_iso_context *ctx) 211 207 { 208 + trace_isoc_outbound_stop(ctx); 209 + trace_isoc_inbound_single_stop(ctx); 210 + trace_isoc_inbound_multiple_stop(ctx); 211 + 212 212 return ctx->card->driver->stop_iso(ctx); 213 213 } 214 214 EXPORT_SYMBOL(fw_iso_context_stop);
+108
include/trace/events/firewire.h
··· 562 562 ) 563 563 ); 564 564 565 + TRACE_EVENT_CONDITION(isoc_outbound_start, 566 + TP_PROTO(const struct fw_iso_context *ctx, int cycle_match), 567 + TP_ARGS(ctx, cycle_match), 568 + TP_CONDITION(ctx->type == FW_ISO_CONTEXT_TRANSMIT), 569 + TP_STRUCT__entry( 570 + __field(u64, context) 571 + __field(u8, card_index) 572 + __field(bool, cycle_match) 573 + __field(u16, cycle) 574 + ), 575 + TP_fast_assign( 576 + __entry->context = (uintptr_t)ctx; 577 + __entry->card_index = ctx->card->index; 578 + __entry->cycle_match = cycle_match < 0 ? false : true; 579 + __entry->cycle = __entry->cycle_match ? (u16)cycle_match : 0; 580 + ), 581 + TP_printk( 582 + "context=0x%llx card_index=%u cycle_match=%s cycle=0x%04x", 583 + __entry->context, 584 + __entry->card_index, 585 + __entry->cycle_match ? "true" : "false", 586 + __entry->cycle 587 + ) 588 + ); 589 + 590 + DECLARE_EVENT_CLASS(isoc_inbound_start_template, 591 + TP_PROTO(const struct fw_iso_context *ctx, int cycle_match, unsigned int sync, unsigned int tags), 592 + TP_ARGS(ctx, cycle_match, sync, tags), 593 + TP_STRUCT__entry( 594 + __field(u64, context) 595 + __field(u8, card_index) 596 + __field(bool, cycle_match) 597 + __field(u16, cycle) 598 + __field(u8, sync) 599 + __field(u8, tags) 600 + ), 601 + TP_fast_assign( 602 + __entry->context = (uintptr_t)ctx; 603 + __entry->card_index = ctx->card->index; 604 + __entry->cycle_match = cycle_match < 0 ? false : true; 605 + __entry->cycle = __entry->cycle_match ? (u16)cycle_match : 0; 606 + __entry->sync = sync; 607 + __entry->tags = tags; 608 + ), 609 + TP_printk( 610 + "context=0x%llx card_index=%u cycle_match=%s cycle=0x%04x sync=%u tags=%s", 611 + __entry->context, 612 + __entry->card_index, 613 + __entry->cycle_match ? "true" : "false", 614 + __entry->cycle, 615 + __entry->sync, 616 + __print_flags(__entry->tags, "|", 617 + { FW_ISO_CONTEXT_MATCH_TAG0, "0" }, 618 + { FW_ISO_CONTEXT_MATCH_TAG1, "1" }, 619 + { FW_ISO_CONTEXT_MATCH_TAG2, "2" }, 620 + { FW_ISO_CONTEXT_MATCH_TAG3, "3" } 621 + ) 622 + ) 623 + ); 624 + 625 + DEFINE_EVENT_CONDITION(isoc_inbound_start_template, isoc_inbound_single_start, 626 + TP_PROTO(const struct fw_iso_context *ctx, int cycle_match, unsigned int sync, unsigned int tags), 627 + TP_ARGS(ctx, cycle_match, sync, tags), 628 + TP_CONDITION(ctx->type == FW_ISO_CONTEXT_RECEIVE) 629 + ); 630 + 631 + DEFINE_EVENT_CONDITION(isoc_inbound_start_template, isoc_inbound_multiple_start, 632 + TP_PROTO(const struct fw_iso_context *ctx, int cycle_match, unsigned int sync, unsigned int tags), 633 + TP_ARGS(ctx, cycle_match, sync, tags), 634 + TP_CONDITION(ctx->type == FW_ISO_CONTEXT_RECEIVE_MULTICHANNEL) 635 + ); 636 + 637 + DECLARE_EVENT_CLASS(isoc_stop_template, 638 + TP_PROTO(const struct fw_iso_context *ctx), 639 + TP_ARGS(ctx), 640 + TP_STRUCT__entry( 641 + __field(u64, context) 642 + __field(u8, card_index) 643 + ), 644 + TP_fast_assign( 645 + __entry->context = (uintptr_t)ctx; 646 + __entry->card_index = ctx->card->index; 647 + ), 648 + TP_printk( 649 + "context=0x%llx card_index=%u", 650 + __entry->context, 651 + __entry->card_index 652 + ) 653 + ) 654 + 655 + DEFINE_EVENT_CONDITION(isoc_stop_template, isoc_outbound_stop, 656 + TP_PROTO(const struct fw_iso_context *ctx), 657 + TP_ARGS(ctx), 658 + TP_CONDITION(ctx->type == FW_ISO_CONTEXT_TRANSMIT) 659 + ); 660 + 661 + DEFINE_EVENT_CONDITION(isoc_stop_template, isoc_inbound_single_stop, 662 + TP_PROTO(const struct fw_iso_context *ctx), 663 + TP_ARGS(ctx), 664 + TP_CONDITION(ctx->type == FW_ISO_CONTEXT_RECEIVE) 665 + ); 666 + 667 + DEFINE_EVENT_CONDITION(isoc_stop_template, isoc_inbound_multiple_stop, 668 + TP_PROTO(const struct fw_iso_context *ctx), 669 + TP_ARGS(ctx), 670 + TP_CONDITION(ctx->type == FW_ISO_CONTEXT_RECEIVE_MULTICHANNEL) 671 + ); 672 + 565 673 #undef QUADLET_SIZE 566 674 567 675 #endif // _FIREWIRE_TRACE_EVENT_H