Commit eec045c5 authored by Takashi Sakamoto's avatar Takashi Sakamoto

firewire: core: add tracepoints event for asynchronous inbound phy packet

At the former commit, a pair of tracepoints events is added to trace
asynchronous outbound phy packet. This commit adds a tracepoints event
to trace inbound phy packet. It includes transaction status as well as
the content of phy packet.

This is an example for Remote Reply Packet as a response to Remote Access
Packet sent by lsfirewirephy command in linux-firewire-utils:

async_phy_inbound: \
  packet=0xffff955fc02b4e10 generation=1 status=1 timestamp=0x0619 \
  first_quadlet=0x001c8208 second_quadlet=0xffe37df7

Link: https://lore.kernel.org/r/20240430001404.734657-3-o-takashi@sakamocchi.jpSigned-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
parent 1a4c53cf
......@@ -995,6 +995,8 @@ void fw_core_handle_request(struct fw_card *card, struct fw_packet *p)
tcode = async_header_get_tcode(p->header);
if (tcode_is_link_internal(tcode)) {
trace_async_phy_inbound((uintptr_t)p, p->generation, p->ack, p->timestamp,
p->header[1], p->header[2]);
fw_cdev_handle_phy_packet(card, p);
return;
}
......
......@@ -254,6 +254,36 @@ TRACE_EVENT(async_phy_outbound_complete,
)
);
TRACE_EVENT(async_phy_inbound,
TP_PROTO(u64 packet, unsigned int generation, unsigned int status, unsigned int timestamp, u32 first_quadlet, u32 second_quadlet),
TP_ARGS(packet, generation, status, timestamp, first_quadlet, second_quadlet),
TP_STRUCT__entry(
__field(u64, packet)
__field(u8, generation)
__field(u8, status)
__field(u16, timestamp)
__field(u32, first_quadlet)
__field(u32, second_quadlet)
),
TP_fast_assign(
__entry->packet = packet;
__entry->generation = generation;
__entry->status = status;
__entry->timestamp = timestamp;
__entry->first_quadlet = first_quadlet;
__entry->second_quadlet = second_quadlet
),
TP_printk(
"packet=0x%016llx generation=%u status=%u timestamp=0x%04x first_quadlet=0x%08x second_quadlet=0x%08x",
__entry->packet,
__entry->generation,
__entry->status,
__entry->timestamp,
__entry->first_quadlet,
__entry->second_quadlet
)
);
#endif // _FIREWIRE_TRACE_EVENT_H
#include <trace/define_trace.h>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment