xref: /openbmc/linux/drivers/gpu/drm/v3d/v3d_trace.h (revision 1cac4f26)
1 // SPDX-License-Identifier: GPL-2.0+
2 /* Copyright (C) 2015-2018 Broadcom */
3 
4 #if !defined(_V3D_TRACE_H_) || defined(TRACE_HEADER_MULTI_READ)
5 #define _V3D_TRACE_H_
6 
7 #include <linux/stringify.h>
8 #include <linux/types.h>
9 #include <linux/tracepoint.h>
10 
11 #undef TRACE_SYSTEM
12 #define TRACE_SYSTEM v3d
13 #define TRACE_INCLUDE_FILE v3d_trace
14 
15 TRACE_EVENT(v3d_submit_cl_ioctl,
16 	    TP_PROTO(struct drm_device *dev, u32 ct1qba, u32 ct1qea),
17 	    TP_ARGS(dev, ct1qba, ct1qea),
18 
19 	    TP_STRUCT__entry(
20 			     __field(u32, dev)
21 			     __field(u32, ct1qba)
22 			     __field(u32, ct1qea)
23 			     ),
24 
25 	    TP_fast_assign(
26 			   __entry->dev = dev->primary->index;
27 			   __entry->ct1qba = ct1qba;
28 			   __entry->ct1qea = ct1qea;
29 			   ),
30 
31 	    TP_printk("dev=%u, RCL 0x%08x..0x%08x",
32 		      __entry->dev,
33 		      __entry->ct1qba,
34 		      __entry->ct1qea)
35 );
36 
37 TRACE_EVENT(v3d_submit_cl,
38 	    TP_PROTO(struct drm_device *dev, bool is_render,
39 		     uint64_t seqno,
40 		     u32 ctnqba, u32 ctnqea),
41 	    TP_ARGS(dev, is_render, seqno, ctnqba, ctnqea),
42 
43 	    TP_STRUCT__entry(
44 			     __field(u32, dev)
45 			     __field(bool, is_render)
46 			     __field(u64, seqno)
47 			     __field(u32, ctnqba)
48 			     __field(u32, ctnqea)
49 			     ),
50 
51 	    TP_fast_assign(
52 			   __entry->dev = dev->primary->index;
53 			   __entry->is_render = is_render;
54 			   __entry->seqno = seqno;
55 			   __entry->ctnqba = ctnqba;
56 			   __entry->ctnqea = ctnqea;
57 			   ),
58 
59 	    TP_printk("dev=%u, %s, seqno=%llu, 0x%08x..0x%08x",
60 		      __entry->dev,
61 		      __entry->is_render ? "RCL" : "BCL",
62 		      __entry->seqno,
63 		      __entry->ctnqba,
64 		      __entry->ctnqea)
65 );
66 
67 TRACE_EVENT(v3d_bcl_irq,
68 	    TP_PROTO(struct drm_device *dev,
69 		     uint64_t seqno),
70 	    TP_ARGS(dev, seqno),
71 
72 	    TP_STRUCT__entry(
73 			     __field(u32, dev)
74 			     __field(u64, seqno)
75 			     ),
76 
77 	    TP_fast_assign(
78 			   __entry->dev = dev->primary->index;
79 			   __entry->seqno = seqno;
80 			   ),
81 
82 	    TP_printk("dev=%u, seqno=%llu",
83 		      __entry->dev,
84 		      __entry->seqno)
85 );
86 
87 TRACE_EVENT(v3d_rcl_irq,
88 	    TP_PROTO(struct drm_device *dev,
89 		     uint64_t seqno),
90 	    TP_ARGS(dev, seqno),
91 
92 	    TP_STRUCT__entry(
93 			     __field(u32, dev)
94 			     __field(u64, seqno)
95 			     ),
96 
97 	    TP_fast_assign(
98 			   __entry->dev = dev->primary->index;
99 			   __entry->seqno = seqno;
100 			   ),
101 
102 	    TP_printk("dev=%u, seqno=%llu",
103 		      __entry->dev,
104 		      __entry->seqno)
105 );
106 
107 TRACE_EVENT(v3d_tfu_irq,
108 	    TP_PROTO(struct drm_device *dev,
109 		     uint64_t seqno),
110 	    TP_ARGS(dev, seqno),
111 
112 	    TP_STRUCT__entry(
113 			     __field(u32, dev)
114 			     __field(u64, seqno)
115 			     ),
116 
117 	    TP_fast_assign(
118 			   __entry->dev = dev->primary->index;
119 			   __entry->seqno = seqno;
120 			   ),
121 
122 	    TP_printk("dev=%u, seqno=%llu",
123 		      __entry->dev,
124 		      __entry->seqno)
125 );
126 
127 TRACE_EVENT(v3d_submit_tfu_ioctl,
128 	    TP_PROTO(struct drm_device *dev, u32 iia),
129 	    TP_ARGS(dev, iia),
130 
131 	    TP_STRUCT__entry(
132 			     __field(u32, dev)
133 			     __field(u32, iia)
134 			     ),
135 
136 	    TP_fast_assign(
137 			   __entry->dev = dev->primary->index;
138 			   __entry->iia = iia;
139 			   ),
140 
141 	    TP_printk("dev=%u, IIA 0x%08x",
142 		      __entry->dev,
143 		      __entry->iia)
144 );
145 
146 TRACE_EVENT(v3d_submit_tfu,
147 	    TP_PROTO(struct drm_device *dev,
148 		     uint64_t seqno),
149 	    TP_ARGS(dev, seqno),
150 
151 	    TP_STRUCT__entry(
152 			     __field(u32, dev)
153 			     __field(u64, seqno)
154 			     ),
155 
156 	    TP_fast_assign(
157 			   __entry->dev = dev->primary->index;
158 			   __entry->seqno = seqno;
159 			   ),
160 
161 	    TP_printk("dev=%u, seqno=%llu",
162 		      __entry->dev,
163 		      __entry->seqno)
164 );
165 
166 TRACE_EVENT(v3d_reset_begin,
167 	    TP_PROTO(struct drm_device *dev),
168 	    TP_ARGS(dev),
169 
170 	    TP_STRUCT__entry(
171 			     __field(u32, dev)
172 			     ),
173 
174 	    TP_fast_assign(
175 			   __entry->dev = dev->primary->index;
176 			   ),
177 
178 	    TP_printk("dev=%u",
179 		      __entry->dev)
180 );
181 
182 TRACE_EVENT(v3d_reset_end,
183 	    TP_PROTO(struct drm_device *dev),
184 	    TP_ARGS(dev),
185 
186 	    TP_STRUCT__entry(
187 			     __field(u32, dev)
188 			     ),
189 
190 	    TP_fast_assign(
191 			   __entry->dev = dev->primary->index;
192 			   ),
193 
194 	    TP_printk("dev=%u",
195 		      __entry->dev)
196 );
197 
198 #endif /* _V3D_TRACE_H_ */
199 
200 /* This part must be outside protection */
201 #undef TRACE_INCLUDE_PATH
202 #define TRACE_INCLUDE_PATH .
203 #include <trace/define_trace.h>
204