aboutsummaryrefslogtreecommitdiff
path: root/include/trace/sst_trace.h
blob: 8d34ef3575e53d1fc53396a9f04de0b4cdf52a10 (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
/*
 *  sst_trace.h - Intel SST Driver tracing support
 *
 *  Copyright (C) 2013	Intel Corp
 *  Authors: Omair Mohammed Abdullah <omair.m.abdullah@linux.intel.com>
 *  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; version 2 of the License.
 *
 *  This program is distributed in the hope that it will be useful, but
 *  WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License along
 *  with this program; if not, write to the Free Software Foundation, Inc.,
 *  59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
 *
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 */

#undef TRACE_SYSTEM
#define TRACE_SYSTEM sst

#if !defined(_TRACE_SST_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_SST_H

#include <linux/types.h>
#include <linux/ktime.h>
#include <linux/tracepoint.h>

TRACE_EVENT(sst_ipc,

	TP_PROTO(const char *msg, u32 header_high, u32 header_low, int pvt_id),

	TP_ARGS(msg, header_high, header_low, pvt_id),

	TP_STRUCT__entry(
		__string(info_msg,	msg)
		__field(unsigned int,	val_l)
		__field(unsigned int,	val_h)
		__field(unsigned int,	id)
	),

	TP_fast_assign(
		__assign_str(info_msg, msg);
		__entry->val_l = header_low;
		__entry->val_h = header_high;
		__entry->id = pvt_id;
	),

	TP_printk("\t%s\t [%2u] = %#8.8x:%.4x", __get_str(info_msg),
		  (unsigned int)__entry->id,
		  (unsigned int)__entry->val_h, (unsigned int)__entry->val_l)

);

TRACE_EVENT(sst_stream,

	TP_PROTO(const char *msg, int str_id, int pipe_id),

	TP_ARGS(msg, str_id, pipe_id),

	TP_STRUCT__entry(
		__string(info_msg,	msg)
		__field(unsigned int,	str_id)
		__field(unsigned int,	pipe_id)
	),

	TP_fast_assign(
		__assign_str(info_msg, msg);
		__entry->str_id = str_id;
		__entry->pipe_id = pipe_id;
	),

	TP_printk("\t%s\t str  = %2u, pipe = %#x", __get_str(info_msg),
		  (unsigned int)__entry->str_id, (unsigned int)__entry->pipe_id)
);

TRACE_EVENT(sst_ipc_mailbox,

	TP_PROTO(const char *mailbox, int mbox_len),

	TP_ARGS(mailbox, mbox_len),

	TP_STRUCT__entry(
		__dynamic_array(char,	mbox,	(3 * mbox_len))
	),

	TP_fast_assign(
		sst_dump_to_buffer(mailbox, mbox_len,
				   __get_dynamic_array(mbox));
	),

	TP_printk("  %s", __get_str(mbox))

);

TRACE_EVENT(sst_lib_download,

	TP_PROTO(const char *msg, const char *lib_name),

	TP_ARGS(msg, lib_name),

	TP_STRUCT__entry(
		__string(info_msg, msg)
		__string(info_lib_name, lib_name)
	),

	TP_fast_assign(
		__assign_str(info_msg, msg);
		__assign_str(info_lib_name, lib_name);
	),

	TP_printk("\t%s %s", __get_str(info_msg),
			__get_str(info_lib_name))
);

TRACE_EVENT(sst_fw_download,

	TP_PROTO(const char *msg, int fw_state),

	TP_ARGS(msg, fw_state),

	TP_STRUCT__entry(
		__string(info_msg, msg)
		__field(unsigned int,   fw_state)
	),

	TP_fast_assign(
		__assign_str(info_msg, msg);
		__entry->fw_state = fw_state;
	),

	TP_printk("\t%s\tFW state = %d", __get_str(info_msg),
				(unsigned int)__entry->fw_state)
);

#endif /* _TRACE_SST_H */

/* This part must be outside protection */
#undef TRACE_INCLUDE_PATH
#define TRACE_INCLUDE_PATH .
#define TRACE_INCLUDE_FILE sst_trace
#include <trace/define_trace.h>