summaryrefslogtreecommitdiff
path: root/include/trace/events/xdma.h
blob: bf515ad3d8e504b7172f2defce294c0a946f29d4 (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
/* SPDX-License-Identifier: GPL-2.0 */

#undef TRACE_SYSTEM
#define TRACE_SYSTEM xdma

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

#include <linux/tracepoint.h>

TRACE_EVENT(xdma_start,
	TP_PROTO(const struct aspeed_xdma *ctx, const struct aspeed_xdma_cmd *cmd),
	TP_ARGS(ctx, cmd),
	TP_STRUCT__entry(
		__field(bool,	dir_upstream)
		__field(unsigned int,	index)
		__field(__u64,	host)
		__field(__u64,	pitch)
		__field(__u64,	cmd)
	),
	TP_fast_assign(
		__entry->dir_upstream = ctx->upstream;
		__entry->index = ctx->cmd_idx;
		__entry->host = cmd->host_addr;
		__entry->pitch = cmd->pitch;
		__entry->cmd = cmd->cmd;
	),
	TP_printk("%s cmd:%u [%08llx %016llx %016llx]",
		__entry->dir_upstream ? "upstream" : "downstream",
		__entry->index,
		__entry->host,
		__entry->pitch,
		__entry->cmd
	)
);

TRACE_EVENT(xdma_irq,
	TP_PROTO(u32 sts),
	TP_ARGS(sts),
	TP_STRUCT__entry(
		__field(__u32,	status)
	),
	TP_fast_assign(
		__entry->status = sts;
	),
	TP_printk("sts:%08x",
		__entry->status
	)
);

TRACE_EVENT(xdma_reset,
	TP_PROTO(const struct aspeed_xdma *ctx),
	TP_ARGS(ctx),
	TP_STRUCT__entry(
		__field(bool,	dir_upstream)
		__field(bool,	in_progress)
	),
	TP_fast_assign(
		__entry->dir_upstream = ctx->upstream;
		__entry->in_progress =
			ctx->current_client ? ctx->current_client->in_progress : false;
	),
	TP_printk("%sin progress%s",
		__entry->in_progress ? "" : "not ",
		__entry->in_progress ? (__entry->dir_upstream ? " upstream" : " downstream") : ""
	)
);

TRACE_EVENT(xdma_perst,
	TP_PROTO(const struct aspeed_xdma *ctx),
	TP_ARGS(ctx),
	TP_STRUCT__entry(
		__field(bool,	in_reset)
	),
	TP_fast_assign(
		__entry->in_reset = ctx->in_reset;
	),
	TP_printk("%s",
		__entry->in_reset ? "in reset" : ""
	)
);

TRACE_EVENT(xdma_unmap,
	TP_PROTO(const struct aspeed_xdma_client *client),
	TP_ARGS(client),
	TP_STRUCT__entry(
		__field(__u32,	phys)
		__field(__u32,	size)
	),
	TP_fast_assign(
		__entry->phys = client->phys;
		__entry->size = client->size;
	),
	TP_printk("p:%08x s:%08x",
		__entry->phys,
		__entry->size
	)
);

TRACE_EVENT(xdma_mmap_error,
	TP_PROTO(const struct aspeed_xdma_client *client, unsigned long vm_start),
	TP_ARGS(client, vm_start),
	TP_STRUCT__entry(
		__field(__u32,	phys)
		__field(__u32,	size)
		__field(unsigned long,	vm_start)
	),
	TP_fast_assign(
		__entry->phys = client->phys;
		__entry->size = client->size;
		__entry->vm_start = vm_start;
	),
	TP_printk("p:%08x s:%08x v:%08lx",
		__entry->phys,
		__entry->size,
		__entry->vm_start
	)
);

TRACE_EVENT(xdma_mmap,
	TP_PROTO(const struct aspeed_xdma_client *client),
	TP_ARGS(client),
	TP_STRUCT__entry(
		__field(__u32,	phys)
		__field(__u32,	size)
	),
	TP_fast_assign(
		__entry->phys = client->phys;
		__entry->size = client->size;
	),
	TP_printk("p:%08x s:%08x",
		__entry->phys,
		__entry->size
	)
);

#endif /* _TRACE_XDMA_H */

#include <trace/define_trace.h>