Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #undef TRACE_SYSTEM
0003 #define TRACE_SYSTEM snd_pcm
0004 
0005 #if !defined(_PCM_PARAMS_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
0006 #define _PCM_PARAMS_TRACE_H
0007 
0008 #include <linux/tracepoint.h>
0009 
0010 #define HW_PARAM_ENTRY(param) {SNDRV_PCM_HW_PARAM_##param, #param}
0011 #define hw_param_labels         \
0012     HW_PARAM_ENTRY(ACCESS),     \
0013     HW_PARAM_ENTRY(FORMAT),     \
0014     HW_PARAM_ENTRY(SUBFORMAT),  \
0015     HW_PARAM_ENTRY(SAMPLE_BITS),    \
0016     HW_PARAM_ENTRY(FRAME_BITS), \
0017     HW_PARAM_ENTRY(CHANNELS),   \
0018     HW_PARAM_ENTRY(RATE),       \
0019     HW_PARAM_ENTRY(PERIOD_TIME),    \
0020     HW_PARAM_ENTRY(PERIOD_SIZE),    \
0021     HW_PARAM_ENTRY(PERIOD_BYTES),   \
0022     HW_PARAM_ENTRY(PERIODS),    \
0023     HW_PARAM_ENTRY(BUFFER_TIME),    \
0024     HW_PARAM_ENTRY(BUFFER_SIZE),    \
0025     HW_PARAM_ENTRY(BUFFER_BYTES),   \
0026     HW_PARAM_ENTRY(TICK_TIME)
0027 
0028 TRACE_EVENT(hw_mask_param,
0029     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),
0030     TP_ARGS(substream, type, index, prev, curr),
0031     TP_STRUCT__entry(
0032         __field(int, card)
0033         __field(int, device)
0034         __field(int, subdevice)
0035         __field(int, direction)
0036         __field(snd_pcm_hw_param_t, type)
0037         __field(int, index)
0038         __field(int, total)
0039         __array(__u32, prev_bits, 8)
0040         __array(__u32, curr_bits, 8)
0041     ),
0042     TP_fast_assign(
0043         __entry->card = substream->pcm->card->number;
0044         __entry->device = substream->pcm->device;
0045         __entry->subdevice = substream->number;
0046         __entry->direction = substream->stream;
0047         __entry->type = type;
0048         __entry->index = index;
0049         __entry->total = substream->runtime->hw_constraints.rules_num;
0050         memcpy(__entry->prev_bits, prev->bits, sizeof(__u32) * 8);
0051         memcpy(__entry->curr_bits, curr->bits, sizeof(__u32) * 8);
0052     ),
0053     TP_printk("pcmC%dD%d%s:%d %03d/%03d %s %08x%08x%08x%08x %08x%08x%08x%08x",
0054           __entry->card,
0055           __entry->device,
0056           __entry->direction ? "c" : "p",
0057           __entry->subdevice,
0058           __entry->index,
0059           __entry->total,
0060           __print_symbolic(__entry->type, hw_param_labels),
0061           __entry->prev_bits[3], __entry->prev_bits[2],
0062           __entry->prev_bits[1], __entry->prev_bits[0],
0063           __entry->curr_bits[3], __entry->curr_bits[2],
0064           __entry->curr_bits[1], __entry->curr_bits[0]
0065     )
0066 );
0067 
0068 TRACE_EVENT(hw_interval_param,
0069     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),
0070     TP_ARGS(substream, type, index, prev, curr),
0071     TP_STRUCT__entry(
0072         __field(int, card)
0073         __field(int, device)
0074         __field(int, subdevice)
0075         __field(int, direction)
0076         __field(snd_pcm_hw_param_t, type)
0077         __field(int, index)
0078         __field(int, total)
0079         __field(unsigned int, prev_min)
0080         __field(unsigned int, prev_max)
0081         __field(unsigned int, prev_openmin)
0082         __field(unsigned int, prev_openmax)
0083         __field(unsigned int, prev_integer)
0084         __field(unsigned int, prev_empty)
0085         __field(unsigned int, curr_min)
0086         __field(unsigned int, curr_max)
0087         __field(unsigned int, curr_openmin)
0088         __field(unsigned int, curr_openmax)
0089         __field(unsigned int, curr_integer)
0090         __field(unsigned int, curr_empty)
0091     ),
0092     TP_fast_assign(
0093         __entry->card = substream->pcm->card->number;
0094         __entry->device = substream->pcm->device;
0095         __entry->subdevice = substream->number;
0096         __entry->direction = substream->stream;
0097         __entry->type = type;
0098         __entry->index = index;
0099         __entry->total = substream->runtime->hw_constraints.rules_num;
0100         __entry->prev_min = prev->min;
0101         __entry->prev_max = prev->max;
0102         __entry->prev_openmin = prev->openmin;
0103         __entry->prev_openmax = prev->openmax;
0104         __entry->prev_integer = prev->integer;
0105         __entry->prev_empty = prev->empty;
0106         __entry->curr_min = curr->min;
0107         __entry->curr_max = curr->max;
0108         __entry->curr_openmin = curr->openmin;
0109         __entry->curr_openmax = curr->openmax;
0110         __entry->curr_integer = curr->integer;
0111         __entry->curr_empty = curr->empty;
0112     ),
0113     TP_printk("pcmC%dD%d%s:%d %03d/%03d %s %d %d %s%u %u%s %d %d %s%u %u%s",
0114           __entry->card,
0115           __entry->device,
0116           __entry->direction ? "c" : "p",
0117           __entry->subdevice,
0118           __entry->index,
0119           __entry->total,
0120           __print_symbolic(__entry->type, hw_param_labels),
0121           __entry->prev_empty,
0122           __entry->prev_integer,
0123           __entry->prev_openmin ? "(" : "[",
0124           __entry->prev_min,
0125           __entry->prev_max,
0126           __entry->prev_openmax ? ")" : "]",
0127           __entry->curr_empty,
0128           __entry->curr_integer,
0129           __entry->curr_openmin ? "(" : "[",
0130           __entry->curr_min,
0131           __entry->curr_max,
0132           __entry->curr_openmax ? ")" : "]"
0133     )
0134 );
0135 
0136 #endif /* _PCM_PARAMS_TRACE_H */
0137 
0138 /* This part must be outside protection */
0139 #undef TRACE_INCLUDE_PATH
0140 #define TRACE_INCLUDE_PATH .
0141 #undef TRACE_INCLUDE_FILE
0142 #define TRACE_INCLUDE_FILE pcm_param_trace
0143 #include <trace/define_trace.h>