summaryrefslogtreecommitdiffstats
path: root/sound/soc/intel/catpt/trace.h
blob: 010f57b6a7a896734a9db3668a6018a0c0c31a26 (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
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright(c) 2020 Intel Corporation
 *
 * Author: Cezary Rojewski <cezary.rojewski@intel.com>
 */

#undef TRACE_SYSTEM
#define TRACE_SYSTEM intel_catpt

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

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

DECLARE_EVENT_CLASS(catpt_ipc_msg,

	TP_PROTO(u32 header),

	TP_ARGS(header),

	TP_STRUCT__entry(
		__field(u32, header)
	),

	TP_fast_assign(
		__entry->header = header;
	),

	TP_printk("0x%08x", __entry->header)
);

DEFINE_EVENT(catpt_ipc_msg, catpt_irq,
	TP_PROTO(u32 header),
	TP_ARGS(header)
);

DEFINE_EVENT(catpt_ipc_msg, catpt_ipc_request,
	TP_PROTO(u32 header),
	TP_ARGS(header)
);

DEFINE_EVENT(catpt_ipc_msg, catpt_ipc_reply,
	TP_PROTO(u32 header),
	TP_ARGS(header)
);

DEFINE_EVENT(catpt_ipc_msg, catpt_ipc_notify,
	TP_PROTO(u32 header),
	TP_ARGS(header)
);

TRACE_EVENT_CONDITION(catpt_ipc_payload,

	TP_PROTO(const u8 *data, size_t size),

	TP_ARGS(data, size),

	TP_CONDITION(data && size),

	TP_STRUCT__entry(
		__dynamic_array(u8, buf, size)
	),

	TP_fast_assign(
		memcpy(__get_dynamic_array(buf), data, size);
	),

	TP_printk("%u byte(s)%s",
		  __get_dynamic_array_len(buf),
		  __print_hex_dump("", DUMP_PREFIX_NONE, 16, 4,
				   __get_dynamic_array(buf),
				   __get_dynamic_array_len(buf), false))
);

#endif /* __SND_SOC_INTEL_CATPT_TRACE_H */

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