summaryrefslogtreecommitdiff
path: root/include/trace
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2024-04-30 09:14:03 +0900
committerTakashi Sakamoto <o-takashi@sakamocchi.jp>2024-05-06 11:06:05 +0900
commit1a4c53cf355326a28daa6cbe00939cb4b8ac2659 (patch)
treee1fa2f1c24f5162c6fd80bde384fdbb3caf43a16 /include/trace
parent624a8535f7036d8c4de1481b72704daa7f7fd43e (diff)
firewire: core/cdev: add tracepoints events for asynchronous phy packet
In IEEE 1394 bus, the type of asynchronous packet without any offset to node address space is called as phy packet. The destination of packet is IEEE 1394 phy itself. This type of packet is used for several purposes, mainly for selfID at the state of bus reset, to force selection of root node, and to adjust gap count. This commit adds tracepoints events for the type of asynchronous outbound packet. Like asynchronous outbound transaction packets, a pair of events are added to trace initiation and completion of transmission. In the case that the phy packet is sent by kernel API, the match between the initiation and completion is not so easy, since the data of 'struct fw_packet' is allocated statically. In the case that it is sent by userspace applications via cdev, the match is easy, since the data is allocated per each. This example is for Remote Access Packet by lsfirewirephy command in linux-firewire-utils: async_phy_outbound_initiate: \ packet=0xffff89fb34e42e78 generation=1 first_quadlet=0x00148200 \ second_quadlet=0xffeb7dff async_phy_outbound_complete: \ packet=0xffff89fb34e42e78 generation=1 status=1 timestamp=0x0619 Link: https://lore.kernel.org/r/20240430001404.734657-2-o-takashi@sakamocchi.jp Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Diffstat (limited to 'include/trace')
-rw-r--r--include/trace/events/firewire.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/include/trace/events/firewire.h b/include/trace/events/firewire.h
index d4688e341837..3ade7d4b9268 100644
--- a/include/trace/events/firewire.h
+++ b/include/trace/events/firewire.h
@@ -206,6 +206,54 @@ DEFINE_EVENT(async_outbound_complete_template, async_response_outbound_complete,
#undef ASYNC_HEADER_GET_RCODE
#undef QUADLET_SIZE
+TRACE_EVENT(async_phy_outbound_initiate,
+ TP_PROTO(u64 packet, unsigned int generation, u32 first_quadlet, u32 second_quadlet),
+ TP_ARGS(packet, generation, first_quadlet, second_quadlet),
+ TP_STRUCT__entry(
+ __field(u64, packet)
+ __field(u8, generation)
+ __field(u32, first_quadlet)
+ __field(u32, second_quadlet)
+ ),
+ TP_fast_assign(
+ __entry->packet = packet;
+ __entry->generation = generation;
+ __entry->first_quadlet = first_quadlet;
+ __entry->second_quadlet = second_quadlet
+ ),
+ TP_printk(
+ "packet=0x%016llx generation=%u first_quadlet=0x%08x second_quadlet=0x%08x",
+ __entry->packet,
+ __entry->generation,
+ __entry->first_quadlet,
+ __entry->second_quadlet
+ )
+);
+
+TRACE_EVENT(async_phy_outbound_complete,
+ TP_PROTO(u64 packet, unsigned int generation, unsigned int status, unsigned int timestamp),
+ TP_ARGS(packet, generation, status, timestamp),
+ TP_STRUCT__entry(
+ __field(u64, packet)
+ __field(u8, generation)
+ __field(u8, status)
+ __field(u16, timestamp)
+ ),
+ TP_fast_assign(
+ __entry->packet = packet;
+ __entry->generation = generation;
+ __entry->status = status;
+ __entry->timestamp = timestamp;
+ ),
+ TP_printk(
+ "packet=0x%016llx generation=%u status=%u timestamp=0x%04x",
+ __entry->packet,
+ __entry->generation,
+ __entry->status,
+ __entry->timestamp
+ )
+);
+
#endif // _FIREWIRE_TRACE_EVENT_H
#include <trace/define_trace.h>