summaryrefslogtreecommitdiffstats
path: root/include/trace/events/sof_intel.h
blob: 9e579e57b15cf845b2c1f63a755466f73b6393ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright(c) 2022 Intel Corporation
 *
 * Author: Noah Klayman <noah.klayman@intel.com>
 */

#undef TRACE_SYSTEM
#define TRACE_SYSTEM sof_intel

#if !defined(_TRACE_SOF_INTEL_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_SOF_INTEL_H
#include <linux/tracepoint.h>
#include <sound/hdaudio.h>
#include "../../../sound/soc/sof/sof-audio.h"

TRACE_EVENT(sof_intel_hda_irq,
	TP_PROTO(struct snd_sof_dev *sdev, char *source),
	TP_ARGS(sdev, source),
	TP_STRUCT__entry(
		__string(device_name, dev_name(sdev->dev))
		__string(source, source)
	),
	TP_fast_assign(
		__assign_str(device_name);
		__assign_str(source);
	),
	TP_printk("device_name=%s source=%s",
		  __get_str(device_name), __get_str(source))
);

DECLARE_EVENT_CLASS(sof_intel_ipc_firmware_template,
	TP_ARGS(struct snd_sof_dev *sdev, u32 msg, u32 msg_ext),
	TP_PROTO(sdev, msg, msg_ext),
	TP_STRUCT__entry(
		__string(device_name, dev_name(sdev->dev))
		__field(u32, msg)
		__field(u32, msg_ext)
	),
	TP_fast_assign(
		__assign_str(device_name);
		__entry->msg = msg;
		__entry->msg_ext = msg_ext;
	),
	TP_printk("device_name=%s msg=%#x msg_ext=%#x",
		  __get_str(device_name), __entry->msg, __entry->msg_ext)
);

DEFINE_EVENT(sof_intel_ipc_firmware_template, sof_intel_ipc_firmware_response,
	TP_PROTO(struct snd_sof_dev *sdev, u32 msg, u32 msg_ext),
	TP_ARGS(sdev, msg, msg_ext)
);

DEFINE_EVENT(sof_intel_ipc_firmware_template, sof_intel_ipc_firmware_initiated,
	TP_PROTO(struct snd_sof_dev *sdev, u32 msg, u32 msg_ext),
	TP_ARGS(sdev, msg, msg_ext)
);

TRACE_EVENT(sof_intel_D0I3C_updated,
	TP_PROTO(struct snd_sof_dev *sdev, u8 reg),
	TP_ARGS(sdev, reg),
	TP_STRUCT__entry(
		__string(device_name, dev_name(sdev->dev))
		__field(u8, reg)
	),
	TP_fast_assign(
		__assign_str(device_name);
		__entry->reg = reg;
	),
	TP_printk("device_name=%s register=%#x",
		  __get_str(device_name), __entry->reg)
);

TRACE_EVENT(sof_intel_hda_irq_ipc_check,
	TP_PROTO(struct snd_sof_dev *sdev, u32 irq_status),
	TP_ARGS(sdev, irq_status),
	TP_STRUCT__entry(
		__string(device_name, dev_name(sdev->dev))
		__field(u32, irq_status)
	),
	TP_fast_assign(
		__assign_str(device_name);
		__entry->irq_status = irq_status;
	),
	TP_printk("device_name=%s irq_status=%#x",
		  __get_str(device_name), __entry->irq_status)
);

TRACE_EVENT(sof_intel_hda_dsp_pcm,
	TP_PROTO(struct snd_sof_dev *sdev,
		struct hdac_stream *hstream,
		struct snd_pcm_substream *substream,
		snd_pcm_uframes_t pos
	),
	TP_ARGS(sdev, hstream, substream, pos),
	TP_STRUCT__entry(
		__string(device_name, dev_name(sdev->dev))
		__field(u32, hstream_index)
		__field(u32, substream)
		__field(unsigned long, pos)
	),
	TP_fast_assign(
		__assign_str(device_name);
		__entry->hstream_index = hstream->index;
		__entry->substream = substream->stream;
		__entry->pos = pos;
	),
	TP_printk("device_name=%s hstream_index=%d substream=%d pos=%lu",
		  __get_str(device_name), __entry->hstream_index,
		  __entry->substream, __entry->pos)
);

TRACE_EVENT(sof_intel_hda_dsp_stream_status,
	TP_PROTO(struct device *dev, struct hdac_stream *s, u32 status),
	TP_ARGS(dev, s, status),
	TP_STRUCT__entry(
		__string(device_name, dev_name(dev))
		__field(u32, stream)
		__field(u32, status)
	),
	TP_fast_assign(
		__assign_str(device_name);
		__entry->stream = s->index;
		__entry->status = status;
	),
	TP_printk("device_name=%s stream=%d status=%#x",
		  __get_str(device_name), __entry->stream, __entry->status)
);

TRACE_EVENT(sof_intel_hda_dsp_check_stream_irq,
	TP_PROTO(struct snd_sof_dev *sdev, u32 status),
	TP_ARGS(sdev, status),
	TP_STRUCT__entry(
		__string(device_name, dev_name(sdev->dev))
		__field(u32, status)
	),
	TP_fast_assign(
		__assign_str(device_name);
		__entry->status = status;
	),
	TP_printk("device_name=%s status=%#x",
		  __get_str(device_name), __entry->status)
);

#endif /* _TRACE_SOF_INTEL_H */

/* This part must be outside protection */
#include <trace/define_trace.h>