1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * amdtp-motu-trace.h - tracepoint definitions to dump a part of packet data
5 * Copyright (c) 2017 Takashi Sakamoto
9 #define TRACE_SYSTEM snd_firewire_motu
11 #if !defined(_SND_FIREWIRE_MOTU_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
12 #define _SND_FIREWIRE_MOTU_TRACE_H
14 #include <linux/tracepoint.h>
16 static void copy_sph(u32
*frame
, __be32
*buffer
, unsigned int data_blocks
,
17 unsigned int data_block_quadlets
);
18 static void copy_message(u64
*frames
, __be32
*buffer
, unsigned int data_blocks
,
19 unsigned int data_block_quadlets
);
21 TRACE_EVENT(data_block_sph
,
22 TP_PROTO(struct amdtp_stream
*s
, unsigned int data_blocks
, __be32
*buffer
),
23 TP_ARGS(s
, data_blocks
, buffer
),
27 __field(unsigned int, data_blocks
)
28 __dynamic_array(u32
, tstamps
, data_blocks
)
31 if (s
->direction
== AMDTP_IN_STREAM
) {
32 __entry
->src
= fw_parent_device(s
->unit
)->node_id
;
33 __entry
->dst
= fw_parent_device(s
->unit
)->card
->node_id
;
35 __entry
->src
= fw_parent_device(s
->unit
)->card
->node_id
;
36 __entry
->dst
= fw_parent_device(s
->unit
)->node_id
;
38 __entry
->data_blocks
= data_blocks
;
39 copy_sph(__get_dynamic_array(tstamps
), buffer
, data_blocks
, s
->data_block_quadlets
);
46 __print_array(__get_dynamic_array(tstamps
), __entry
->data_blocks
, 4)
50 TRACE_EVENT(data_block_message
,
51 TP_PROTO(struct amdtp_stream
*s
, unsigned int data_blocks
, __be32
*buffer
),
52 TP_ARGS(s
, data_blocks
, buffer
),
56 __field(unsigned int, data_blocks
)
57 __dynamic_array(u64
, messages
, data_blocks
)
60 if (s
->direction
== AMDTP_IN_STREAM
) {
61 __entry
->src
= fw_parent_device(s
->unit
)->node_id
;
62 __entry
->dst
= fw_parent_device(s
->unit
)->card
->node_id
;
64 __entry
->src
= fw_parent_device(s
->unit
)->card
->node_id
;
65 __entry
->dst
= fw_parent_device(s
->unit
)->node_id
;
67 __entry
->data_blocks
= data_blocks
;
68 copy_message(__get_dynamic_array(messages
), buffer
, data_blocks
, s
->data_block_quadlets
);
75 __print_array(__get_dynamic_array(messages
), __entry
->data_blocks
, 8)
81 #undef TRACE_INCLUDE_PATH
82 #define TRACE_INCLUDE_PATH .
83 #undef TRACE_INCLUDE_FILE
84 #define TRACE_INCLUDE_FILE amdtp-motu-trace
85 #include <trace/define_trace.h>