1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * amdtp-stream-trace.h - tracepoint definitions to dump a part of packet data
5 * Copyright (c) 2016 Takashi Sakamoto
9 #define TRACE_SYSTEM snd_firewire_lib
11 #if !defined(_AMDTP_STREAM_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
12 #define _AMDTP_STREAM_TRACE_H
14 #include <linux/tracepoint.h>
16 TRACE_EVENT(amdtp_packet
,
17 TP_PROTO(const struct amdtp_stream
*s
, u32 cycles
, const __be32
*cip_header
, unsigned int payload_length
, unsigned int data_blocks
, unsigned int data_block_counter
, unsigned int index
),
18 TP_ARGS(s
, cycles
, cip_header
, payload_length
, data_blocks
, data_block_counter
, index
),
20 __field(unsigned int, second
)
21 __field(unsigned int, cycle
)
25 __dynamic_array(u8
, cip_header
, cip_header
? 8 : 0)
26 __field(unsigned int, payload_quadlets
)
27 __field(unsigned int, data_blocks
)
28 __field(unsigned int, data_block_counter
)
29 __field(unsigned int, packet_index
)
30 __field(unsigned int, irq
)
31 __field(unsigned int, index
)
34 __entry
->second
= cycles
/ CYCLES_PER_SECOND
;
35 __entry
->cycle
= cycles
% CYCLES_PER_SECOND
;
36 __entry
->channel
= s
->context
->channel
;
37 if (s
->direction
== AMDTP_IN_STREAM
) {
38 __entry
->src
= fw_parent_device(s
->unit
)->node_id
;
39 __entry
->dest
= fw_parent_device(s
->unit
)->card
->node_id
;
41 __entry
->src
= fw_parent_device(s
->unit
)->card
->node_id
;
42 __entry
->dest
= fw_parent_device(s
->unit
)->node_id
;
45 memcpy(__get_dynamic_array(cip_header
), cip_header
,
46 __get_dynamic_array_len(cip_header
));
48 __entry
->payload_quadlets
= payload_length
/ sizeof(__be32
);
49 __entry
->data_blocks
= data_blocks
;
50 __entry
->data_block_counter
= data_block_counter
,
51 __entry
->packet_index
= s
->packet_index
;
52 __entry
->irq
= !!in_interrupt();
53 __entry
->index
= index
;
56 "%02u %04u %04x %04x %02d %03u %02u %03u %02u %01u %02u %s",
62 __entry
->payload_quadlets
,
64 __entry
->data_block_counter
,
65 __entry
->packet_index
,
68 __print_array(__get_dynamic_array(cip_header
),
69 __get_dynamic_array_len(cip_header
), 1))
74 #undef TRACE_INCLUDE_PATH
75 #define TRACE_INCLUDE_PATH .
76 #undef TRACE_INCLUDE_FILE
77 #define TRACE_INCLUDE_FILE amdtp-stream-trace
78 #include <trace/define_trace.h>