xref: /openbmc/linux/drivers/gpu/drm/drm_trace.h (revision fb574682)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #if !defined(_DRM_TRACE_H_) || defined(TRACE_HEADER_MULTI_READ)
3 #define _DRM_TRACE_H_
4 
5 #include <linux/stringify.h>
6 #include <linux/types.h>
7 #include <linux/tracepoint.h>
8 
9 struct drm_file;
10 
11 #undef TRACE_SYSTEM
12 #define TRACE_SYSTEM drm
13 #define TRACE_INCLUDE_FILE drm_trace
14 
15 TRACE_EVENT(drm_vblank_event,
16 	    TP_PROTO(int crtc, unsigned int seq, ktime_t time, bool high_prec),
17 	    TP_ARGS(crtc, seq, time, high_prec),
18 	    TP_STRUCT__entry(
19 		    __field(int, crtc)
20 		    __field(unsigned int, seq)
21 		    __field(ktime_t, time)
22 		    __field(bool, high_prec)
23 		    ),
24 	    TP_fast_assign(
25 		    __entry->crtc = crtc;
26 		    __entry->seq = seq;
27 		    __entry->time = time;
28 		    __entry->high_prec = high_prec;
29 			),
30 	    TP_printk("crtc=%d, seq=%u, time=%lld, high-prec=%s",
31 			__entry->crtc, __entry->seq, __entry->time,
32 			__entry->high_prec ? "true" : "false")
33 );
34 
35 TRACE_EVENT(drm_vblank_event_queued,
36 	    TP_PROTO(struct drm_file *file, int crtc, unsigned int seq),
37 	    TP_ARGS(file, crtc, seq),
38 	    TP_STRUCT__entry(
39 		    __field(struct drm_file *, file)
40 		    __field(int, crtc)
41 		    __field(unsigned int, seq)
42 		    ),
43 	    TP_fast_assign(
44 		    __entry->file = file;
45 		    __entry->crtc = crtc;
46 		    __entry->seq = seq;
47 		    ),
48 	    TP_printk("file=%p, crtc=%d, seq=%u", __entry->file, __entry->crtc, \
49 		      __entry->seq)
50 );
51 
52 TRACE_EVENT(drm_vblank_event_delivered,
53 	    TP_PROTO(struct drm_file *file, int crtc, unsigned int seq),
54 	    TP_ARGS(file, crtc, seq),
55 	    TP_STRUCT__entry(
56 		    __field(struct drm_file *, file)
57 		    __field(int, crtc)
58 		    __field(unsigned int, seq)
59 		    ),
60 	    TP_fast_assign(
61 		    __entry->file = file;
62 		    __entry->crtc = crtc;
63 		    __entry->seq = seq;
64 		    ),
65 	    TP_printk("file=%p, crtc=%d, seq=%u", __entry->file, __entry->crtc, \
66 		      __entry->seq)
67 );
68 
69 #endif /* _DRM_TRACE_H_ */
70 
71 /* This part must be outside protection */
72 #undef TRACE_INCLUDE_PATH
73 #define TRACE_INCLUDE_PATH ../../drivers/gpu/drm
74 #include <trace/define_trace.h>
75