2 #define TRACE_SYSTEM snd_pcm
4 #if !defined(_PCM_PARAMS_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
5 #define _PCM_PARAMS_TRACE_H
7 #include <linux/tracepoint.h>
9 #define HW_PARAM_ENTRY(param) {SNDRV_PCM_HW_PARAM_##param, #param}
10 #define hw_param_labels \
11 HW_PARAM_ENTRY(ACCESS), \
12 HW_PARAM_ENTRY(FORMAT), \
13 HW_PARAM_ENTRY(SUBFORMAT), \
14 HW_PARAM_ENTRY(SAMPLE_BITS), \
15 HW_PARAM_ENTRY(FRAME_BITS), \
16 HW_PARAM_ENTRY(CHANNELS), \
17 HW_PARAM_ENTRY(RATE), \
18 HW_PARAM_ENTRY(PERIOD_TIME), \
19 HW_PARAM_ENTRY(PERIOD_SIZE), \
20 HW_PARAM_ENTRY(PERIOD_BYTES), \
21 HW_PARAM_ENTRY(PERIODS), \
22 HW_PARAM_ENTRY(BUFFER_TIME), \
23 HW_PARAM_ENTRY(BUFFER_SIZE), \
24 HW_PARAM_ENTRY(BUFFER_BYTES), \
25 HW_PARAM_ENTRY(TICK_TIME)
27 TRACE_EVENT(hw_mask_param
,
28 TP_PROTO(struct snd_pcm_substream
*substream
, snd_pcm_hw_param_t type
, int index
, const struct snd_mask
*prev
, const struct snd_mask
*curr
),
29 TP_ARGS(substream
, type
, index
, prev
, curr
),
33 __field(int, subdevice
)
34 __field(int, direction
)
35 __field(snd_pcm_hw_param_t
, type
)
38 __array(__u32
, prev_bits
, 8)
39 __array(__u32
, curr_bits
, 8)
42 __entry
->card
= substream
->pcm
->card
->number
;
43 __entry
->device
= substream
->pcm
->device
;
44 __entry
->subdevice
= substream
->number
;
45 __entry
->direction
= substream
->stream
;
47 __entry
->index
= index
;
48 __entry
->total
= substream
->runtime
->hw_constraints
.rules_num
;
49 memcpy(__entry
->prev_bits
, prev
->bits
, sizeof(__u32
) * 8);
50 memcpy(__entry
->curr_bits
, curr
->bits
, sizeof(__u32
) * 8);
52 TP_printk("pcmC%dD%d%s:%d %03d/%03d %s %08x%08x%08x%08x %08x%08x%08x%08x",
55 __entry
->direction
? "c" : "p",
59 __print_symbolic(__entry
->type
, hw_param_labels
),
60 __entry
->prev_bits
[3], __entry
->prev_bits
[2],
61 __entry
->prev_bits
[1], __entry
->prev_bits
[0],
62 __entry
->curr_bits
[3], __entry
->curr_bits
[2],
63 __entry
->curr_bits
[1], __entry
->curr_bits
[0]
67 TRACE_EVENT(hw_interval_param
,
68 TP_PROTO(struct snd_pcm_substream
*substream
, snd_pcm_hw_param_t type
, int index
, const struct snd_interval
*prev
, const struct snd_interval
*curr
),
69 TP_ARGS(substream
, type
, index
, prev
, curr
),
73 __field(int, subdevice
)
74 __field(int, direction
)
75 __field(snd_pcm_hw_param_t
, type
)
78 __field(unsigned int, prev_min
)
79 __field(unsigned int, prev_max
)
80 __field(unsigned int, prev_openmin
)
81 __field(unsigned int, prev_openmax
)
82 __field(unsigned int, prev_integer
)
83 __field(unsigned int, prev_empty
)
84 __field(unsigned int, curr_min
)
85 __field(unsigned int, curr_max
)
86 __field(unsigned int, curr_openmin
)
87 __field(unsigned int, curr_openmax
)
88 __field(unsigned int, curr_integer
)
89 __field(unsigned int, curr_empty
)
92 __entry
->card
= substream
->pcm
->card
->number
;
93 __entry
->device
= substream
->pcm
->device
;
94 __entry
->subdevice
= substream
->number
;
95 __entry
->direction
= substream
->stream
;
97 __entry
->index
= index
;
98 __entry
->total
= substream
->runtime
->hw_constraints
.rules_num
;
99 __entry
->prev_min
= prev
->min
;
100 __entry
->prev_max
= prev
->max
;
101 __entry
->prev_openmin
= prev
->openmin
;
102 __entry
->prev_openmax
= prev
->openmax
;
103 __entry
->prev_integer
= prev
->integer
;
104 __entry
->prev_empty
= prev
->empty
;
105 __entry
->curr_min
= curr
->min
;
106 __entry
->curr_max
= curr
->max
;
107 __entry
->curr_openmin
= curr
->openmin
;
108 __entry
->curr_openmax
= curr
->openmax
;
109 __entry
->curr_integer
= curr
->integer
;
110 __entry
->curr_empty
= curr
->empty
;
112 TP_printk("pcmC%dD%d%s:%d %03d/%03d %s %d %d %s%u %u%s %d %d %s%u %u%s",
115 __entry
->direction
? "c" : "p",
119 __print_symbolic(__entry
->type
, hw_param_labels
),
121 __entry
->prev_integer
,
122 __entry
->prev_openmin
? "(" : "[",
125 __entry
->prev_openmax
? ")" : "]",
127 __entry
->curr_integer
,
128 __entry
->curr_openmin
? "(" : "[",
131 __entry
->curr_openmax
? ")" : "]"
135 #endif /* _PCM_PARAMS_TRACE_H */
137 /* This part must be outside protection */
138 #undef TRACE_INCLUDE_PATH
139 #define TRACE_INCLUDE_PATH .
140 #undef TRACE_INCLUDE_FILE
141 #define TRACE_INCLUDE_FILE pcm_param_trace
142 #include <trace/define_trace.h>