blob: b57647e582d4f019bc0e1abbff24ff0d48787b26 [file] [log] [blame]
Alex Deucherd38ceaf2015-04-20 16:55:21 -04001#if !defined(_AMDGPU_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
2#define _AMDGPU_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 amdgpu
12#define TRACE_SYSTEM_STRING __stringify(TRACE_SYSTEM)
13#define TRACE_INCLUDE_FILE amdgpu_trace
14
15TRACE_EVENT(amdgpu_bo_create,
16 TP_PROTO(struct amdgpu_bo *bo),
17 TP_ARGS(bo),
18 TP_STRUCT__entry(
19 __field(struct amdgpu_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
30TRACE_EVENT(amdgpu_cs,
31 TP_PROTO(struct amdgpu_cs_parser *p, int i),
32 TP_ARGS(p, i),
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->ibs[i].ring->idx;
41 __entry->dw = p->ibs[i].length_dw;
42 __entry->fences = amdgpu_fence_count_emitted(
43 p->ibs[i].ring);
44 ),
45 TP_printk("ring=%u, dw=%u, fences=%u",
46 __entry->ring, __entry->dw,
47 __entry->fences)
48);
49
50TRACE_EVENT(amdgpu_vm_grab_id,
51 TP_PROTO(unsigned vmid, int ring),
52 TP_ARGS(vmid, ring),
53 TP_STRUCT__entry(
54 __field(u32, vmid)
55 __field(u32, ring)
56 ),
57
58 TP_fast_assign(
59 __entry->vmid = vmid;
60 __entry->ring = ring;
61 ),
62 TP_printk("vmid=%u, ring=%u", __entry->vmid, __entry->ring)
63);
64
65TRACE_EVENT(amdgpu_vm_bo_update,
66 TP_PROTO(struct amdgpu_bo_va_mapping *mapping),
67 TP_ARGS(mapping),
68 TP_STRUCT__entry(
69 __field(u64, soffset)
70 __field(u64, eoffset)
71 __field(u32, flags)
72 ),
73
74 TP_fast_assign(
75 __entry->soffset = mapping->it.start;
76 __entry->eoffset = mapping->it.last + 1;
77 __entry->flags = mapping->flags;
78 ),
79 TP_printk("soffs=%010llx, eoffs=%010llx, flags=%08x",
80 __entry->soffset, __entry->eoffset, __entry->flags)
81);
82
83TRACE_EVENT(amdgpu_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),
87 TP_STRUCT__entry(
88 __field(u64, pe)
89 __field(u64, addr)
90 __field(u32, count)
91 __field(u32, incr)
92 __field(u32, flags)
93 ),
94
95 TP_fast_assign(
96 __entry->pe = pe;
97 __entry->addr = addr;
98 __entry->count = count;
99 __entry->incr = incr;
100 __entry->flags = flags;
101 ),
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)
105);
106
107TRACE_EVENT(amdgpu_vm_flush,
108 TP_PROTO(uint64_t pd_addr, unsigned ring, unsigned id),
109 TP_ARGS(pd_addr, ring, id),
110 TP_STRUCT__entry(
111 __field(u64, pd_addr)
112 __field(u32, ring)
113 __field(u32, id)
114 ),
115
116 TP_fast_assign(
117 __entry->pd_addr = pd_addr;
118 __entry->ring = ring;
119 __entry->id = id;
120 ),
121 TP_printk("pd_addr=%010Lx, ring=%u, id=%u",
122 __entry->pd_addr, __entry->ring, __entry->id)
123);
124
125DECLARE_EVENT_CLASS(amdgpu_fence_request,
126
127 TP_PROTO(struct drm_device *dev, int ring, u32 seqno),
128
129 TP_ARGS(dev, ring, seqno),
130
131 TP_STRUCT__entry(
132 __field(u32, dev)
133 __field(int, ring)
134 __field(u32, seqno)
135 ),
136
137 TP_fast_assign(
138 __entry->dev = dev->primary->index;
139 __entry->ring = ring;
140 __entry->seqno = seqno;
141 ),
142
143 TP_printk("dev=%u, ring=%d, seqno=%u",
144 __entry->dev, __entry->ring, __entry->seqno)
145);
146
147DEFINE_EVENT(amdgpu_fence_request, amdgpu_fence_emit,
148
149 TP_PROTO(struct drm_device *dev, int ring, u32 seqno),
150
151 TP_ARGS(dev, ring, seqno)
152);
153
154DEFINE_EVENT(amdgpu_fence_request, amdgpu_fence_wait_begin,
155
156 TP_PROTO(struct drm_device *dev, int ring, u32 seqno),
157
158 TP_ARGS(dev, ring, seqno)
159);
160
161DEFINE_EVENT(amdgpu_fence_request, amdgpu_fence_wait_end,
162
163 TP_PROTO(struct drm_device *dev, int ring, u32 seqno),
164
165 TP_ARGS(dev, ring, seqno)
166);
167
168DECLARE_EVENT_CLASS(amdgpu_semaphore_request,
169
170 TP_PROTO(int ring, struct amdgpu_semaphore *sem),
171
172 TP_ARGS(ring, sem),
173
174 TP_STRUCT__entry(
175 __field(int, ring)
176 __field(signed, waiters)
177 __field(uint64_t, gpu_addr)
178 ),
179
180 TP_fast_assign(
181 __entry->ring = ring;
182 __entry->waiters = sem->waiters;
183 __entry->gpu_addr = sem->gpu_addr;
184 ),
185
186 TP_printk("ring=%u, waiters=%d, addr=%010Lx", __entry->ring,
187 __entry->waiters, __entry->gpu_addr)
188);
189
190DEFINE_EVENT(amdgpu_semaphore_request, amdgpu_semaphore_signale,
191
192 TP_PROTO(int ring, struct amdgpu_semaphore *sem),
193
194 TP_ARGS(ring, sem)
195);
196
197DEFINE_EVENT(amdgpu_semaphore_request, amdgpu_semaphore_wait,
198
199 TP_PROTO(int ring, struct amdgpu_semaphore *sem),
200
201 TP_ARGS(ring, sem)
202);
203
204#endif
205
206/* This part must be outside protection */
207#undef TRACE_INCLUDE_PATH
208#define TRACE_INCLUDE_PATH .
209#include <trace/define_trace.h>