Full support for Ginger Console
[linux-ginger.git] / drivers / gpu / drm / i915 / i915_trace.h
blob01840d9bc38fa8b58401841caf795301beb8b795
1 #if !defined(_I915_TRACE_H_) || defined(TRACE_HEADER_MULTI_READ)
2 #define _I915_TRACE_H_
4 #include <linux/stringify.h>
5 #include <linux/types.h>
6 #include <linux/tracepoint.h>
8 #include <drm/drmP.h>
10 #undef TRACE_SYSTEM
11 #define TRACE_SYSTEM i915
12 #define TRACE_SYSTEM_STRING __stringify(TRACE_SYSTEM)
13 #define TRACE_INCLUDE_FILE i915_trace
15 /* object tracking */
17 TRACE_EVENT(i915_gem_object_create,
19 TP_PROTO(struct drm_gem_object *obj),
21 TP_ARGS(obj),
23 TP_STRUCT__entry(
24 __field(struct drm_gem_object *, obj)
25 __field(u32, size)
28 TP_fast_assign(
29 __entry->obj = obj;
30 __entry->size = obj->size;
33 TP_printk("obj=%p, size=%u", __entry->obj, __entry->size)
36 TRACE_EVENT(i915_gem_object_bind,
38 TP_PROTO(struct drm_gem_object *obj, u32 gtt_offset),
40 TP_ARGS(obj, gtt_offset),
42 TP_STRUCT__entry(
43 __field(struct drm_gem_object *, obj)
44 __field(u32, gtt_offset)
47 TP_fast_assign(
48 __entry->obj = obj;
49 __entry->gtt_offset = gtt_offset;
52 TP_printk("obj=%p, gtt_offset=%08x",
53 __entry->obj, __entry->gtt_offset)
56 TRACE_EVENT(i915_gem_object_clflush,
58 TP_PROTO(struct drm_gem_object *obj),
60 TP_ARGS(obj),
62 TP_STRUCT__entry(
63 __field(struct drm_gem_object *, obj)
66 TP_fast_assign(
67 __entry->obj = obj;
70 TP_printk("obj=%p", __entry->obj)
73 TRACE_EVENT(i915_gem_object_change_domain,
75 TP_PROTO(struct drm_gem_object *obj, uint32_t old_read_domains, uint32_t old_write_domain),
77 TP_ARGS(obj, old_read_domains, old_write_domain),
79 TP_STRUCT__entry(
80 __field(struct drm_gem_object *, obj)
81 __field(u32, read_domains)
82 __field(u32, write_domain)
85 TP_fast_assign(
86 __entry->obj = obj;
87 __entry->read_domains = obj->read_domains | (old_read_domains << 16);
88 __entry->write_domain = obj->write_domain | (old_write_domain << 16);
91 TP_printk("obj=%p, read=%04x, write=%04x",
92 __entry->obj,
93 __entry->read_domains, __entry->write_domain)
96 TRACE_EVENT(i915_gem_object_get_fence,
98 TP_PROTO(struct drm_gem_object *obj, int fence, int tiling_mode),
100 TP_ARGS(obj, fence, tiling_mode),
102 TP_STRUCT__entry(
103 __field(struct drm_gem_object *, obj)
104 __field(int, fence)
105 __field(int, tiling_mode)
108 TP_fast_assign(
109 __entry->obj = obj;
110 __entry->fence = fence;
111 __entry->tiling_mode = tiling_mode;
114 TP_printk("obj=%p, fence=%d, tiling=%d",
115 __entry->obj, __entry->fence, __entry->tiling_mode)
118 TRACE_EVENT(i915_gem_object_unbind,
120 TP_PROTO(struct drm_gem_object *obj),
122 TP_ARGS(obj),
124 TP_STRUCT__entry(
125 __field(struct drm_gem_object *, obj)
128 TP_fast_assign(
129 __entry->obj = obj;
132 TP_printk("obj=%p", __entry->obj)
135 TRACE_EVENT(i915_gem_object_destroy,
137 TP_PROTO(struct drm_gem_object *obj),
139 TP_ARGS(obj),
141 TP_STRUCT__entry(
142 __field(struct drm_gem_object *, obj)
145 TP_fast_assign(
146 __entry->obj = obj;
149 TP_printk("obj=%p", __entry->obj)
152 /* batch tracing */
154 TRACE_EVENT(i915_gem_request_submit,
156 TP_PROTO(struct drm_device *dev, u32 seqno),
158 TP_ARGS(dev, seqno),
160 TP_STRUCT__entry(
161 __field(u32, dev)
162 __field(u32, seqno)
165 TP_fast_assign(
166 __entry->dev = dev->primary->index;
167 __entry->seqno = seqno;
168 i915_trace_irq_get(dev, seqno);
171 TP_printk("dev=%u, seqno=%u", __entry->dev, __entry->seqno)
174 TRACE_EVENT(i915_gem_request_flush,
176 TP_PROTO(struct drm_device *dev, u32 seqno,
177 u32 flush_domains, u32 invalidate_domains),
179 TP_ARGS(dev, seqno, flush_domains, invalidate_domains),
181 TP_STRUCT__entry(
182 __field(u32, dev)
183 __field(u32, seqno)
184 __field(u32, flush_domains)
185 __field(u32, invalidate_domains)
188 TP_fast_assign(
189 __entry->dev = dev->primary->index;
190 __entry->seqno = seqno;
191 __entry->flush_domains = flush_domains;
192 __entry->invalidate_domains = invalidate_domains;
195 TP_printk("dev=%u, seqno=%u, flush=%04x, invalidate=%04x",
196 __entry->dev, __entry->seqno,
197 __entry->flush_domains, __entry->invalidate_domains)
201 TRACE_EVENT(i915_gem_request_complete,
203 TP_PROTO(struct drm_device *dev, u32 seqno),
205 TP_ARGS(dev, seqno),
207 TP_STRUCT__entry(
208 __field(u32, dev)
209 __field(u32, seqno)
212 TP_fast_assign(
213 __entry->dev = dev->primary->index;
214 __entry->seqno = seqno;
217 TP_printk("dev=%u, seqno=%u", __entry->dev, __entry->seqno)
220 TRACE_EVENT(i915_gem_request_retire,
222 TP_PROTO(struct drm_device *dev, u32 seqno),
224 TP_ARGS(dev, seqno),
226 TP_STRUCT__entry(
227 __field(u32, dev)
228 __field(u32, seqno)
231 TP_fast_assign(
232 __entry->dev = dev->primary->index;
233 __entry->seqno = seqno;
236 TP_printk("dev=%u, seqno=%u", __entry->dev, __entry->seqno)
239 TRACE_EVENT(i915_gem_request_wait_begin,
241 TP_PROTO(struct drm_device *dev, u32 seqno),
243 TP_ARGS(dev, seqno),
245 TP_STRUCT__entry(
246 __field(u32, dev)
247 __field(u32, seqno)
250 TP_fast_assign(
251 __entry->dev = dev->primary->index;
252 __entry->seqno = seqno;
255 TP_printk("dev=%u, seqno=%u", __entry->dev, __entry->seqno)
258 TRACE_EVENT(i915_gem_request_wait_end,
260 TP_PROTO(struct drm_device *dev, u32 seqno),
262 TP_ARGS(dev, seqno),
264 TP_STRUCT__entry(
265 __field(u32, dev)
266 __field(u32, seqno)
269 TP_fast_assign(
270 __entry->dev = dev->primary->index;
271 __entry->seqno = seqno;
274 TP_printk("dev=%u, seqno=%u", __entry->dev, __entry->seqno)
277 TRACE_EVENT(i915_ring_wait_begin,
279 TP_PROTO(struct drm_device *dev),
281 TP_ARGS(dev),
283 TP_STRUCT__entry(
284 __field(u32, dev)
287 TP_fast_assign(
288 __entry->dev = dev->primary->index;
291 TP_printk("dev=%u", __entry->dev)
294 TRACE_EVENT(i915_ring_wait_end,
296 TP_PROTO(struct drm_device *dev),
298 TP_ARGS(dev),
300 TP_STRUCT__entry(
301 __field(u32, dev)
304 TP_fast_assign(
305 __entry->dev = dev->primary->index;
308 TP_printk("dev=%u", __entry->dev)
311 #endif /* _I915_TRACE_H_ */
313 /* This part must be outside protection */
314 #undef TRACE_INCLUDE_PATH
315 #define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/i915
316 #include <trace/define_trace.h>