blob: 5503f5ab1e986acc36b2f77921f4aef6f0931ab1 [file] [log] [blame]
Chris Wilson1c5d22f2009-08-25 11:15:50 +01001#if !defined(_I915_TRACE_H_) || defined(TRACE_HEADER_MULTI_READ)
2#define _I915_TRACE_H_
3
4#include <linux/stringify.h>
5#include <linux/types.h>
6#include <linux/tracepoint.h>
7
8#include <drm/drmP.h>
Chris Wilson05394f32010-11-08 19:18:58 +00009#include "i915_drv.h"
Ville Syrjälä25ef2842014-04-29 13:35:48 +030010#include "intel_drv.h"
Chris Wilsondb53a302011-02-03 11:57:46 +000011#include "intel_ringbuffer.h"
Chris Wilson1c5d22f2009-08-25 11:15:50 +010012
13#undef TRACE_SYSTEM
14#define TRACE_SYSTEM i915
Chris Wilson1c5d22f2009-08-25 11:15:50 +010015#define TRACE_INCLUDE_FILE i915_trace
16
Ville Syrjäläc137d662017-03-02 19:15:06 +020017/* watermark/fifo updates */
18
Ville Syrjälä53a79152017-03-02 19:15:08 +020019TRACE_EVENT(intel_cpu_fifo_underrun,
20 TP_PROTO(struct drm_i915_private *dev_priv, enum pipe pipe),
21 TP_ARGS(dev_priv, pipe),
22
23 TP_STRUCT__entry(
24 __field(enum pipe, pipe)
25 __field(u32, frame)
26 __field(u32, scanline)
27 ),
28
29 TP_fast_assign(
30 __entry->pipe = pipe;
31 __entry->frame = dev_priv->drm.driver->get_vblank_counter(&dev_priv->drm, pipe);
32 __entry->scanline = intel_get_crtc_scanline(intel_get_crtc_for_pipe(dev_priv, pipe));
33 ),
34
35 TP_printk("pipe %c, frame=%u, scanline=%u",
36 pipe_name(__entry->pipe),
37 __entry->frame, __entry->scanline)
38);
39
40TRACE_EVENT(intel_pch_fifo_underrun,
41 TP_PROTO(struct drm_i915_private *dev_priv, enum transcoder pch_transcoder),
42 TP_ARGS(dev_priv, pch_transcoder),
43
44 TP_STRUCT__entry(
45 __field(enum pipe, pipe)
46 __field(u32, frame)
47 __field(u32, scanline)
48 ),
49
50 TP_fast_assign(
51 enum pipe pipe = (enum pipe)pch_transcoder;
52 __entry->pipe = pipe;
53 __entry->frame = dev_priv->drm.driver->get_vblank_counter(&dev_priv->drm, pipe);
54 __entry->scanline = intel_get_crtc_scanline(intel_get_crtc_for_pipe(dev_priv, pipe));
55 ),
56
57 TP_printk("pch transcoder %c, frame=%u, scanline=%u",
58 pipe_name(__entry->pipe),
59 __entry->frame, __entry->scanline)
60);
61
Ville Syrjälä1489bba2017-03-02 19:15:07 +020062TRACE_EVENT(intel_memory_cxsr,
63 TP_PROTO(struct drm_i915_private *dev_priv, bool old, bool new),
64 TP_ARGS(dev_priv, old, new),
65
66 TP_STRUCT__entry(
67 __array(u32, frame, 3)
68 __array(u32, scanline, 3)
69 __field(bool, old)
70 __field(bool, new)
71 ),
72
73 TP_fast_assign(
74 enum pipe pipe;
75 for_each_pipe(dev_priv, pipe) {
76 __entry->frame[pipe] =
77 dev_priv->drm.driver->get_vblank_counter(&dev_priv->drm, pipe);
78 __entry->scanline[pipe] =
79 intel_get_crtc_scanline(intel_get_crtc_for_pipe(dev_priv, pipe));
80 }
81 __entry->old = old;
82 __entry->new = new;
83 ),
84
85 TP_printk("%s->%s, pipe A: frame=%u, scanline=%u, pipe B: frame=%u, scanline=%u, pipe C: frame=%u, scanline=%u",
86 onoff(__entry->old), onoff(__entry->new),
87 __entry->frame[PIPE_A], __entry->scanline[PIPE_A],
88 __entry->frame[PIPE_B], __entry->scanline[PIPE_B],
89 __entry->frame[PIPE_C], __entry->scanline[PIPE_C])
90);
91
Ville Syrjäläc137d662017-03-02 19:15:06 +020092TRACE_EVENT(vlv_wm,
93 TP_PROTO(struct intel_crtc *crtc, const struct vlv_wm_values *wm),
94 TP_ARGS(crtc, wm),
95
96 TP_STRUCT__entry(
97 __field(enum pipe, pipe)
98 __field(u32, frame)
99 __field(u32, scanline)
100 __field(u32, level)
101 __field(u32, cxsr)
102 __field(u32, primary)
103 __field(u32, sprite0)
104 __field(u32, sprite1)
105 __field(u32, cursor)
106 __field(u32, sr_plane)
107 __field(u32, sr_cursor)
108 ),
109
110 TP_fast_assign(
111 __entry->pipe = crtc->pipe;
112 __entry->frame = crtc->base.dev->driver->get_vblank_counter(crtc->base.dev,
113 crtc->pipe);
114 __entry->scanline = intel_get_crtc_scanline(crtc);
115 __entry->level = wm->level;
116 __entry->cxsr = wm->cxsr;
117 __entry->primary = wm->pipe[crtc->pipe].plane[PLANE_PRIMARY];
118 __entry->sprite0 = wm->pipe[crtc->pipe].plane[PLANE_SPRITE0];
119 __entry->sprite1 = wm->pipe[crtc->pipe].plane[PLANE_SPRITE1];
120 __entry->cursor = wm->pipe[crtc->pipe].plane[PLANE_CURSOR];
121 __entry->sr_plane = wm->sr.plane;
122 __entry->sr_cursor = wm->sr.cursor;
123 ),
124
125 TP_printk("pipe %c, frame=%u, scanline=%u, level=%d, cxsr=%d, wm %d/%d/%d/%d, sr %d/%d",
126 pipe_name(__entry->pipe), __entry->frame,
127 __entry->scanline, __entry->level, __entry->cxsr,
128 __entry->primary, __entry->sprite0, __entry->sprite1, __entry->cursor,
129 __entry->sr_plane, __entry->sr_cursor)
130);
131
132TRACE_EVENT(vlv_fifo_size,
133 TP_PROTO(struct intel_crtc *crtc, u32 sprite0_start, u32 sprite1_start, u32 fifo_size),
134 TP_ARGS(crtc, sprite0_start, sprite1_start, fifo_size),
135
136 TP_STRUCT__entry(
137 __field(enum pipe, pipe)
138 __field(u32, frame)
139 __field(u32, scanline)
140 __field(u32, sprite0_start)
141 __field(u32, sprite1_start)
142 __field(u32, fifo_size)
143 ),
144
145 TP_fast_assign(
146 __entry->pipe = crtc->pipe;
147 __entry->frame = crtc->base.dev->driver->get_vblank_counter(crtc->base.dev,
148 crtc->pipe);
149 __entry->scanline = intel_get_crtc_scanline(crtc);
150 __entry->sprite0_start = sprite0_start;
151 __entry->sprite1_start = sprite1_start;
152 __entry->fifo_size = fifo_size;
153 ),
154
155 TP_printk("pipe %c, frame=%u, scanline=%u, %d/%d/%d",
156 pipe_name(__entry->pipe), __entry->frame,
157 __entry->scanline, __entry->sprite0_start,
158 __entry->sprite1_start, __entry->fifo_size)
159);
160
Ville Syrjälä72259532017-03-02 19:15:05 +0200161/* plane updates */
162
163TRACE_EVENT(intel_update_plane,
164 TP_PROTO(struct drm_plane *plane, struct intel_crtc *crtc),
165 TP_ARGS(plane, crtc),
166
167 TP_STRUCT__entry(
168 __field(enum pipe, pipe)
169 __field(const char *, name)
170 __field(u32, frame)
171 __field(u32, scanline)
172 __array(int, src, 4)
173 __array(int, dst, 4)
174 ),
175
176 TP_fast_assign(
177 __entry->pipe = crtc->pipe;
178 __entry->name = plane->name;
179 __entry->frame = crtc->base.dev->driver->get_vblank_counter(crtc->base.dev,
180 crtc->pipe);
181 __entry->scanline = intel_get_crtc_scanline(crtc);
182 memcpy(__entry->src, &plane->state->src, sizeof(__entry->src));
183 memcpy(__entry->dst, &plane->state->dst, sizeof(__entry->dst));
184 ),
185
186 TP_printk("pipe %c, plane %s, frame=%u, scanline=%u, " DRM_RECT_FP_FMT " -> " DRM_RECT_FMT,
187 pipe_name(__entry->pipe), __entry->name,
188 __entry->frame, __entry->scanline,
189 DRM_RECT_FP_ARG((const struct drm_rect *)__entry->src),
190 DRM_RECT_ARG((const struct drm_rect *)__entry->dst))
191);
192
193TRACE_EVENT(intel_disable_plane,
194 TP_PROTO(struct drm_plane *plane, struct intel_crtc *crtc),
195 TP_ARGS(plane, crtc),
196
197 TP_STRUCT__entry(
198 __field(enum pipe, pipe)
199 __field(const char *, name)
200 __field(u32, frame)
201 __field(u32, scanline)
202 ),
203
204 TP_fast_assign(
205 __entry->pipe = crtc->pipe;
206 __entry->name = plane->name;
207 __entry->frame = crtc->base.dev->driver->get_vblank_counter(crtc->base.dev,
208 crtc->pipe);
209 __entry->scanline = intel_get_crtc_scanline(crtc);
210 ),
211
212 TP_printk("pipe %c, plane %s, frame=%u, scanline=%u",
213 pipe_name(__entry->pipe), __entry->name,
214 __entry->frame, __entry->scanline)
215);
216
Ville Syrjälä25ef2842014-04-29 13:35:48 +0300217/* pipe updates */
218
219TRACE_EVENT(i915_pipe_update_start,
Jesse Barnesd637ce32015-09-17 08:08:32 -0700220 TP_PROTO(struct intel_crtc *crtc),
221 TP_ARGS(crtc),
Ville Syrjälä25ef2842014-04-29 13:35:48 +0300222
223 TP_STRUCT__entry(
224 __field(enum pipe, pipe)
225 __field(u32, frame)
226 __field(u32, scanline)
227 __field(u32, min)
228 __field(u32, max)
229 ),
230
231 TP_fast_assign(
232 __entry->pipe = crtc->pipe;
233 __entry->frame = crtc->base.dev->driver->get_vblank_counter(crtc->base.dev,
234 crtc->pipe);
235 __entry->scanline = intel_get_crtc_scanline(crtc);
Jesse Barnesd637ce32015-09-17 08:08:32 -0700236 __entry->min = crtc->debug.min_vbl;
237 __entry->max = crtc->debug.max_vbl;
Ville Syrjälä25ef2842014-04-29 13:35:48 +0300238 ),
239
240 TP_printk("pipe %c, frame=%u, scanline=%u, min=%u, max=%u",
241 pipe_name(__entry->pipe), __entry->frame,
242 __entry->scanline, __entry->min, __entry->max)
243);
244
245TRACE_EVENT(i915_pipe_update_vblank_evaded,
Jesse Barnesd637ce32015-09-17 08:08:32 -0700246 TP_PROTO(struct intel_crtc *crtc),
247 TP_ARGS(crtc),
Ville Syrjälä25ef2842014-04-29 13:35:48 +0300248
249 TP_STRUCT__entry(
250 __field(enum pipe, pipe)
251 __field(u32, frame)
252 __field(u32, scanline)
253 __field(u32, min)
254 __field(u32, max)
255 ),
256
257 TP_fast_assign(
258 __entry->pipe = crtc->pipe;
Jesse Barnesd637ce32015-09-17 08:08:32 -0700259 __entry->frame = crtc->debug.start_vbl_count;
260 __entry->scanline = crtc->debug.scanline_start;
261 __entry->min = crtc->debug.min_vbl;
262 __entry->max = crtc->debug.max_vbl;
Ville Syrjälä25ef2842014-04-29 13:35:48 +0300263 ),
264
265 TP_printk("pipe %c, frame=%u, scanline=%u, min=%u, max=%u",
266 pipe_name(__entry->pipe), __entry->frame,
267 __entry->scanline, __entry->min, __entry->max)
268);
269
270TRACE_EVENT(i915_pipe_update_end,
Jesse Barnesd637ce32015-09-17 08:08:32 -0700271 TP_PROTO(struct intel_crtc *crtc, u32 frame, int scanline_end),
272 TP_ARGS(crtc, frame, scanline_end),
Ville Syrjälä25ef2842014-04-29 13:35:48 +0300273
274 TP_STRUCT__entry(
275 __field(enum pipe, pipe)
276 __field(u32, frame)
277 __field(u32, scanline)
278 ),
279
280 TP_fast_assign(
281 __entry->pipe = crtc->pipe;
282 __entry->frame = frame;
Jesse Barnesd637ce32015-09-17 08:08:32 -0700283 __entry->scanline = scanline_end;
Ville Syrjälä25ef2842014-04-29 13:35:48 +0300284 ),
285
286 TP_printk("pipe %c, frame=%u, scanline=%u",
287 pipe_name(__entry->pipe), __entry->frame,
288 __entry->scanline)
289);
290
Chris Wilson1c5d22f2009-08-25 11:15:50 +0100291/* object tracking */
292
293TRACE_EVENT(i915_gem_object_create,
Chris Wilson05394f32010-11-08 19:18:58 +0000294 TP_PROTO(struct drm_i915_gem_object *obj),
Chris Wilson1c5d22f2009-08-25 11:15:50 +0100295 TP_ARGS(obj),
296
297 TP_STRUCT__entry(
Chris Wilson05394f32010-11-08 19:18:58 +0000298 __field(struct drm_i915_gem_object *, obj)
Chris Wilson1c5d22f2009-08-25 11:15:50 +0100299 __field(u32, size)
300 ),
301
302 TP_fast_assign(
303 __entry->obj = obj;
Chris Wilson05394f32010-11-08 19:18:58 +0000304 __entry->size = obj->base.size;
Chris Wilson1c5d22f2009-08-25 11:15:50 +0100305 ),
306
307 TP_printk("obj=%p, size=%u", __entry->obj, __entry->size)
308);
309
Chris Wilson3abafa52015-10-01 12:18:26 +0100310TRACE_EVENT(i915_gem_shrink,
311 TP_PROTO(struct drm_i915_private *i915, unsigned long target, unsigned flags),
312 TP_ARGS(i915, target, flags),
313
314 TP_STRUCT__entry(
315 __field(int, dev)
316 __field(unsigned long, target)
317 __field(unsigned, flags)
318 ),
319
320 TP_fast_assign(
Chris Wilson91c8a322016-07-05 10:40:23 +0100321 __entry->dev = i915->drm.primary->index;
Chris Wilson3abafa52015-10-01 12:18:26 +0100322 __entry->target = target;
323 __entry->flags = flags;
324 ),
325
326 TP_printk("dev=%d, target=%lu, flags=%x",
327 __entry->dev, __entry->target, __entry->flags)
328);
329
Ben Widawsky07fe0b12013-07-31 17:00:10 -0700330TRACE_EVENT(i915_vma_bind,
Daniel Vetter1ec9e262014-02-14 14:01:11 +0100331 TP_PROTO(struct i915_vma *vma, unsigned flags),
332 TP_ARGS(vma, flags),
Chris Wilson1c5d22f2009-08-25 11:15:50 +0100333
334 TP_STRUCT__entry(
Chris Wilson05394f32010-11-08 19:18:58 +0000335 __field(struct drm_i915_gem_object *, obj)
Ben Widawsky07fe0b12013-07-31 17:00:10 -0700336 __field(struct i915_address_space *, vm)
Ben Widawsky33938712015-01-22 17:01:23 +0000337 __field(u64, offset)
Chris Wilsondb53a302011-02-03 11:57:46 +0000338 __field(u32, size)
Daniel Vetter1ec9e262014-02-14 14:01:11 +0100339 __field(unsigned, flags)
Chris Wilson1c5d22f2009-08-25 11:15:50 +0100340 ),
341
342 TP_fast_assign(
Ben Widawsky07fe0b12013-07-31 17:00:10 -0700343 __entry->obj = vma->obj;
344 __entry->vm = vma->vm;
345 __entry->offset = vma->node.start;
346 __entry->size = vma->node.size;
Daniel Vetter1ec9e262014-02-14 14:01:11 +0100347 __entry->flags = flags;
Chris Wilson1c5d22f2009-08-25 11:15:50 +0100348 ),
349
Ben Widawsky33938712015-01-22 17:01:23 +0000350 TP_printk("obj=%p, offset=%016llx size=%x%s vm=%p",
Chris Wilsondb53a302011-02-03 11:57:46 +0000351 __entry->obj, __entry->offset, __entry->size,
Daniel Vetter1ec9e262014-02-14 14:01:11 +0100352 __entry->flags & PIN_MAPPABLE ? ", mappable" : "",
Ben Widawsky07fe0b12013-07-31 17:00:10 -0700353 __entry->vm)
Chris Wilson1c5d22f2009-08-25 11:15:50 +0100354);
355
Ben Widawsky07fe0b12013-07-31 17:00:10 -0700356TRACE_EVENT(i915_vma_unbind,
357 TP_PROTO(struct i915_vma *vma),
358 TP_ARGS(vma),
Chris Wilsondb53a302011-02-03 11:57:46 +0000359
360 TP_STRUCT__entry(
361 __field(struct drm_i915_gem_object *, obj)
Ben Widawsky07fe0b12013-07-31 17:00:10 -0700362 __field(struct i915_address_space *, vm)
Ben Widawsky33938712015-01-22 17:01:23 +0000363 __field(u64, offset)
Chris Wilsondb53a302011-02-03 11:57:46 +0000364 __field(u32, size)
365 ),
366
367 TP_fast_assign(
Ben Widawsky07fe0b12013-07-31 17:00:10 -0700368 __entry->obj = vma->obj;
369 __entry->vm = vma->vm;
370 __entry->offset = vma->node.start;
371 __entry->size = vma->node.size;
Chris Wilsondb53a302011-02-03 11:57:46 +0000372 ),
373
Ben Widawsky33938712015-01-22 17:01:23 +0000374 TP_printk("obj=%p, offset=%016llx size=%x vm=%p",
Ben Widawsky07fe0b12013-07-31 17:00:10 -0700375 __entry->obj, __entry->offset, __entry->size, __entry->vm)
Chris Wilsondb53a302011-02-03 11:57:46 +0000376);
377
Chris Wilsondb53a302011-02-03 11:57:46 +0000378TRACE_EVENT(i915_gem_object_pwrite,
379 TP_PROTO(struct drm_i915_gem_object *obj, u32 offset, u32 len),
380 TP_ARGS(obj, offset, len),
381
382 TP_STRUCT__entry(
383 __field(struct drm_i915_gem_object *, obj)
384 __field(u32, offset)
385 __field(u32, len)
386 ),
387
388 TP_fast_assign(
389 __entry->obj = obj;
390 __entry->offset = offset;
391 __entry->len = len;
392 ),
393
394 TP_printk("obj=%p, offset=%u, len=%u",
395 __entry->obj, __entry->offset, __entry->len)
396);
397
398TRACE_EVENT(i915_gem_object_pread,
399 TP_PROTO(struct drm_i915_gem_object *obj, u32 offset, u32 len),
400 TP_ARGS(obj, offset, len),
401
402 TP_STRUCT__entry(
403 __field(struct drm_i915_gem_object *, obj)
404 __field(u32, offset)
405 __field(u32, len)
406 ),
407
408 TP_fast_assign(
409 __entry->obj = obj;
410 __entry->offset = offset;
411 __entry->len = len;
412 ),
413
414 TP_printk("obj=%p, offset=%u, len=%u",
415 __entry->obj, __entry->offset, __entry->len)
416);
417
418TRACE_EVENT(i915_gem_object_fault,
419 TP_PROTO(struct drm_i915_gem_object *obj, u32 index, bool gtt, bool write),
420 TP_ARGS(obj, index, gtt, write),
421
422 TP_STRUCT__entry(
423 __field(struct drm_i915_gem_object *, obj)
424 __field(u32, index)
425 __field(bool, gtt)
426 __field(bool, write)
427 ),
428
429 TP_fast_assign(
430 __entry->obj = obj;
431 __entry->index = index;
432 __entry->gtt = gtt;
433 __entry->write = write;
434 ),
435
436 TP_printk("obj=%p, %s index=%u %s",
437 __entry->obj,
438 __entry->gtt ? "GTT" : "CPU",
439 __entry->index,
440 __entry->write ? ", writable" : "")
Chris Wilson1c5d22f2009-08-25 11:15:50 +0100441);
442
Li Zefan903cf202010-03-11 16:41:45 +0800443DECLARE_EVENT_CLASS(i915_gem_object,
Chris Wilson05394f32010-11-08 19:18:58 +0000444 TP_PROTO(struct drm_i915_gem_object *obj),
Chris Wilson1c5d22f2009-08-25 11:15:50 +0100445 TP_ARGS(obj),
446
447 TP_STRUCT__entry(
Chris Wilson05394f32010-11-08 19:18:58 +0000448 __field(struct drm_i915_gem_object *, obj)
Chris Wilson1c5d22f2009-08-25 11:15:50 +0100449 ),
450
451 TP_fast_assign(
452 __entry->obj = obj;
453 ),
454
455 TP_printk("obj=%p", __entry->obj)
456);
457
Li Zefanf41275e2010-05-24 16:25:44 +0800458DEFINE_EVENT(i915_gem_object, i915_gem_object_clflush,
Chris Wilsondb53a302011-02-03 11:57:46 +0000459 TP_PROTO(struct drm_i915_gem_object *obj),
460 TP_ARGS(obj)
Li Zefan903cf202010-03-11 16:41:45 +0800461);
Chris Wilson1c5d22f2009-08-25 11:15:50 +0100462
Li Zefan903cf202010-03-11 16:41:45 +0800463DEFINE_EVENT(i915_gem_object, i915_gem_object_destroy,
Chris Wilson05394f32010-11-08 19:18:58 +0000464 TP_PROTO(struct drm_i915_gem_object *obj),
Li Zefan903cf202010-03-11 16:41:45 +0800465 TP_ARGS(obj)
Chris Wilson1c5d22f2009-08-25 11:15:50 +0100466);
467
Chris Wilsondb53a302011-02-03 11:57:46 +0000468TRACE_EVENT(i915_gem_evict,
Chris Wilsone522ac232016-08-04 16:32:18 +0100469 TP_PROTO(struct i915_address_space *vm, u32 size, u32 align, unsigned int flags),
470 TP_ARGS(vm, size, align, flags),
Chris Wilson1c5d22f2009-08-25 11:15:50 +0100471
472 TP_STRUCT__entry(
Chris Wilson4f49be52009-09-24 00:23:33 +0100473 __field(u32, dev)
Chris Wilsone522ac232016-08-04 16:32:18 +0100474 __field(struct i915_address_space *, vm)
Chris Wilsondb53a302011-02-03 11:57:46 +0000475 __field(u32, size)
476 __field(u32, align)
Chris Wilsone522ac232016-08-04 16:32:18 +0100477 __field(unsigned int, flags)
Chris Wilsondb53a302011-02-03 11:57:46 +0000478 ),
Chris Wilson1c5d22f2009-08-25 11:15:50 +0100479
480 TP_fast_assign(
Chris Wilsonc6385c92016-11-29 12:42:05 +0000481 __entry->dev = vm->i915->drm.primary->index;
Chris Wilsone522ac232016-08-04 16:32:18 +0100482 __entry->vm = vm;
Chris Wilsondb53a302011-02-03 11:57:46 +0000483 __entry->size = size;
484 __entry->align = align;
Daniel Vetter1ec9e262014-02-14 14:01:11 +0100485 __entry->flags = flags;
Chris Wilsondb53a302011-02-03 11:57:46 +0000486 ),
Chris Wilson1c5d22f2009-08-25 11:15:50 +0100487
Chris Wilsone522ac232016-08-04 16:32:18 +0100488 TP_printk("dev=%d, vm=%p, size=%d, align=%d %s",
489 __entry->dev, __entry->vm, __entry->size, __entry->align,
Daniel Vetter1ec9e262014-02-14 14:01:11 +0100490 __entry->flags & PIN_MAPPABLE ? ", mappable" : "")
Chris Wilson1c5d22f2009-08-25 11:15:50 +0100491);
492
Chris Wilsondb53a302011-02-03 11:57:46 +0000493TRACE_EVENT(i915_gem_evict_everything,
Chris Wilson6c085a72012-08-20 11:40:46 +0200494 TP_PROTO(struct drm_device *dev),
495 TP_ARGS(dev),
Chris Wilson1c5d22f2009-08-25 11:15:50 +0100496
497 TP_STRUCT__entry(
Chris Wilson4f49be52009-09-24 00:23:33 +0100498 __field(u32, dev)
Chris Wilsondb53a302011-02-03 11:57:46 +0000499 ),
Chris Wilson1c5d22f2009-08-25 11:15:50 +0100500
501 TP_fast_assign(
Chris Wilson4f49be52009-09-24 00:23:33 +0100502 __entry->dev = dev->primary->index;
Chris Wilsondb53a302011-02-03 11:57:46 +0000503 ),
504
Chris Wilson6c085a72012-08-20 11:40:46 +0200505 TP_printk("dev=%d", __entry->dev)
Chris Wilsondb53a302011-02-03 11:57:46 +0000506);
507
Ben Widawskybcccff82013-09-24 09:57:56 -0700508TRACE_EVENT(i915_gem_evict_vm,
509 TP_PROTO(struct i915_address_space *vm),
510 TP_ARGS(vm),
511
512 TP_STRUCT__entry(
Steven Rostedt9297ebf2014-03-18 11:27:37 -0400513 __field(u32, dev)
Ben Widawskybcccff82013-09-24 09:57:56 -0700514 __field(struct i915_address_space *, vm)
515 ),
516
517 TP_fast_assign(
Chris Wilsonc6385c92016-11-29 12:42:05 +0000518 __entry->dev = vm->i915->drm.primary->index;
Ben Widawskybcccff82013-09-24 09:57:56 -0700519 __entry->vm = vm;
520 ),
521
Steven Rostedt9297ebf2014-03-18 11:27:37 -0400522 TP_printk("dev=%d, vm=%p", __entry->dev, __entry->vm)
Ben Widawskybcccff82013-09-24 09:57:56 -0700523);
524
Chris Wilson625d9882017-01-11 11:23:11 +0000525TRACE_EVENT(i915_gem_evict_node,
526 TP_PROTO(struct i915_address_space *vm, struct drm_mm_node *node, unsigned int flags),
527 TP_ARGS(vm, node, flags),
Chris Wilson172ae5b2016-12-05 14:29:37 +0000528
529 TP_STRUCT__entry(
530 __field(u32, dev)
531 __field(struct i915_address_space *, vm)
532 __field(u64, start)
533 __field(u64, size)
534 __field(unsigned long, color)
535 __field(unsigned int, flags)
536 ),
537
538 TP_fast_assign(
Chris Wilson625d9882017-01-11 11:23:11 +0000539 __entry->dev = vm->i915->drm.primary->index;
540 __entry->vm = vm;
541 __entry->start = node->start;
542 __entry->size = node->size;
543 __entry->color = node->color;
Chris Wilson172ae5b2016-12-05 14:29:37 +0000544 __entry->flags = flags;
545 ),
546
547 TP_printk("dev=%d, vm=%p, start=%llx size=%llx, color=%lx, flags=%x",
548 __entry->dev, __entry->vm,
549 __entry->start, __entry->size,
550 __entry->color, __entry->flags)
551);
552
Chris Wilsonb52b89d2013-09-25 11:43:28 +0100553TRACE_EVENT(i915_gem_ring_sync_to,
Chris Wilson8e637172016-08-02 22:50:26 +0100554 TP_PROTO(struct drm_i915_gem_request *to,
555 struct drm_i915_gem_request *from),
556 TP_ARGS(to, from),
Chris Wilsonb52b89d2013-09-25 11:43:28 +0100557
558 TP_STRUCT__entry(
559 __field(u32, dev)
560 __field(u32, sync_from)
561 __field(u32, sync_to)
562 __field(u32, seqno)
563 ),
564
565 TP_fast_assign(
Chris Wilson91c8a322016-07-05 10:40:23 +0100566 __entry->dev = from->i915->drm.primary->index;
Chris Wilson8e637172016-08-02 22:50:26 +0100567 __entry->sync_from = from->engine->id;
568 __entry->sync_to = to->engine->id;
Chris Wilson65e47602016-10-28 13:58:49 +0100569 __entry->seqno = from->global_seqno;
Chris Wilsonb52b89d2013-09-25 11:43:28 +0100570 ),
571
572 TP_printk("dev=%u, sync-from=%u, sync-to=%u, seqno=%u",
573 __entry->dev,
574 __entry->sync_from, __entry->sync_to,
575 __entry->seqno)
576);
577
Tvrtko Ursulin1cce8922017-02-21 09:13:44 +0000578TRACE_EVENT(i915_gem_request_queue,
John Harrison74328ee2014-11-24 18:49:38 +0000579 TP_PROTO(struct drm_i915_gem_request *req, u32 flags),
580 TP_ARGS(req, flags),
Chris Wilsondb53a302011-02-03 11:57:46 +0000581
582 TP_STRUCT__entry(
583 __field(u32, dev)
584 __field(u32, ring)
Tvrtko Ursulin1cce8922017-02-21 09:13:44 +0000585 __field(u32, ctx)
Chris Wilsondb53a302011-02-03 11:57:46 +0000586 __field(u32, seqno)
Chris Wilsond7d4eed2012-10-17 12:09:54 +0100587 __field(u32, flags)
Chris Wilsondb53a302011-02-03 11:57:46 +0000588 ),
589
590 TP_fast_assign(
Chris Wilson91c8a322016-07-05 10:40:23 +0100591 __entry->dev = req->i915->drm.primary->index;
Chris Wilsonc0336662016-05-06 15:40:21 +0100592 __entry->ring = req->engine->id;
Tvrtko Ursulin1cce8922017-02-21 09:13:44 +0000593 __entry->ctx = req->ctx->hw_id;
594 __entry->seqno = req->fence.seqno;
Chris Wilsond7d4eed2012-10-17 12:09:54 +0100595 __entry->flags = flags;
Chris Wilson1c5d22f2009-08-25 11:15:50 +0100596 ),
597
Tvrtko Ursulin1cce8922017-02-21 09:13:44 +0000598 TP_printk("dev=%u, ring=%u, ctx=%u, seqno=%u, flags=0x%x",
599 __entry->dev, __entry->ring, __entry->ctx, __entry->seqno,
600 __entry->flags)
Chris Wilsondb53a302011-02-03 11:57:46 +0000601);
602
603TRACE_EVENT(i915_gem_ring_flush,
John Harrisona84c3ae2015-05-29 17:43:57 +0100604 TP_PROTO(struct drm_i915_gem_request *req, u32 invalidate, u32 flush),
605 TP_ARGS(req, invalidate, flush),
Chris Wilsondb53a302011-02-03 11:57:46 +0000606
607 TP_STRUCT__entry(
608 __field(u32, dev)
609 __field(u32, ring)
610 __field(u32, invalidate)
611 __field(u32, flush)
612 ),
613
614 TP_fast_assign(
Chris Wilson91c8a322016-07-05 10:40:23 +0100615 __entry->dev = req->i915->drm.primary->index;
Tvrtko Ursulin4a570db2016-03-16 11:00:38 +0000616 __entry->ring = req->engine->id;
Chris Wilsondb53a302011-02-03 11:57:46 +0000617 __entry->invalidate = invalidate;
618 __entry->flush = flush;
619 ),
620
621 TP_printk("dev=%u, ring=%x, invalidate=%04x, flush=%04x",
622 __entry->dev, __entry->ring,
623 __entry->invalidate, __entry->flush)
Chris Wilson1c5d22f2009-08-25 11:15:50 +0100624);
625
Li Zefan903cf202010-03-11 16:41:45 +0800626DECLARE_EVENT_CLASS(i915_gem_request,
John Harrison74328ee2014-11-24 18:49:38 +0000627 TP_PROTO(struct drm_i915_gem_request *req),
628 TP_ARGS(req),
Chris Wilson1c5d22f2009-08-25 11:15:50 +0100629
630 TP_STRUCT__entry(
Chris Wilson4f49be52009-09-24 00:23:33 +0100631 __field(u32, dev)
Tvrtko Ursuline235b532017-02-21 09:13:43 +0000632 __field(u32, ctx)
Chris Wilsondb53a302011-02-03 11:57:46 +0000633 __field(u32, ring)
Chris Wilson1c5d22f2009-08-25 11:15:50 +0100634 __field(u32, seqno)
Tvrtko Ursuline235b532017-02-21 09:13:43 +0000635 __field(u32, global)
Chris Wilson1c5d22f2009-08-25 11:15:50 +0100636 ),
637
638 TP_fast_assign(
Chris Wilson91c8a322016-07-05 10:40:23 +0100639 __entry->dev = req->i915->drm.primary->index;
Tvrtko Ursuline235b532017-02-21 09:13:43 +0000640 __entry->ctx = req->ctx->hw_id;
Chris Wilsonc0336662016-05-06 15:40:21 +0100641 __entry->ring = req->engine->id;
Tvrtko Ursuline235b532017-02-21 09:13:43 +0000642 __entry->seqno = req->fence.seqno;
643 __entry->global = req->global_seqno;
Chris Wilson1c5d22f2009-08-25 11:15:50 +0100644 ),
645
Tvrtko Ursuline235b532017-02-21 09:13:43 +0000646 TP_printk("dev=%u, ring=%u, ctx=%u, seqno=%u, global=%u",
647 __entry->dev, __entry->ring, __entry->ctx, __entry->seqno,
648 __entry->global)
Chris Wilsondb53a302011-02-03 11:57:46 +0000649);
650
651DEFINE_EVENT(i915_gem_request, i915_gem_request_add,
John Harrison74328ee2014-11-24 18:49:38 +0000652 TP_PROTO(struct drm_i915_gem_request *req),
653 TP_ARGS(req)
Chris Wilson1c5d22f2009-08-25 11:15:50 +0100654);
655
Tvrtko Ursulin354d0362017-02-21 11:01:42 +0000656#if defined(CONFIG_DRM_I915_LOW_LEVEL_TRACEPOINTS)
657DEFINE_EVENT(i915_gem_request, i915_gem_request_submit,
658 TP_PROTO(struct drm_i915_gem_request *req),
659 TP_ARGS(req)
660);
661
662DEFINE_EVENT(i915_gem_request, i915_gem_request_execute,
663 TP_PROTO(struct drm_i915_gem_request *req),
664 TP_ARGS(req)
665);
Tvrtko Ursulind7d96832017-02-21 11:03:00 +0000666
667DECLARE_EVENT_CLASS(i915_gem_request_hw,
668 TP_PROTO(struct drm_i915_gem_request *req,
669 unsigned int port),
670 TP_ARGS(req, port),
671
672 TP_STRUCT__entry(
673 __field(u32, dev)
674 __field(u32, ring)
675 __field(u32, seqno)
676 __field(u32, global_seqno)
677 __field(u32, ctx)
678 __field(u32, port)
679 ),
680
681 TP_fast_assign(
682 __entry->dev = req->i915->drm.primary->index;
683 __entry->ring = req->engine->id;
684 __entry->ctx = req->ctx->hw_id;
685 __entry->seqno = req->fence.seqno;
686 __entry->global_seqno = req->global_seqno;
687 __entry->port = port;
688 ),
689
690 TP_printk("dev=%u, ring=%u, ctx=%u, seqno=%u, global=%u, port=%u",
691 __entry->dev, __entry->ring, __entry->ctx,
692 __entry->seqno, __entry->global_seqno,
693 __entry->port)
694);
695
696DEFINE_EVENT(i915_gem_request_hw, i915_gem_request_in,
697 TP_PROTO(struct drm_i915_gem_request *req, unsigned int port),
698 TP_ARGS(req, port)
699);
700
701DEFINE_EVENT(i915_gem_request, i915_gem_request_out,
702 TP_PROTO(struct drm_i915_gem_request *req),
703 TP_ARGS(req)
704);
Tvrtko Ursulin354d0362017-02-21 11:01:42 +0000705#else
706#if !defined(TRACE_HEADER_MULTI_READ)
707static inline void
708trace_i915_gem_request_submit(struct drm_i915_gem_request *req)
709{
710}
711
712static inline void
713trace_i915_gem_request_execute(struct drm_i915_gem_request *req)
714{
715}
Tvrtko Ursulind7d96832017-02-21 11:03:00 +0000716
717static inline void
718trace_i915_gem_request_in(struct drm_i915_gem_request *req, unsigned int port)
719{
720}
721
722static inline void
723trace_i915_gem_request_out(struct drm_i915_gem_request *req)
724{
725}
Tvrtko Ursulin354d0362017-02-21 11:01:42 +0000726#endif
727#endif
728
Tvrtko Ursulindffabc82017-02-21 09:13:48 +0000729TRACE_EVENT(intel_engine_notify,
730 TP_PROTO(struct intel_engine_cs *engine, bool waiters),
731 TP_ARGS(engine, waiters),
Chris Wilson814e9b52013-09-23 17:33:19 -0300732
733 TP_STRUCT__entry(
734 __field(u32, dev)
735 __field(u32, ring)
736 __field(u32, seqno)
Tvrtko Ursulindffabc82017-02-21 09:13:48 +0000737 __field(bool, waiters)
Chris Wilson814e9b52013-09-23 17:33:19 -0300738 ),
739
740 TP_fast_assign(
Chris Wilson91c8a322016-07-05 10:40:23 +0100741 __entry->dev = engine->i915->drm.primary->index;
Tvrtko Ursulin4a570db2016-03-16 11:00:38 +0000742 __entry->ring = engine->id;
Chris Wilson1b7744e2016-07-01 17:23:17 +0100743 __entry->seqno = intel_engine_get_seqno(engine);
Tvrtko Ursulindffabc82017-02-21 09:13:48 +0000744 __entry->waiters = waiters;
Chris Wilson814e9b52013-09-23 17:33:19 -0300745 ),
746
Tvrtko Ursulindffabc82017-02-21 09:13:48 +0000747 TP_printk("dev=%u, ring=%u, seqno=%u, waiters=%u",
748 __entry->dev, __entry->ring, __entry->seqno,
749 __entry->waiters)
Chris Wilson1c5d22f2009-08-25 11:15:50 +0100750);
751
Li Zefan903cf202010-03-11 16:41:45 +0800752DEFINE_EVENT(i915_gem_request, i915_gem_request_retire,
John Harrison74328ee2014-11-24 18:49:38 +0000753 TP_PROTO(struct drm_i915_gem_request *req),
754 TP_ARGS(req)
Chris Wilson1c5d22f2009-08-25 11:15:50 +0100755);
756
Ben Widawskyf3fd3762012-05-24 15:03:09 -0700757TRACE_EVENT(i915_gem_request_wait_begin,
Tvrtko Ursulin93692502017-02-21 11:00:24 +0000758 TP_PROTO(struct drm_i915_gem_request *req, unsigned int flags),
759 TP_ARGS(req, flags),
Ben Widawskyf3fd3762012-05-24 15:03:09 -0700760
761 TP_STRUCT__entry(
762 __field(u32, dev)
763 __field(u32, ring)
Tvrtko Ursulin93692502017-02-21 11:00:24 +0000764 __field(u32, ctx)
Ben Widawskyf3fd3762012-05-24 15:03:09 -0700765 __field(u32, seqno)
Tvrtko Ursulin93692502017-02-21 11:00:24 +0000766 __field(u32, global)
767 __field(unsigned int, flags)
Ben Widawskyf3fd3762012-05-24 15:03:09 -0700768 ),
769
770 /* NB: the blocking information is racy since mutex_is_locked
771 * doesn't check that the current thread holds the lock. The only
772 * other option would be to pass the boolean information of whether
773 * or not the class was blocking down through the stack which is
774 * less desirable.
775 */
776 TP_fast_assign(
Chris Wilson91c8a322016-07-05 10:40:23 +0100777 __entry->dev = req->i915->drm.primary->index;
Chris Wilsonc0336662016-05-06 15:40:21 +0100778 __entry->ring = req->engine->id;
Tvrtko Ursulin93692502017-02-21 11:00:24 +0000779 __entry->ctx = req->ctx->hw_id;
780 __entry->seqno = req->fence.seqno;
781 __entry->global = req->global_seqno;
782 __entry->flags = flags;
Ben Widawskyf3fd3762012-05-24 15:03:09 -0700783 ),
784
Tvrtko Ursulin93692502017-02-21 11:00:24 +0000785 TP_printk("dev=%u, ring=%u, ctx=%u, seqno=%u, global=%u, blocking=%u, flags=0x%x",
786 __entry->dev, __entry->ring, __entry->ctx, __entry->seqno,
787 __entry->global, !!(__entry->flags & I915_WAIT_LOCKED),
788 __entry->flags)
Chris Wilson1c5d22f2009-08-25 11:15:50 +0100789);
790
Li Zefan903cf202010-03-11 16:41:45 +0800791DEFINE_EVENT(i915_gem_request, i915_gem_request_wait_end,
John Harrison74328ee2014-11-24 18:49:38 +0000792 TP_PROTO(struct drm_i915_gem_request *req),
793 TP_ARGS(req)
Li Zefan903cf202010-03-11 16:41:45 +0800794);
795
Jesse Barnese5510fa2010-07-01 16:48:37 -0700796TRACE_EVENT(i915_flip_request,
Chris Wilson05394f32010-11-08 19:18:58 +0000797 TP_PROTO(int plane, struct drm_i915_gem_object *obj),
Jesse Barnese5510fa2010-07-01 16:48:37 -0700798
799 TP_ARGS(plane, obj),
800
801 TP_STRUCT__entry(
802 __field(int, plane)
Chris Wilson05394f32010-11-08 19:18:58 +0000803 __field(struct drm_i915_gem_object *, obj)
Jesse Barnese5510fa2010-07-01 16:48:37 -0700804 ),
805
806 TP_fast_assign(
807 __entry->plane = plane;
808 __entry->obj = obj;
809 ),
810
811 TP_printk("plane=%d, obj=%p", __entry->plane, __entry->obj)
812);
813
814TRACE_EVENT(i915_flip_complete,
Chris Wilson05394f32010-11-08 19:18:58 +0000815 TP_PROTO(int plane, struct drm_i915_gem_object *obj),
Jesse Barnese5510fa2010-07-01 16:48:37 -0700816
817 TP_ARGS(plane, obj),
818
819 TP_STRUCT__entry(
820 __field(int, plane)
Chris Wilson05394f32010-11-08 19:18:58 +0000821 __field(struct drm_i915_gem_object *, obj)
Jesse Barnese5510fa2010-07-01 16:48:37 -0700822 ),
823
824 TP_fast_assign(
825 __entry->plane = plane;
826 __entry->obj = obj;
827 ),
828
829 TP_printk("plane=%d, obj=%p", __entry->plane, __entry->obj)
830);
831
Chris Wilsoned71f1b2013-07-19 20:36:56 +0100832TRACE_EVENT_CONDITION(i915_reg_rw,
Ville Syrjäläf0f59a02015-11-18 15:33:26 +0200833 TP_PROTO(bool write, i915_reg_t reg, u64 val, int len, bool trace),
Yuanhan Liuba4f01a2010-11-08 17:09:41 +0800834
Chris Wilsoned71f1b2013-07-19 20:36:56 +0100835 TP_ARGS(write, reg, val, len, trace),
836
837 TP_CONDITION(trace),
Yuanhan Liuba4f01a2010-11-08 17:09:41 +0800838
Akshay Joshi0206e352011-08-16 15:34:10 -0400839 TP_STRUCT__entry(
840 __field(u64, val)
841 __field(u32, reg)
842 __field(u16, write)
843 __field(u16, len)
844 ),
Yuanhan Liuba4f01a2010-11-08 17:09:41 +0800845
Akshay Joshi0206e352011-08-16 15:34:10 -0400846 TP_fast_assign(
847 __entry->val = (u64)val;
Ville Syrjäläf0f59a02015-11-18 15:33:26 +0200848 __entry->reg = i915_mmio_reg_offset(reg);
Akshay Joshi0206e352011-08-16 15:34:10 -0400849 __entry->write = write;
850 __entry->len = len;
851 ),
Yuanhan Liuba4f01a2010-11-08 17:09:41 +0800852
Akshay Joshi0206e352011-08-16 15:34:10 -0400853 TP_printk("%s reg=0x%x, len=%d, val=(0x%x, 0x%x)",
854 __entry->write ? "write" : "read",
855 __entry->reg, __entry->len,
856 (u32)(__entry->val & 0xffffffff),
857 (u32)(__entry->val >> 32))
Yuanhan Liuba4f01a2010-11-08 17:09:41 +0800858);
859
Daniel Vetterbe2cde92012-08-30 13:26:48 +0200860TRACE_EVENT(intel_gpu_freq_change,
861 TP_PROTO(u32 freq),
862 TP_ARGS(freq),
863
864 TP_STRUCT__entry(
865 __field(u32, freq)
866 ),
867
868 TP_fast_assign(
869 __entry->freq = freq;
870 ),
871
872 TP_printk("new_freq=%u", __entry->freq)
873);
874
Daniele Ceraolo Spurio198c9742014-11-10 13:44:31 +0000875/**
876 * DOC: i915_ppgtt_create and i915_ppgtt_release tracepoints
877 *
878 * With full ppgtt enabled each process using drm will allocate at least one
879 * translation table. With these traces it is possible to keep track of the
880 * allocation and of the lifetime of the tables; this can be used during
881 * testing/debug to verify that we are not leaking ppgtts.
882 * These traces identify the ppgtt through the vm pointer, which is also printed
883 * by the i915_vma_bind and i915_vma_unbind tracepoints.
884 */
885DECLARE_EVENT_CLASS(i915_ppgtt,
886 TP_PROTO(struct i915_address_space *vm),
887 TP_ARGS(vm),
888
889 TP_STRUCT__entry(
890 __field(struct i915_address_space *, vm)
891 __field(u32, dev)
892 ),
893
894 TP_fast_assign(
895 __entry->vm = vm;
Chris Wilsonc6385c92016-11-29 12:42:05 +0000896 __entry->dev = vm->i915->drm.primary->index;
Daniele Ceraolo Spurio198c9742014-11-10 13:44:31 +0000897 ),
898
899 TP_printk("dev=%u, vm=%p", __entry->dev, __entry->vm)
900)
901
902DEFINE_EVENT(i915_ppgtt, i915_ppgtt_create,
903 TP_PROTO(struct i915_address_space *vm),
904 TP_ARGS(vm)
905);
906
907DEFINE_EVENT(i915_ppgtt, i915_ppgtt_release,
908 TP_PROTO(struct i915_address_space *vm),
909 TP_ARGS(vm)
910);
911
912/**
913 * DOC: i915_context_create and i915_context_free tracepoints
914 *
915 * These tracepoints are used to track creation and deletion of contexts.
916 * If full ppgtt is enabled, they also print the address of the vm assigned to
917 * the context.
918 */
919DECLARE_EVENT_CLASS(i915_context,
Chris Wilsone2efd132016-05-24 14:53:34 +0100920 TP_PROTO(struct i915_gem_context *ctx),
Daniele Ceraolo Spurio198c9742014-11-10 13:44:31 +0000921 TP_ARGS(ctx),
922
923 TP_STRUCT__entry(
924 __field(u32, dev)
Chris Wilsone2efd132016-05-24 14:53:34 +0100925 __field(struct i915_gem_context *, ctx)
Tvrtko Ursulin99c181a2017-02-21 09:13:50 +0000926 __field(u32, hw_id)
Daniele Ceraolo Spurio198c9742014-11-10 13:44:31 +0000927 __field(struct i915_address_space *, vm)
928 ),
929
930 TP_fast_assign(
Chris Wilson91c8a322016-07-05 10:40:23 +0100931 __entry->dev = ctx->i915->drm.primary->index;
Tvrtko Ursulin99c181a2017-02-21 09:13:50 +0000932 __entry->ctx = ctx;
933 __entry->hw_id = ctx->hw_id;
934 __entry->vm = ctx->ppgtt ? &ctx->ppgtt->base : NULL;
Daniele Ceraolo Spurio198c9742014-11-10 13:44:31 +0000935 ),
936
Tvrtko Ursulin99c181a2017-02-21 09:13:50 +0000937 TP_printk("dev=%u, ctx=%p, ctx_vm=%p, hw_id=%u",
938 __entry->dev, __entry->ctx, __entry->vm, __entry->hw_id)
Daniele Ceraolo Spurio198c9742014-11-10 13:44:31 +0000939)
940
941DEFINE_EVENT(i915_context, i915_context_create,
Chris Wilsone2efd132016-05-24 14:53:34 +0100942 TP_PROTO(struct i915_gem_context *ctx),
Daniele Ceraolo Spurio198c9742014-11-10 13:44:31 +0000943 TP_ARGS(ctx)
944);
945
946DEFINE_EVENT(i915_context, i915_context_free,
Chris Wilsone2efd132016-05-24 14:53:34 +0100947 TP_PROTO(struct i915_gem_context *ctx),
Daniele Ceraolo Spurio198c9742014-11-10 13:44:31 +0000948 TP_ARGS(ctx)
949);
950
951/**
952 * DOC: switch_mm tracepoint
953 *
954 * This tracepoint allows tracking of the mm switch, which is an important point
955 * in the lifetime of the vm in the legacy submission path. This tracepoint is
956 * called only if full ppgtt is enabled.
957 */
958TRACE_EVENT(switch_mm,
Chris Wilsone2efd132016-05-24 14:53:34 +0100959 TP_PROTO(struct intel_engine_cs *engine, struct i915_gem_context *to),
Daniele Ceraolo Spurio198c9742014-11-10 13:44:31 +0000960
Tvrtko Ursulin4a570db2016-03-16 11:00:38 +0000961 TP_ARGS(engine, to),
Daniele Ceraolo Spurio198c9742014-11-10 13:44:31 +0000962
963 TP_STRUCT__entry(
964 __field(u32, ring)
Chris Wilsone2efd132016-05-24 14:53:34 +0100965 __field(struct i915_gem_context *, to)
Daniele Ceraolo Spurio198c9742014-11-10 13:44:31 +0000966 __field(struct i915_address_space *, vm)
967 __field(u32, dev)
968 ),
969
970 TP_fast_assign(
Tvrtko Ursulin4a570db2016-03-16 11:00:38 +0000971 __entry->ring = engine->id;
Daniele Ceraolo Spurio198c9742014-11-10 13:44:31 +0000972 __entry->to = to;
973 __entry->vm = to->ppgtt? &to->ppgtt->base : NULL;
Chris Wilson91c8a322016-07-05 10:40:23 +0100974 __entry->dev = engine->i915->drm.primary->index;
Daniele Ceraolo Spurio198c9742014-11-10 13:44:31 +0000975 ),
976
977 TP_printk("dev=%u, ring=%u, ctx=%p, ctx_vm=%p",
978 __entry->dev, __entry->ring, __entry->to, __entry->vm)
979);
980
Chris Wilson1c5d22f2009-08-25 11:15:50 +0100981#endif /* _I915_TRACE_H_ */
982
983/* This part must be outside protection */
984#undef TRACE_INCLUDE_PATH
Peter Cliftona7c54272010-05-03 13:24:41 +0100985#define TRACE_INCLUDE_PATH .
Chris Wilson1c5d22f2009-08-25 11:15:50 +0100986#include <trace/define_trace.h>