xref: /openbmc/linux/drivers/gpu/drm/drm_trace.h (revision b830f94f)
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),
17 	    TP_ARGS(crtc, seq),
18 	    TP_STRUCT__entry(
19 		    __field(int, crtc)
20 		    __field(unsigned int, seq)
21 		    ),
22 	    TP_fast_assign(
23 		    __entry->crtc = crtc;
24 		    __entry->seq = seq;
25 		    ),
26 	    TP_printk("crtc=%d, seq=%u", __entry->crtc, __entry->seq)
27 );
28 
29 TRACE_EVENT(drm_vblank_event_queued,
30 	    TP_PROTO(struct drm_file *file, int crtc, unsigned int seq),
31 	    TP_ARGS(file, crtc, seq),
32 	    TP_STRUCT__entry(
33 		    __field(struct drm_file *, file)
34 		    __field(int, crtc)
35 		    __field(unsigned int, seq)
36 		    ),
37 	    TP_fast_assign(
38 		    __entry->file = file;
39 		    __entry->crtc = crtc;
40 		    __entry->seq = seq;
41 		    ),
42 	    TP_printk("file=%p, crtc=%d, seq=%u", __entry->file, __entry->crtc, \
43 		      __entry->seq)
44 );
45 
46 TRACE_EVENT(drm_vblank_event_delivered,
47 	    TP_PROTO(struct drm_file *file, int crtc, unsigned int seq),
48 	    TP_ARGS(file, crtc, seq),
49 	    TP_STRUCT__entry(
50 		    __field(struct drm_file *, file)
51 		    __field(int, crtc)
52 		    __field(unsigned int, seq)
53 		    ),
54 	    TP_fast_assign(
55 		    __entry->file = file;
56 		    __entry->crtc = crtc;
57 		    __entry->seq = seq;
58 		    ),
59 	    TP_printk("file=%p, crtc=%d, seq=%u", __entry->file, __entry->crtc, \
60 		      __entry->seq)
61 );
62 
63 #endif /* _DRM_TRACE_H_ */
64 
65 /* This part must be outside protection */
66 #undef TRACE_INCLUDE_PATH
67 #define TRACE_INCLUDE_PATH ../../drivers/gpu/drm
68 #include <trace/define_trace.h>
69