xref: /openbmc/linux/drivers/gpu/drm/v3d/v3d_trace.h (revision 96de2506)
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,
16 	    TP_PROTO(struct drm_device *dev, bool is_render,
17 		     uint64_t seqno,
18 		     u32 ctnqba, u32 ctnqea),
19 	    TP_ARGS(dev, is_render, seqno, ctnqba, ctnqea),
20 
21 	    TP_STRUCT__entry(
22 			     __field(u32, dev)
23 			     __field(bool, is_render)
24 			     __field(u64, seqno)
25 			     __field(u32, ctnqba)
26 			     __field(u32, ctnqea)
27 			     ),
28 
29 	    TP_fast_assign(
30 			   __entry->dev = dev->primary->index;
31 			   __entry->is_render = is_render;
32 			   __entry->seqno = seqno;
33 			   __entry->ctnqba = ctnqba;
34 			   __entry->ctnqea = ctnqea;
35 			   ),
36 
37 	    TP_printk("dev=%u, %s, seqno=%llu, 0x%08x..0x%08x",
38 		      __entry->dev,
39 		      __entry->is_render ? "RCL" : "BCL",
40 		      __entry->seqno,
41 		      __entry->ctnqba,
42 		      __entry->ctnqea)
43 );
44 
45 TRACE_EVENT(v3d_reset_begin,
46 	    TP_PROTO(struct drm_device *dev),
47 	    TP_ARGS(dev),
48 
49 	    TP_STRUCT__entry(
50 			     __field(u32, dev)
51 			     ),
52 
53 	    TP_fast_assign(
54 			   __entry->dev = dev->primary->index;
55 			   ),
56 
57 	    TP_printk("dev=%u",
58 		      __entry->dev)
59 );
60 
61 TRACE_EVENT(v3d_reset_end,
62 	    TP_PROTO(struct drm_device *dev),
63 	    TP_ARGS(dev),
64 
65 	    TP_STRUCT__entry(
66 			     __field(u32, dev)
67 			     ),
68 
69 	    TP_fast_assign(
70 			   __entry->dev = dev->primary->index;
71 			   ),
72 
73 	    TP_printk("dev=%u",
74 		      __entry->dev)
75 );
76 
77 #endif /* _V3D_TRACE_H_ */
78 
79 /* This part must be outside protection */
80 #undef TRACE_INCLUDE_PATH
81 #define TRACE_INCLUDE_PATH .
82 #include <trace/define_trace.h>
83