1 #if !defined(_I915_TRACE_H_) || defined(TRACE_HEADER_MULTI_READ)
4 #include <linux/stringify.h>
5 #include <linux/types.h>
6 #include <linux/tracepoint.h>
10 #include "intel_drv.h"
11 #include "intel_ringbuffer.h"
14 #define TRACE_SYSTEM i915
15 #define TRACE_INCLUDE_FILE i915_trace
17 /* watermark/fifo updates */
19 TRACE_EVENT(intel_cpu_fifo_underrun,
20 TP_PROTO(struct drm_i915_private *dev_priv, enum pipe pipe),
21 TP_ARGS(dev_priv, pipe),
24 __field(enum pipe, pipe)
26 __field(u32, scanline)
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));
35 TP_printk("pipe %c, frame=%u, scanline=%u",
36 pipe_name(__entry->pipe),
37 __entry->frame, __entry->scanline)
40 TRACE_EVENT(intel_pch_fifo_underrun,
41 TP_PROTO(struct drm_i915_private *dev_priv, enum pipe pch_transcoder),
42 TP_ARGS(dev_priv, pch_transcoder),
45 __field(enum pipe, pipe)
47 __field(u32, scanline)
51 enum pipe pipe = pch_transcoder;
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));
57 TP_printk("pch transcoder %c, frame=%u, scanline=%u",
58 pipe_name(__entry->pipe),
59 __entry->frame, __entry->scanline)
62 TRACE_EVENT(intel_memory_cxsr,
63 TP_PROTO(struct drm_i915_private *dev_priv, bool old, bool new),
64 TP_ARGS(dev_priv, old, new),
67 __array(u32, frame, 3)
68 __array(u32, scanline, 3)
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));
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])
93 TP_PROTO(struct intel_crtc *crtc, const struct g4x_wm_values *wm),
97 __field(enum pipe, pipe)
99 __field(u32, scanline)
100 __field(u16, primary)
103 __field(u16, sr_plane)
104 __field(u16, sr_cursor)
106 __field(u16, hpll_plane)
107 __field(u16, hpll_cursor)
108 __field(u16, hpll_fbc)
115 __entry->pipe = crtc->pipe;
116 __entry->frame = crtc->base.dev->driver->get_vblank_counter(crtc->base.dev,
118 __entry->scanline = intel_get_crtc_scanline(crtc);
119 __entry->primary = wm->pipe[crtc->pipe].plane[PLANE_PRIMARY];
120 __entry->sprite = wm->pipe[crtc->pipe].plane[PLANE_SPRITE0];
121 __entry->cursor = wm->pipe[crtc->pipe].plane[PLANE_CURSOR];
122 __entry->sr_plane = wm->sr.plane;
123 __entry->sr_cursor = wm->sr.cursor;
124 __entry->sr_fbc = wm->sr.fbc;
125 __entry->hpll_plane = wm->hpll.plane;
126 __entry->hpll_cursor = wm->hpll.cursor;
127 __entry->hpll_fbc = wm->hpll.fbc;
128 __entry->cxsr = wm->cxsr;
129 __entry->hpll = wm->hpll_en;
130 __entry->fbc = wm->fbc_en;
133 TP_printk("pipe %c, frame=%u, scanline=%u, wm %d/%d/%d, sr %s/%d/%d/%d, hpll %s/%d/%d/%d, fbc %s",
134 pipe_name(__entry->pipe), __entry->frame, __entry->scanline,
135 __entry->primary, __entry->sprite, __entry->cursor,
136 yesno(__entry->cxsr), __entry->sr_plane, __entry->sr_cursor, __entry->sr_fbc,
137 yesno(__entry->hpll), __entry->hpll_plane, __entry->hpll_cursor, __entry->hpll_fbc,
142 TP_PROTO(struct intel_crtc *crtc, const struct vlv_wm_values *wm),
146 __field(enum pipe, pipe)
148 __field(u32, scanline)
151 __field(u32, primary)
152 __field(u32, sprite0)
153 __field(u32, sprite1)
155 __field(u32, sr_plane)
156 __field(u32, sr_cursor)
160 __entry->pipe = crtc->pipe;
161 __entry->frame = crtc->base.dev->driver->get_vblank_counter(crtc->base.dev,
163 __entry->scanline = intel_get_crtc_scanline(crtc);
164 __entry->level = wm->level;
165 __entry->cxsr = wm->cxsr;
166 __entry->primary = wm->pipe[crtc->pipe].plane[PLANE_PRIMARY];
167 __entry->sprite0 = wm->pipe[crtc->pipe].plane[PLANE_SPRITE0];
168 __entry->sprite1 = wm->pipe[crtc->pipe].plane[PLANE_SPRITE1];
169 __entry->cursor = wm->pipe[crtc->pipe].plane[PLANE_CURSOR];
170 __entry->sr_plane = wm->sr.plane;
171 __entry->sr_cursor = wm->sr.cursor;
174 TP_printk("pipe %c, frame=%u, scanline=%u, level=%d, cxsr=%d, wm %d/%d/%d/%d, sr %d/%d",
175 pipe_name(__entry->pipe), __entry->frame,
176 __entry->scanline, __entry->level, __entry->cxsr,
177 __entry->primary, __entry->sprite0, __entry->sprite1, __entry->cursor,
178 __entry->sr_plane, __entry->sr_cursor)
181 TRACE_EVENT(vlv_fifo_size,
182 TP_PROTO(struct intel_crtc *crtc, u32 sprite0_start, u32 sprite1_start, u32 fifo_size),
183 TP_ARGS(crtc, sprite0_start, sprite1_start, fifo_size),
186 __field(enum pipe, pipe)
188 __field(u32, scanline)
189 __field(u32, sprite0_start)
190 __field(u32, sprite1_start)
191 __field(u32, fifo_size)
195 __entry->pipe = crtc->pipe;
196 __entry->frame = crtc->base.dev->driver->get_vblank_counter(crtc->base.dev,
198 __entry->scanline = intel_get_crtc_scanline(crtc);
199 __entry->sprite0_start = sprite0_start;
200 __entry->sprite1_start = sprite1_start;
201 __entry->fifo_size = fifo_size;
204 TP_printk("pipe %c, frame=%u, scanline=%u, %d/%d/%d",
205 pipe_name(__entry->pipe), __entry->frame,
206 __entry->scanline, __entry->sprite0_start,
207 __entry->sprite1_start, __entry->fifo_size)
212 TRACE_EVENT(intel_update_plane,
213 TP_PROTO(struct drm_plane *plane, struct intel_crtc *crtc),
214 TP_ARGS(plane, crtc),
217 __field(enum pipe, pipe)
218 __field(const char *, name)
220 __field(u32, scanline)
226 __entry->pipe = crtc->pipe;
227 __entry->name = plane->name;
228 __entry->frame = crtc->base.dev->driver->get_vblank_counter(crtc->base.dev,
230 __entry->scanline = intel_get_crtc_scanline(crtc);
231 memcpy(__entry->src, &plane->state->src, sizeof(__entry->src));
232 memcpy(__entry->dst, &plane->state->dst, sizeof(__entry->dst));
235 TP_printk("pipe %c, plane %s, frame=%u, scanline=%u, " DRM_RECT_FP_FMT " -> " DRM_RECT_FMT,
236 pipe_name(__entry->pipe), __entry->name,
237 __entry->frame, __entry->scanline,
238 DRM_RECT_FP_ARG((const struct drm_rect *)__entry->src),
239 DRM_RECT_ARG((const struct drm_rect *)__entry->dst))
242 TRACE_EVENT(intel_disable_plane,
243 TP_PROTO(struct drm_plane *plane, struct intel_crtc *crtc),
244 TP_ARGS(plane, crtc),
247 __field(enum pipe, pipe)
248 __field(const char *, name)
250 __field(u32, scanline)
254 __entry->pipe = crtc->pipe;
255 __entry->name = plane->name;
256 __entry->frame = crtc->base.dev->driver->get_vblank_counter(crtc->base.dev,
258 __entry->scanline = intel_get_crtc_scanline(crtc);
261 TP_printk("pipe %c, plane %s, frame=%u, scanline=%u",
262 pipe_name(__entry->pipe), __entry->name,
263 __entry->frame, __entry->scanline)
268 TRACE_EVENT(i915_pipe_update_start,
269 TP_PROTO(struct intel_crtc *crtc),
273 __field(enum pipe, pipe)
275 __field(u32, scanline)
281 __entry->pipe = crtc->pipe;
282 __entry->frame = crtc->base.dev->driver->get_vblank_counter(crtc->base.dev,
284 __entry->scanline = intel_get_crtc_scanline(crtc);
285 __entry->min = crtc->debug.min_vbl;
286 __entry->max = crtc->debug.max_vbl;
289 TP_printk("pipe %c, frame=%u, scanline=%u, min=%u, max=%u",
290 pipe_name(__entry->pipe), __entry->frame,
291 __entry->scanline, __entry->min, __entry->max)
294 TRACE_EVENT(i915_pipe_update_vblank_evaded,
295 TP_PROTO(struct intel_crtc *crtc),
299 __field(enum pipe, pipe)
301 __field(u32, scanline)
307 __entry->pipe = crtc->pipe;
308 __entry->frame = crtc->debug.start_vbl_count;
309 __entry->scanline = crtc->debug.scanline_start;
310 __entry->min = crtc->debug.min_vbl;
311 __entry->max = crtc->debug.max_vbl;
314 TP_printk("pipe %c, frame=%u, scanline=%u, min=%u, max=%u",
315 pipe_name(__entry->pipe), __entry->frame,
316 __entry->scanline, __entry->min, __entry->max)
319 TRACE_EVENT(i915_pipe_update_end,
320 TP_PROTO(struct intel_crtc *crtc, u32 frame, int scanline_end),
321 TP_ARGS(crtc, frame, scanline_end),
324 __field(enum pipe, pipe)
326 __field(u32, scanline)
330 __entry->pipe = crtc->pipe;
331 __entry->frame = frame;
332 __entry->scanline = scanline_end;
335 TP_printk("pipe %c, frame=%u, scanline=%u",
336 pipe_name(__entry->pipe), __entry->frame,
340 /* object tracking */
342 TRACE_EVENT(i915_gem_object_create,
343 TP_PROTO(struct drm_i915_gem_object *obj),
347 __field(struct drm_i915_gem_object *, obj)
353 __entry->size = obj->base.size;
356 TP_printk("obj=%p, size=0x%llx", __entry->obj, __entry->size)
359 TRACE_EVENT(i915_gem_shrink,
360 TP_PROTO(struct drm_i915_private *i915, unsigned long target, unsigned flags),
361 TP_ARGS(i915, target, flags),
365 __field(unsigned long, target)
366 __field(unsigned, flags)
370 __entry->dev = i915->drm.primary->index;
371 __entry->target = target;
372 __entry->flags = flags;
375 TP_printk("dev=%d, target=%lu, flags=%x",
376 __entry->dev, __entry->target, __entry->flags)
379 TRACE_EVENT(i915_vma_bind,
380 TP_PROTO(struct i915_vma *vma, unsigned flags),
384 __field(struct drm_i915_gem_object *, obj)
385 __field(struct i915_address_space *, vm)
388 __field(unsigned, flags)
392 __entry->obj = vma->obj;
393 __entry->vm = vma->vm;
394 __entry->offset = vma->node.start;
395 __entry->size = vma->node.size;
396 __entry->flags = flags;
399 TP_printk("obj=%p, offset=0x%016llx size=0x%llx%s vm=%p",
400 __entry->obj, __entry->offset, __entry->size,
401 __entry->flags & PIN_MAPPABLE ? ", mappable" : "",
405 TRACE_EVENT(i915_vma_unbind,
406 TP_PROTO(struct i915_vma *vma),
410 __field(struct drm_i915_gem_object *, obj)
411 __field(struct i915_address_space *, vm)
417 __entry->obj = vma->obj;
418 __entry->vm = vma->vm;
419 __entry->offset = vma->node.start;
420 __entry->size = vma->node.size;
423 TP_printk("obj=%p, offset=0x%016llx size=0x%llx vm=%p",
424 __entry->obj, __entry->offset, __entry->size, __entry->vm)
427 TRACE_EVENT(i915_gem_object_pwrite,
428 TP_PROTO(struct drm_i915_gem_object *obj, u64 offset, u64 len),
429 TP_ARGS(obj, offset, len),
432 __field(struct drm_i915_gem_object *, obj)
439 __entry->offset = offset;
443 TP_printk("obj=%p, offset=0x%llx, len=0x%llx",
444 __entry->obj, __entry->offset, __entry->len)
447 TRACE_EVENT(i915_gem_object_pread,
448 TP_PROTO(struct drm_i915_gem_object *obj, u64 offset, u64 len),
449 TP_ARGS(obj, offset, len),
452 __field(struct drm_i915_gem_object *, obj)
459 __entry->offset = offset;
463 TP_printk("obj=%p, offset=0x%llx, len=0x%llx",
464 __entry->obj, __entry->offset, __entry->len)
467 TRACE_EVENT(i915_gem_object_fault,
468 TP_PROTO(struct drm_i915_gem_object *obj, u64 index, bool gtt, bool write),
469 TP_ARGS(obj, index, gtt, write),
472 __field(struct drm_i915_gem_object *, obj)
480 __entry->index = index;
482 __entry->write = write;
485 TP_printk("obj=%p, %s index=%llu %s",
487 __entry->gtt ? "GTT" : "CPU",
489 __entry->write ? ", writable" : "")
492 DECLARE_EVENT_CLASS(i915_gem_object,
493 TP_PROTO(struct drm_i915_gem_object *obj),
497 __field(struct drm_i915_gem_object *, obj)
504 TP_printk("obj=%p", __entry->obj)
507 DEFINE_EVENT(i915_gem_object, i915_gem_object_clflush,
508 TP_PROTO(struct drm_i915_gem_object *obj),
512 DEFINE_EVENT(i915_gem_object, i915_gem_object_destroy,
513 TP_PROTO(struct drm_i915_gem_object *obj),
517 TRACE_EVENT(i915_gem_evict,
518 TP_PROTO(struct i915_address_space *vm, u64 size, u64 align, unsigned int flags),
519 TP_ARGS(vm, size, align, flags),
523 __field(struct i915_address_space *, vm)
526 __field(unsigned int, flags)
530 __entry->dev = vm->i915->drm.primary->index;
532 __entry->size = size;
533 __entry->align = align;
534 __entry->flags = flags;
537 TP_printk("dev=%d, vm=%p, size=0x%llx, align=0x%llx %s",
538 __entry->dev, __entry->vm, __entry->size, __entry->align,
539 __entry->flags & PIN_MAPPABLE ? ", mappable" : "")
542 TRACE_EVENT(i915_gem_evict_node,
543 TP_PROTO(struct i915_address_space *vm, struct drm_mm_node *node, unsigned int flags),
544 TP_ARGS(vm, node, flags),
548 __field(struct i915_address_space *, vm)
551 __field(unsigned long, color)
552 __field(unsigned int, flags)
556 __entry->dev = vm->i915->drm.primary->index;
558 __entry->start = node->start;
559 __entry->size = node->size;
560 __entry->color = node->color;
561 __entry->flags = flags;
564 TP_printk("dev=%d, vm=%p, start=0x%llx size=0x%llx, color=0x%lx, flags=%x",
565 __entry->dev, __entry->vm,
566 __entry->start, __entry->size,
567 __entry->color, __entry->flags)
570 TRACE_EVENT(i915_gem_evict_vm,
571 TP_PROTO(struct i915_address_space *vm),
576 __field(struct i915_address_space *, vm)
580 __entry->dev = vm->i915->drm.primary->index;
584 TP_printk("dev=%d, vm=%p", __entry->dev, __entry->vm)
587 TRACE_EVENT(i915_gem_ring_sync_to,
588 TP_PROTO(struct drm_i915_gem_request *to,
589 struct drm_i915_gem_request *from),
594 __field(u32, sync_from)
595 __field(u32, sync_to)
600 __entry->dev = from->i915->drm.primary->index;
601 __entry->sync_from = from->engine->id;
602 __entry->sync_to = to->engine->id;
603 __entry->seqno = from->global_seqno;
606 TP_printk("dev=%u, sync-from=%u, sync-to=%u, seqno=%u",
608 __entry->sync_from, __entry->sync_to,
612 TRACE_EVENT(i915_gem_request_queue,
613 TP_PROTO(struct drm_i915_gem_request *req, u32 flags),
625 __entry->dev = req->i915->drm.primary->index;
626 __entry->ring = req->engine->id;
627 __entry->ctx = req->fence.context;
628 __entry->seqno = req->fence.seqno;
629 __entry->flags = flags;
632 TP_printk("dev=%u, ring=%u, ctx=%u, seqno=%u, flags=0x%x",
633 __entry->dev, __entry->ring, __entry->ctx, __entry->seqno,
637 DECLARE_EVENT_CLASS(i915_gem_request,
638 TP_PROTO(struct drm_i915_gem_request *req),
650 __entry->dev = req->i915->drm.primary->index;
651 __entry->ring = req->engine->id;
652 __entry->ctx = req->fence.context;
653 __entry->seqno = req->fence.seqno;
654 __entry->global = req->global_seqno;
657 TP_printk("dev=%u, ring=%u, ctx=%u, seqno=%u, global=%u",
658 __entry->dev, __entry->ring, __entry->ctx, __entry->seqno,
662 DEFINE_EVENT(i915_gem_request, i915_gem_request_add,
663 TP_PROTO(struct drm_i915_gem_request *req),
667 #if defined(CONFIG_DRM_I915_LOW_LEVEL_TRACEPOINTS)
668 DEFINE_EVENT(i915_gem_request, i915_gem_request_submit,
669 TP_PROTO(struct drm_i915_gem_request *req),
673 DEFINE_EVENT(i915_gem_request, i915_gem_request_execute,
674 TP_PROTO(struct drm_i915_gem_request *req),
678 DECLARE_EVENT_CLASS(i915_gem_request_hw,
679 TP_PROTO(struct drm_i915_gem_request *req,
687 __field(u32, global_seqno)
693 __entry->dev = req->i915->drm.primary->index;
694 __entry->ring = req->engine->id;
695 __entry->ctx = req->fence.context;
696 __entry->seqno = req->fence.seqno;
697 __entry->global_seqno = req->global_seqno;
698 __entry->port = port;
701 TP_printk("dev=%u, ring=%u, ctx=%u, seqno=%u, global=%u, port=%u",
702 __entry->dev, __entry->ring, __entry->ctx,
703 __entry->seqno, __entry->global_seqno,
707 DEFINE_EVENT(i915_gem_request_hw, i915_gem_request_in,
708 TP_PROTO(struct drm_i915_gem_request *req, unsigned int port),
712 DEFINE_EVENT(i915_gem_request, i915_gem_request_out,
713 TP_PROTO(struct drm_i915_gem_request *req),
717 #if !defined(TRACE_HEADER_MULTI_READ)
719 trace_i915_gem_request_submit(struct drm_i915_gem_request *req)
724 trace_i915_gem_request_execute(struct drm_i915_gem_request *req)
729 trace_i915_gem_request_in(struct drm_i915_gem_request *req, unsigned int port)
734 trace_i915_gem_request_out(struct drm_i915_gem_request *req)
740 TRACE_EVENT(intel_engine_notify,
741 TP_PROTO(struct intel_engine_cs *engine, bool waiters),
742 TP_ARGS(engine, waiters),
748 __field(bool, waiters)
752 __entry->dev = engine->i915->drm.primary->index;
753 __entry->ring = engine->id;
754 __entry->seqno = intel_engine_get_seqno(engine);
755 __entry->waiters = waiters;
758 TP_printk("dev=%u, ring=%u, seqno=%u, waiters=%u",
759 __entry->dev, __entry->ring, __entry->seqno,
763 DEFINE_EVENT(i915_gem_request, i915_gem_request_retire,
764 TP_PROTO(struct drm_i915_gem_request *req),
768 TRACE_EVENT(i915_gem_request_wait_begin,
769 TP_PROTO(struct drm_i915_gem_request *req, unsigned int flags),
778 __field(unsigned int, flags)
781 /* NB: the blocking information is racy since mutex_is_locked
782 * doesn't check that the current thread holds the lock. The only
783 * other option would be to pass the boolean information of whether
784 * or not the class was blocking down through the stack which is
788 __entry->dev = req->i915->drm.primary->index;
789 __entry->ring = req->engine->id;
790 __entry->ctx = req->fence.context;
791 __entry->seqno = req->fence.seqno;
792 __entry->global = req->global_seqno;
793 __entry->flags = flags;
796 TP_printk("dev=%u, ring=%u, ctx=%u, seqno=%u, global=%u, blocking=%u, flags=0x%x",
797 __entry->dev, __entry->ring, __entry->ctx, __entry->seqno,
798 __entry->global, !!(__entry->flags & I915_WAIT_LOCKED),
802 DEFINE_EVENT(i915_gem_request, i915_gem_request_wait_end,
803 TP_PROTO(struct drm_i915_gem_request *req),
807 TRACE_EVENT(i915_flip_request,
808 TP_PROTO(int plane, struct drm_i915_gem_object *obj),
814 __field(struct drm_i915_gem_object *, obj)
818 __entry->plane = plane;
822 TP_printk("plane=%d, obj=%p", __entry->plane, __entry->obj)
825 TRACE_EVENT(i915_flip_complete,
826 TP_PROTO(int plane, struct drm_i915_gem_object *obj),
832 __field(struct drm_i915_gem_object *, obj)
836 __entry->plane = plane;
840 TP_printk("plane=%d, obj=%p", __entry->plane, __entry->obj)
843 TRACE_EVENT_CONDITION(i915_reg_rw,
844 TP_PROTO(bool write, i915_reg_t reg, u64 val, int len, bool trace),
846 TP_ARGS(write, reg, val, len, trace),
858 __entry->val = (u64)val;
859 __entry->reg = i915_mmio_reg_offset(reg);
860 __entry->write = write;
864 TP_printk("%s reg=0x%x, len=%d, val=(0x%x, 0x%x)",
865 __entry->write ? "write" : "read",
866 __entry->reg, __entry->len,
867 (u32)(__entry->val & 0xffffffff),
868 (u32)(__entry->val >> 32))
871 TRACE_EVENT(intel_gpu_freq_change,
880 __entry->freq = freq;
883 TP_printk("new_freq=%u", __entry->freq)
887 * DOC: i915_ppgtt_create and i915_ppgtt_release tracepoints
889 * With full ppgtt enabled each process using drm will allocate at least one
890 * translation table. With these traces it is possible to keep track of the
891 * allocation and of the lifetime of the tables; this can be used during
892 * testing/debug to verify that we are not leaking ppgtts.
893 * These traces identify the ppgtt through the vm pointer, which is also printed
894 * by the i915_vma_bind and i915_vma_unbind tracepoints.
896 DECLARE_EVENT_CLASS(i915_ppgtt,
897 TP_PROTO(struct i915_address_space *vm),
901 __field(struct i915_address_space *, vm)
907 __entry->dev = vm->i915->drm.primary->index;
910 TP_printk("dev=%u, vm=%p", __entry->dev, __entry->vm)
913 DEFINE_EVENT(i915_ppgtt, i915_ppgtt_create,
914 TP_PROTO(struct i915_address_space *vm),
918 DEFINE_EVENT(i915_ppgtt, i915_ppgtt_release,
919 TP_PROTO(struct i915_address_space *vm),
924 * DOC: i915_context_create and i915_context_free tracepoints
926 * These tracepoints are used to track creation and deletion of contexts.
927 * If full ppgtt is enabled, they also print the address of the vm assigned to
930 DECLARE_EVENT_CLASS(i915_context,
931 TP_PROTO(struct i915_gem_context *ctx),
936 __field(struct i915_gem_context *, ctx)
938 __field(struct i915_address_space *, vm)
942 __entry->dev = ctx->i915->drm.primary->index;
944 __entry->hw_id = ctx->hw_id;
945 __entry->vm = ctx->ppgtt ? &ctx->ppgtt->base : NULL;
948 TP_printk("dev=%u, ctx=%p, ctx_vm=%p, hw_id=%u",
949 __entry->dev, __entry->ctx, __entry->vm, __entry->hw_id)
952 DEFINE_EVENT(i915_context, i915_context_create,
953 TP_PROTO(struct i915_gem_context *ctx),
957 DEFINE_EVENT(i915_context, i915_context_free,
958 TP_PROTO(struct i915_gem_context *ctx),
963 * DOC: switch_mm tracepoint
965 * This tracepoint allows tracking of the mm switch, which is an important point
966 * in the lifetime of the vm in the legacy submission path. This tracepoint is
967 * called only if full ppgtt is enabled.
969 TRACE_EVENT(switch_mm,
970 TP_PROTO(struct intel_engine_cs *engine, struct i915_gem_context *to),
976 __field(struct i915_gem_context *, to)
977 __field(struct i915_address_space *, vm)
982 __entry->ring = engine->id;
984 __entry->vm = to->ppgtt? &to->ppgtt->base : NULL;
985 __entry->dev = engine->i915->drm.primary->index;
988 TP_printk("dev=%u, ring=%u, ctx=%p, ctx_vm=%p",
989 __entry->dev, __entry->ring, __entry->to, __entry->vm)
992 #endif /* _I915_TRACE_H_ */
994 /* This part must be outside protection */
995 #undef TRACE_INCLUDE_PATH
996 #define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/i915
997 #include <trace/define_trace.h>