1 /* SPDX-License-Identifier: MIT */
2 #if !defined(_RADEON_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
3 #define _RADEON_TRACE_H_
5 #include <linux/stringify.h>
6 #include <linux/types.h>
7 #include <linux/tracepoint.h>
12 #define TRACE_SYSTEM radeon
13 #define TRACE_INCLUDE_FILE radeon_trace
15 TRACE_EVENT(radeon_bo_create
,
16 TP_PROTO(struct radeon_bo
*bo
),
19 __field(struct radeon_bo
*, bo
)
25 __entry
->pages
= bo
->tbo
.num_pages
;
27 TP_printk("bo=%p, pages=%u", __entry
->bo
, __entry
->pages
)
30 TRACE_EVENT(radeon_cs
,
31 TP_PROTO(struct radeon_cs_parser
*p
),
40 __entry
->ring
= p
->ring
;
41 __entry
->dw
= p
->chunk_ib
->length_dw
;
42 __entry
->fences
= radeon_fence_count_emitted(
45 TP_printk("ring=%u, dw=%u, fences=%u",
46 __entry
->ring
, __entry
->dw
,
50 TRACE_EVENT(radeon_vm_grab_id
,
51 TP_PROTO(unsigned vmid
, int ring
),
62 TP_printk("vmid=%u, ring=%u", __entry
->vmid
, __entry
->ring
)
65 TRACE_EVENT(radeon_vm_bo_update
,
66 TP_PROTO(struct radeon_bo_va
*bo_va
),
75 __entry
->soffset
= bo_va
->it
.start
;
76 __entry
->eoffset
= bo_va
->it
.last
+ 1;
77 __entry
->flags
= bo_va
->flags
;
79 TP_printk("soffs=%010llx, eoffs=%010llx, flags=%08x",
80 __entry
->soffset
, __entry
->eoffset
, __entry
->flags
)
83 TRACE_EVENT(radeon_vm_set_page
,
84 TP_PROTO(uint64_t pe
, uint64_t addr
, unsigned count
,
85 uint32_t incr
, uint32_t flags
),
86 TP_ARGS(pe
, addr
, count
, incr
, flags
),
98 __entry
->count
= count
;
100 __entry
->flags
= flags
;
102 TP_printk("pe=%010Lx, addr=%010Lx, incr=%u, flags=%08x, count=%u",
103 __entry
->pe
, __entry
->addr
, __entry
->incr
,
104 __entry
->flags
, __entry
->count
)
107 TRACE_EVENT(radeon_vm_flush
,
108 TP_PROTO(uint64_t pd_addr
, unsigned ring
, unsigned id
),
109 TP_ARGS(pd_addr
, ring
, id
),
111 __field(u64
, pd_addr
)
117 __entry
->pd_addr
= pd_addr
;
118 __entry
->ring
= ring
;
121 TP_printk("pd_addr=%010Lx, ring=%u, id=%u",
122 __entry
->pd_addr
, __entry
->ring
, __entry
->id
)
125 DECLARE_EVENT_CLASS(radeon_fence_request
,
127 TP_PROTO(struct drm_device
*dev
, int ring
, u32 seqno
),
129 TP_ARGS(dev
, ring
, seqno
),
138 __entry
->dev
= dev
->primary
->index
;
139 __entry
->ring
= ring
;
140 __entry
->seqno
= seqno
;
143 TP_printk("dev=%u, ring=%d, seqno=%u",
144 __entry
->dev
, __entry
->ring
, __entry
->seqno
)
147 DEFINE_EVENT(radeon_fence_request
, radeon_fence_emit
,
149 TP_PROTO(struct drm_device
*dev
, int ring
, u32 seqno
),
151 TP_ARGS(dev
, ring
, seqno
)
154 DEFINE_EVENT(radeon_fence_request
, radeon_fence_wait_begin
,
156 TP_PROTO(struct drm_device
*dev
, int ring
, u32 seqno
),
158 TP_ARGS(dev
, ring
, seqno
)
161 DEFINE_EVENT(radeon_fence_request
, radeon_fence_wait_end
,
163 TP_PROTO(struct drm_device
*dev
, int ring
, u32 seqno
),
165 TP_ARGS(dev
, ring
, seqno
)
168 DECLARE_EVENT_CLASS(radeon_semaphore_request
,
170 TP_PROTO(int ring
, struct radeon_semaphore
*sem
),
176 __field(signed, waiters
)
177 __field(uint64_t, gpu_addr
)
181 __entry
->ring
= ring
;
182 __entry
->waiters
= sem
->waiters
;
183 __entry
->gpu_addr
= sem
->gpu_addr
;
186 TP_printk("ring=%u, waiters=%d, addr=%010Lx", __entry
->ring
,
187 __entry
->waiters
, __entry
->gpu_addr
)
190 DEFINE_EVENT(radeon_semaphore_request
, radeon_semaphore_signale
,
192 TP_PROTO(int ring
, struct radeon_semaphore
*sem
),
197 DEFINE_EVENT(radeon_semaphore_request
, radeon_semaphore_wait
,
199 TP_PROTO(int ring
, struct radeon_semaphore
*sem
),
206 /* This part must be outside protection */
207 #undef TRACE_INCLUDE_PATH
208 #define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/radeon
209 #include <trace/define_trace.h>