Skip to content

Commit eec045c

Browse files
committed
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/[email protected] Signed-off-by: Takashi Sakamoto <[email protected]>
1 parent 1a4c53c commit eec045c

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

drivers/firewire/core-transaction.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -995,6 +995,8 @@ void fw_core_handle_request(struct fw_card *card, struct fw_packet *p)
995995

996996
tcode = async_header_get_tcode(p->header);
997997
if (tcode_is_link_internal(tcode)) {
998+
trace_async_phy_inbound((uintptr_t)p, p->generation, p->ack, p->timestamp,
999+
p->header[1], p->header[2]);
9981000
fw_cdev_handle_phy_packet(card, p);
9991001
return;
10001002
}

include/trace/events/firewire.h

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,36 @@ TRACE_EVENT(async_phy_outbound_complete,
254254
)
255255
);
256256

257+
TRACE_EVENT(async_phy_inbound,
258+
TP_PROTO(u64 packet, unsigned int generation, unsigned int status, unsigned int timestamp, u32 first_quadlet, u32 second_quadlet),
259+
TP_ARGS(packet, generation, status, timestamp, first_quadlet, second_quadlet),
260+
TP_STRUCT__entry(
261+
__field(u64, packet)
262+
__field(u8, generation)
263+
__field(u8, status)
264+
__field(u16, timestamp)
265+
__field(u32, first_quadlet)
266+
__field(u32, second_quadlet)
267+
),
268+
TP_fast_assign(
269+
__entry->packet = packet;
270+
__entry->generation = generation;
271+
__entry->status = status;
272+
__entry->timestamp = timestamp;
273+
__entry->first_quadlet = first_quadlet;
274+
__entry->second_quadlet = second_quadlet
275+
),
276+
TP_printk(
277+
"packet=0x%016llx generation=%u status=%u timestamp=0x%04x first_quadlet=0x%08x second_quadlet=0x%08x",
278+
__entry->packet,
279+
__entry->generation,
280+
__entry->status,
281+
__entry->timestamp,
282+
__entry->first_quadlet,
283+
__entry->second_quadlet
284+
)
285+
);
286+
257287
#endif // _FIREWIRE_TRACE_EVENT_H
258288

259289
#include <trace/define_trace.h>

0 commit comments

Comments
 (0)