1 #if !defined(_RADEON_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
2 #define _RADEON_TRACE_H_
3 
4 #include <linux/stringify.h>
5 #include <linux/types.h>
6 #include <linux/tracepoint.h>
7 
8 #include <drm/drmP.h>
9 
10 #undef TRACE_SYSTEM
11 #define TRACE_SYSTEM radeon
12 #define TRACE_SYSTEM_STRING __stringify(TRACE_SYSTEM)
13 #define TRACE_INCLUDE_FILE radeon_trace
14 
15 TRACE_EVENT(radeon_bo_create,
16 	    TP_PROTO(struct radeon_bo *bo),
17 	    TP_ARGS(bo),
18 	    TP_STRUCT__entry(
19 			     __field(struct radeon_bo *, bo)
20 			     __field(u32, pages)
21 			     ),
22 
23 	    TP_fast_assign(
24 			   __entry->bo = bo;
25 			   __entry->pages = bo->tbo.num_pages;
26 			   ),
27 	    TP_printk("bo=%p, pages=%u", __entry->bo, __entry->pages)
28 );
29 
30 TRACE_EVENT(radeon_cs,
31 	    TP_PROTO(struct radeon_cs_parser *p),
32 	    TP_ARGS(p),
33 	    TP_STRUCT__entry(
34 			     __field(u32, ring)
35 			     __field(u32, dw)
36 			     __field(u32, fences)
37 			     ),
38 
39 	    TP_fast_assign(
40 			   __entry->ring = p->ring;
41 			   __entry->dw = p->chunks[p->chunk_ib_idx].length_dw;
42 			   __entry->fences = radeon_fence_count_emitted(
43 				p->rdev, p->ring);
44 			   ),
45 	    TP_printk("ring=%u, dw=%u, fences=%u",
46 		      __entry->ring, __entry->dw,
47 		      __entry->fences)
48 );
49 
50 DECLARE_EVENT_CLASS(radeon_fence_request,
51 
52 	    TP_PROTO(struct drm_device *dev, u32 seqno),
53 
54 	    TP_ARGS(dev, seqno),
55 
56 	    TP_STRUCT__entry(
57 			     __field(u32, dev)
58 			     __field(u32, seqno)
59 			     ),
60 
61 	    TP_fast_assign(
62 			   __entry->dev = dev->primary->index;
63 			   __entry->seqno = seqno;
64 			   ),
65 
66 	    TP_printk("dev=%u, seqno=%u", __entry->dev, __entry->seqno)
67 );
68 
69 DEFINE_EVENT(radeon_fence_request, radeon_fence_emit,
70 
71 	    TP_PROTO(struct drm_device *dev, u32 seqno),
72 
73 	    TP_ARGS(dev, seqno)
74 );
75 
76 DEFINE_EVENT(radeon_fence_request, radeon_fence_wait_begin,
77 
78 	    TP_PROTO(struct drm_device *dev, u32 seqno),
79 
80 	    TP_ARGS(dev, seqno)
81 );
82 
83 DEFINE_EVENT(radeon_fence_request, radeon_fence_wait_end,
84 
85 	    TP_PROTO(struct drm_device *dev, u32 seqno),
86 
87 	    TP_ARGS(dev, seqno)
88 );
89 
90 #endif
91 
92 /* This part must be outside protection */
93 #undef TRACE_INCLUDE_PATH
94 #define TRACE_INCLUDE_PATH .
95 #include <trace/define_trace.h>
96