xref: /openbmc/linux/include/trace/events/xdma.h (revision 39f555fb)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 
3 #undef TRACE_SYSTEM
4 #define TRACE_SYSTEM xdma
5 
6 #if !defined(_TRACE_XDMA_H) || defined(TRACE_HEADER_MULTI_READ)
7 #define _TRACE_XDMA_H
8 
9 #include <linux/tracepoint.h>
10 
11 TRACE_EVENT(xdma_start,
12 	TP_PROTO(const struct aspeed_xdma *ctx, const struct aspeed_xdma_cmd *cmd),
13 	TP_ARGS(ctx, cmd),
14 	TP_STRUCT__entry(
15 		__field(bool,	dir_upstream)
16 		__field(unsigned int,	index)
17 		__field(__u64,	host)
18 		__field(__u64,	pitch)
19 		__field(__u64,	cmd)
20 	),
21 	TP_fast_assign(
22 		__entry->dir_upstream = ctx->upstream;
23 		__entry->index = ctx->cmd_idx;
24 		__entry->host = cmd->host_addr;
25 		__entry->pitch = cmd->pitch;
26 		__entry->cmd = cmd->cmd;
27 	),
28 	TP_printk("%s cmd:%u [%08llx %016llx %016llx]",
29 		__entry->dir_upstream ? "upstream" : "downstream",
30 		__entry->index,
31 		__entry->host,
32 		__entry->pitch,
33 		__entry->cmd
34 	)
35 );
36 
37 TRACE_EVENT(xdma_irq,
38 	TP_PROTO(u32 sts),
39 	TP_ARGS(sts),
40 	TP_STRUCT__entry(
41 		__field(__u32,	status)
42 	),
43 	TP_fast_assign(
44 		__entry->status = sts;
45 	),
46 	TP_printk("sts:%08x",
47 		__entry->status
48 	)
49 );
50 
51 TRACE_EVENT(xdma_reset,
52 	TP_PROTO(const struct aspeed_xdma *ctx),
53 	TP_ARGS(ctx),
54 	TP_STRUCT__entry(
55 		__field(bool,	dir_upstream)
56 		__field(bool,	in_progress)
57 	),
58 	TP_fast_assign(
59 		__entry->dir_upstream = ctx->upstream;
60 		__entry->in_progress =
61 			ctx->current_client ? ctx->current_client->in_progress : false;
62 	),
63 	TP_printk("%sin progress%s",
64 		__entry->in_progress ? "" : "not ",
65 		__entry->in_progress ? (__entry->dir_upstream ? " upstream" : " downstream") : ""
66 	)
67 );
68 
69 TRACE_EVENT(xdma_perst,
70 	TP_PROTO(const struct aspeed_xdma *ctx),
71 	TP_ARGS(ctx),
72 	TP_STRUCT__entry(
73 		__field(bool,	in_reset)
74 	),
75 	TP_fast_assign(
76 		__entry->in_reset = ctx->in_reset;
77 	),
78 	TP_printk("%s",
79 		__entry->in_reset ? "in reset" : ""
80 	)
81 );
82 
83 TRACE_EVENT(xdma_unmap,
84 	TP_PROTO(const struct aspeed_xdma_client *client),
85 	TP_ARGS(client),
86 	TP_STRUCT__entry(
87 		__field(__u32,	phys)
88 		__field(__u32,	size)
89 	),
90 	TP_fast_assign(
91 		__entry->phys = client->phys;
92 		__entry->size = client->size;
93 	),
94 	TP_printk("p:%08x s:%08x",
95 		__entry->phys,
96 		__entry->size
97 	)
98 );
99 
100 TRACE_EVENT(xdma_mmap_error,
101 	TP_PROTO(const struct aspeed_xdma_client *client, unsigned long vm_start),
102 	TP_ARGS(client, vm_start),
103 	TP_STRUCT__entry(
104 		__field(__u32,	phys)
105 		__field(__u32,	size)
106 		__field(unsigned long,	vm_start)
107 	),
108 	TP_fast_assign(
109 		__entry->phys = client->phys;
110 		__entry->size = client->size;
111 		__entry->vm_start = vm_start;
112 	),
113 	TP_printk("p:%08x s:%08x v:%08lx",
114 		__entry->phys,
115 		__entry->size,
116 		__entry->vm_start
117 	)
118 );
119 
120 TRACE_EVENT(xdma_mmap,
121 	TP_PROTO(const struct aspeed_xdma_client *client),
122 	TP_ARGS(client),
123 	TP_STRUCT__entry(
124 		__field(__u32,	phys)
125 		__field(__u32,	size)
126 	),
127 	TP_fast_assign(
128 		__entry->phys = client->phys;
129 		__entry->size = client->size;
130 	),
131 	TP_printk("p:%08x s:%08x",
132 		__entry->phys,
133 		__entry->size
134 	)
135 );
136 
137 #endif /* _TRACE_XDMA_H */
138 
139 #include <trace/define_trace.h>
140