xref: /linux/drivers/gpu/drm/v3d/v3d_trace.h (revision c532de5a67a70f8533d495f8f2aaa9a0491c3ad0)
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_csd_irq,
128 	    TP_PROTO(struct drm_device *dev,
129 		     uint64_t seqno),
130 	    TP_ARGS(dev, seqno),
131 
132 	    TP_STRUCT__entry(
133 			     __field(u32, dev)
134 			     __field(u64, seqno)
135 			     ),
136 
137 	    TP_fast_assign(
138 			   __entry->dev = dev->primary->index;
139 			   __entry->seqno = seqno;
140 			   ),
141 
142 	    TP_printk("dev=%u, seqno=%llu",
143 		      __entry->dev,
144 		      __entry->seqno)
145 );
146 
147 TRACE_EVENT(v3d_submit_tfu_ioctl,
148 	    TP_PROTO(struct drm_device *dev, u32 iia),
149 	    TP_ARGS(dev, iia),
150 
151 	    TP_STRUCT__entry(
152 			     __field(u32, dev)
153 			     __field(u32, iia)
154 			     ),
155 
156 	    TP_fast_assign(
157 			   __entry->dev = dev->primary->index;
158 			   __entry->iia = iia;
159 			   ),
160 
161 	    TP_printk("dev=%u, IIA 0x%08x",
162 		      __entry->dev,
163 		      __entry->iia)
164 );
165 
166 TRACE_EVENT(v3d_submit_tfu,
167 	    TP_PROTO(struct drm_device *dev,
168 		     uint64_t seqno),
169 	    TP_ARGS(dev, seqno),
170 
171 	    TP_STRUCT__entry(
172 			     __field(u32, dev)
173 			     __field(u64, seqno)
174 			     ),
175 
176 	    TP_fast_assign(
177 			   __entry->dev = dev->primary->index;
178 			   __entry->seqno = seqno;
179 			   ),
180 
181 	    TP_printk("dev=%u, seqno=%llu",
182 		      __entry->dev,
183 		      __entry->seqno)
184 );
185 
186 TRACE_EVENT(v3d_submit_csd_ioctl,
187 	    TP_PROTO(struct drm_device *dev, u32 cfg5, u32 cfg6),
188 	    TP_ARGS(dev, cfg5, cfg6),
189 
190 	    TP_STRUCT__entry(
191 			     __field(u32, dev)
192 			     __field(u32, cfg5)
193 			     __field(u32, cfg6)
194 			     ),
195 
196 	    TP_fast_assign(
197 			   __entry->dev = dev->primary->index;
198 			   __entry->cfg5 = cfg5;
199 			   __entry->cfg6 = cfg6;
200 			   ),
201 
202 	    TP_printk("dev=%u, CFG5 0x%08x, CFG6 0x%08x",
203 		      __entry->dev,
204 		      __entry->cfg5,
205 		      __entry->cfg6)
206 );
207 
208 TRACE_EVENT(v3d_submit_csd,
209 	    TP_PROTO(struct drm_device *dev,
210 		     uint64_t seqno),
211 	    TP_ARGS(dev, seqno),
212 
213 	    TP_STRUCT__entry(
214 			     __field(u32, dev)
215 			     __field(u64, seqno)
216 			     ),
217 
218 	    TP_fast_assign(
219 			   __entry->dev = dev->primary->index;
220 			   __entry->seqno = seqno;
221 			   ),
222 
223 	    TP_printk("dev=%u, seqno=%llu",
224 		      __entry->dev,
225 		      __entry->seqno)
226 );
227 
228 TRACE_EVENT(v3d_submit_cpu_ioctl,
229 	    TP_PROTO(struct drm_device *dev, enum v3d_cpu_job_type job_type),
230 	    TP_ARGS(dev, job_type),
231 
232 	    TP_STRUCT__entry(
233 			     __field(u32, dev)
234 			     __field(enum v3d_cpu_job_type, job_type)
235 			     ),
236 
237 	    TP_fast_assign(
238 			   __entry->dev = dev->primary->index;
239 			   __entry->job_type = job_type;
240 			   ),
241 
242 	    TP_printk("dev=%u, job_type=%d",
243 		      __entry->dev,
244 		      __entry->job_type)
245 );
246 
247 TRACE_EVENT(v3d_cpu_job_begin,
248 	    TP_PROTO(struct drm_device *dev, enum v3d_cpu_job_type job_type),
249 	    TP_ARGS(dev, job_type),
250 
251 	    TP_STRUCT__entry(
252 			     __field(u32, dev)
253 			     __field(enum v3d_cpu_job_type, job_type)
254 			     ),
255 
256 	    TP_fast_assign(
257 			   __entry->dev = dev->primary->index;
258 			   __entry->job_type = job_type;
259 			   ),
260 
261 	    TP_printk("dev=%u, job_type=%d",
262 		      __entry->dev,
263 		      __entry->job_type)
264 );
265 
266 TRACE_EVENT(v3d_cpu_job_end,
267 	    TP_PROTO(struct drm_device *dev, enum v3d_cpu_job_type job_type),
268 	    TP_ARGS(dev, job_type),
269 
270 	    TP_STRUCT__entry(
271 			     __field(u32, dev)
272 			     __field(enum v3d_cpu_job_type, job_type)
273 			     ),
274 
275 	    TP_fast_assign(
276 			   __entry->dev = dev->primary->index;
277 			   __entry->job_type = job_type;
278 			   ),
279 
280 	    TP_printk("dev=%u, job_type=%d",
281 		      __entry->dev,
282 		      __entry->job_type)
283 );
284 
285 TRACE_EVENT(v3d_cache_clean_begin,
286 	    TP_PROTO(struct drm_device *dev),
287 	    TP_ARGS(dev),
288 
289 	    TP_STRUCT__entry(
290 			     __field(u32, dev)
291 			     ),
292 
293 	    TP_fast_assign(
294 			   __entry->dev = dev->primary->index;
295 			   ),
296 
297 	    TP_printk("dev=%u",
298 		      __entry->dev)
299 );
300 
301 TRACE_EVENT(v3d_cache_clean_end,
302 	    TP_PROTO(struct drm_device *dev),
303 	    TP_ARGS(dev),
304 
305 	    TP_STRUCT__entry(
306 			     __field(u32, dev)
307 			     ),
308 
309 	    TP_fast_assign(
310 			   __entry->dev = dev->primary->index;
311 			   ),
312 
313 	    TP_printk("dev=%u",
314 		      __entry->dev)
315 );
316 
317 TRACE_EVENT(v3d_reset_begin,
318 	    TP_PROTO(struct drm_device *dev),
319 	    TP_ARGS(dev),
320 
321 	    TP_STRUCT__entry(
322 			     __field(u32, dev)
323 			     ),
324 
325 	    TP_fast_assign(
326 			   __entry->dev = dev->primary->index;
327 			   ),
328 
329 	    TP_printk("dev=%u",
330 		      __entry->dev)
331 );
332 
333 TRACE_EVENT(v3d_reset_end,
334 	    TP_PROTO(struct drm_device *dev),
335 	    TP_ARGS(dev),
336 
337 	    TP_STRUCT__entry(
338 			     __field(u32, dev)
339 			     ),
340 
341 	    TP_fast_assign(
342 			   __entry->dev = dev->primary->index;
343 			   ),
344 
345 	    TP_printk("dev=%u",
346 		      __entry->dev)
347 );
348 
349 #endif /* _V3D_TRACE_H_ */
350 
351 /* This part must be outside protection */
352 #undef TRACE_INCLUDE_PATH
353 #define TRACE_INCLUDE_PATH .
354 #include <trace/define_trace.h>
355