1 /* SPDX-License-Identifier: GPL-2.0 */
2 #if !defined(_I915_TRACE_H_) || defined(TRACE_HEADER_MULTI_READ)
5 #include <linux/stringify.h>
6 #include <linux/types.h>
7 #include <linux/tracepoint.h>
11 #include "intel_drv.h"
12 #include "intel_ringbuffer.h"
15 #define TRACE_SYSTEM i915
16 #define TRACE_INCLUDE_FILE i915_trace
18 /* watermark/fifo updates */
20 TRACE_EVENT(intel_cpu_fifo_underrun
,
21 TP_PROTO(struct drm_i915_private
*dev_priv
, enum pipe pipe
),
22 TP_ARGS(dev_priv
, pipe
),
25 __field(enum pipe
, pipe
)
27 __field(u32
, scanline
)
32 __entry
->frame
= dev_priv
->drm
.driver
->get_vblank_counter(&dev_priv
->drm
, pipe
);
33 __entry
->scanline
= intel_get_crtc_scanline(intel_get_crtc_for_pipe(dev_priv
, pipe
));
36 TP_printk("pipe %c, frame=%u, scanline=%u",
37 pipe_name(__entry
->pipe
),
38 __entry
->frame
, __entry
->scanline
)
41 TRACE_EVENT(intel_pch_fifo_underrun
,
42 TP_PROTO(struct drm_i915_private
*dev_priv
, enum pipe pch_transcoder
),
43 TP_ARGS(dev_priv
, pch_transcoder
),
46 __field(enum pipe
, pipe
)
48 __field(u32
, scanline
)
52 enum pipe pipe
= pch_transcoder
;
54 __entry
->frame
= dev_priv
->drm
.driver
->get_vblank_counter(&dev_priv
->drm
, pipe
);
55 __entry
->scanline
= intel_get_crtc_scanline(intel_get_crtc_for_pipe(dev_priv
, pipe
));
58 TP_printk("pch transcoder %c, frame=%u, scanline=%u",
59 pipe_name(__entry
->pipe
),
60 __entry
->frame
, __entry
->scanline
)
63 TRACE_EVENT(intel_memory_cxsr
,
64 TP_PROTO(struct drm_i915_private
*dev_priv
, bool old
, bool new),
65 TP_ARGS(dev_priv
, old
, new),
68 __array(u32
, frame
, 3)
69 __array(u32
, scanline
, 3)
76 for_each_pipe(dev_priv
, pipe
) {
77 __entry
->frame
[pipe
] =
78 dev_priv
->drm
.driver
->get_vblank_counter(&dev_priv
->drm
, pipe
);
79 __entry
->scanline
[pipe
] =
80 intel_get_crtc_scanline(intel_get_crtc_for_pipe(dev_priv
, pipe
));
86 TP_printk("%s->%s, pipe A: frame=%u, scanline=%u, pipe B: frame=%u, scanline=%u, pipe C: frame=%u, scanline=%u",
87 onoff(__entry
->old
), onoff(__entry
->new),
88 __entry
->frame
[PIPE_A
], __entry
->scanline
[PIPE_A
],
89 __entry
->frame
[PIPE_B
], __entry
->scanline
[PIPE_B
],
90 __entry
->frame
[PIPE_C
], __entry
->scanline
[PIPE_C
])
94 TP_PROTO(struct intel_crtc
*crtc
, const struct g4x_wm_values
*wm
),
98 __field(enum pipe
, pipe
)
100 __field(u32
, scanline
)
101 __field(u16
, primary
)
104 __field(u16
, sr_plane
)
105 __field(u16
, sr_cursor
)
107 __field(u16
, hpll_plane
)
108 __field(u16
, hpll_cursor
)
109 __field(u16
, hpll_fbc
)
116 __entry
->pipe
= crtc
->pipe
;
117 __entry
->frame
= crtc
->base
.dev
->driver
->get_vblank_counter(crtc
->base
.dev
,
119 __entry
->scanline
= intel_get_crtc_scanline(crtc
);
120 __entry
->primary
= wm
->pipe
[crtc
->pipe
].plane
[PLANE_PRIMARY
];
121 __entry
->sprite
= wm
->pipe
[crtc
->pipe
].plane
[PLANE_SPRITE0
];
122 __entry
->cursor
= wm
->pipe
[crtc
->pipe
].plane
[PLANE_CURSOR
];
123 __entry
->sr_plane
= wm
->sr
.plane
;
124 __entry
->sr_cursor
= wm
->sr
.cursor
;
125 __entry
->sr_fbc
= wm
->sr
.fbc
;
126 __entry
->hpll_plane
= wm
->hpll
.plane
;
127 __entry
->hpll_cursor
= wm
->hpll
.cursor
;
128 __entry
->hpll_fbc
= wm
->hpll
.fbc
;
129 __entry
->cxsr
= wm
->cxsr
;
130 __entry
->hpll
= wm
->hpll_en
;
131 __entry
->fbc
= wm
->fbc_en
;
134 TP_printk("pipe %c, frame=%u, scanline=%u, wm %d/%d/%d, sr %s/%d/%d/%d, hpll %s/%d/%d/%d, fbc %s",
135 pipe_name(__entry
->pipe
), __entry
->frame
, __entry
->scanline
,
136 __entry
->primary
, __entry
->sprite
, __entry
->cursor
,
137 yesno(__entry
->cxsr
), __entry
->sr_plane
, __entry
->sr_cursor
, __entry
->sr_fbc
,
138 yesno(__entry
->hpll
), __entry
->hpll_plane
, __entry
->hpll_cursor
, __entry
->hpll_fbc
,
143 TP_PROTO(struct intel_crtc
*crtc
, const struct vlv_wm_values
*wm
),
147 __field(enum pipe
, pipe
)
149 __field(u32
, scanline
)
152 __field(u32
, primary
)
153 __field(u32
, sprite0
)
154 __field(u32
, sprite1
)
156 __field(u32
, sr_plane
)
157 __field(u32
, sr_cursor
)
161 __entry
->pipe
= crtc
->pipe
;
162 __entry
->frame
= crtc
->base
.dev
->driver
->get_vblank_counter(crtc
->base
.dev
,
164 __entry
->scanline
= intel_get_crtc_scanline(crtc
);
165 __entry
->level
= wm
->level
;
166 __entry
->cxsr
= wm
->cxsr
;
167 __entry
->primary
= wm
->pipe
[crtc
->pipe
].plane
[PLANE_PRIMARY
];
168 __entry
->sprite0
= wm
->pipe
[crtc
->pipe
].plane
[PLANE_SPRITE0
];
169 __entry
->sprite1
= wm
->pipe
[crtc
->pipe
].plane
[PLANE_SPRITE1
];
170 __entry
->cursor
= wm
->pipe
[crtc
->pipe
].plane
[PLANE_CURSOR
];
171 __entry
->sr_plane
= wm
->sr
.plane
;
172 __entry
->sr_cursor
= wm
->sr
.cursor
;
175 TP_printk("pipe %c, frame=%u, scanline=%u, level=%d, cxsr=%d, wm %d/%d/%d/%d, sr %d/%d",
176 pipe_name(__entry
->pipe
), __entry
->frame
,
177 __entry
->scanline
, __entry
->level
, __entry
->cxsr
,
178 __entry
->primary
, __entry
->sprite0
, __entry
->sprite1
, __entry
->cursor
,
179 __entry
->sr_plane
, __entry
->sr_cursor
)
182 TRACE_EVENT(vlv_fifo_size
,
183 TP_PROTO(struct intel_crtc
*crtc
, u32 sprite0_start
, u32 sprite1_start
, u32 fifo_size
),
184 TP_ARGS(crtc
, sprite0_start
, sprite1_start
, fifo_size
),
187 __field(enum pipe
, pipe
)
189 __field(u32
, scanline
)
190 __field(u32
, sprite0_start
)
191 __field(u32
, sprite1_start
)
192 __field(u32
, fifo_size
)
196 __entry
->pipe
= crtc
->pipe
;
197 __entry
->frame
= crtc
->base
.dev
->driver
->get_vblank_counter(crtc
->base
.dev
,
199 __entry
->scanline
= intel_get_crtc_scanline(crtc
);
200 __entry
->sprite0_start
= sprite0_start
;
201 __entry
->sprite1_start
= sprite1_start
;
202 __entry
->fifo_size
= fifo_size
;
205 TP_printk("pipe %c, frame=%u, scanline=%u, %d/%d/%d",
206 pipe_name(__entry
->pipe
), __entry
->frame
,
207 __entry
->scanline
, __entry
->sprite0_start
,
208 __entry
->sprite1_start
, __entry
->fifo_size
)
213 TRACE_EVENT(intel_update_plane
,
214 TP_PROTO(struct drm_plane
*plane
, struct intel_crtc
*crtc
),
215 TP_ARGS(plane
, crtc
),
218 __field(enum pipe
, pipe
)
219 __field(const char *, name
)
221 __field(u32
, scanline
)
227 __entry
->pipe
= crtc
->pipe
;
228 __entry
->name
= plane
->name
;
229 __entry
->frame
= crtc
->base
.dev
->driver
->get_vblank_counter(crtc
->base
.dev
,
231 __entry
->scanline
= intel_get_crtc_scanline(crtc
);
232 memcpy(__entry
->src
, &plane
->state
->src
, sizeof(__entry
->src
));
233 memcpy(__entry
->dst
, &plane
->state
->dst
, sizeof(__entry
->dst
));
236 TP_printk("pipe %c, plane %s, frame=%u, scanline=%u, " DRM_RECT_FP_FMT
" -> " DRM_RECT_FMT
,
237 pipe_name(__entry
->pipe
), __entry
->name
,
238 __entry
->frame
, __entry
->scanline
,
239 DRM_RECT_FP_ARG((const struct drm_rect
*)__entry
->src
),
240 DRM_RECT_ARG((const struct drm_rect
*)__entry
->dst
))
243 TRACE_EVENT(intel_disable_plane
,
244 TP_PROTO(struct drm_plane
*plane
, struct intel_crtc
*crtc
),
245 TP_ARGS(plane
, crtc
),
248 __field(enum pipe
, pipe
)
249 __field(const char *, name
)
251 __field(u32
, scanline
)
255 __entry
->pipe
= crtc
->pipe
;
256 __entry
->name
= plane
->name
;
257 __entry
->frame
= crtc
->base
.dev
->driver
->get_vblank_counter(crtc
->base
.dev
,
259 __entry
->scanline
= intel_get_crtc_scanline(crtc
);
262 TP_printk("pipe %c, plane %s, frame=%u, scanline=%u",
263 pipe_name(__entry
->pipe
), __entry
->name
,
264 __entry
->frame
, __entry
->scanline
)
269 TRACE_EVENT(i915_pipe_update_start
,
270 TP_PROTO(struct intel_crtc
*crtc
),
274 __field(enum pipe
, pipe
)
276 __field(u32
, scanline
)
282 __entry
->pipe
= crtc
->pipe
;
283 __entry
->frame
= crtc
->base
.dev
->driver
->get_vblank_counter(crtc
->base
.dev
,
285 __entry
->scanline
= intel_get_crtc_scanline(crtc
);
286 __entry
->min
= crtc
->debug
.min_vbl
;
287 __entry
->max
= crtc
->debug
.max_vbl
;
290 TP_printk("pipe %c, frame=%u, scanline=%u, min=%u, max=%u",
291 pipe_name(__entry
->pipe
), __entry
->frame
,
292 __entry
->scanline
, __entry
->min
, __entry
->max
)
295 TRACE_EVENT(i915_pipe_update_vblank_evaded
,
296 TP_PROTO(struct intel_crtc
*crtc
),
300 __field(enum pipe
, pipe
)
302 __field(u32
, scanline
)
308 __entry
->pipe
= crtc
->pipe
;
309 __entry
->frame
= crtc
->debug
.start_vbl_count
;
310 __entry
->scanline
= crtc
->debug
.scanline_start
;
311 __entry
->min
= crtc
->debug
.min_vbl
;
312 __entry
->max
= crtc
->debug
.max_vbl
;
315 TP_printk("pipe %c, frame=%u, scanline=%u, min=%u, max=%u",
316 pipe_name(__entry
->pipe
), __entry
->frame
,
317 __entry
->scanline
, __entry
->min
, __entry
->max
)
320 TRACE_EVENT(i915_pipe_update_end
,
321 TP_PROTO(struct intel_crtc
*crtc
, u32 frame
, int scanline_end
),
322 TP_ARGS(crtc
, frame
, scanline_end
),
325 __field(enum pipe
, pipe
)
327 __field(u32
, scanline
)
331 __entry
->pipe
= crtc
->pipe
;
332 __entry
->frame
= frame
;
333 __entry
->scanline
= scanline_end
;
336 TP_printk("pipe %c, frame=%u, scanline=%u",
337 pipe_name(__entry
->pipe
), __entry
->frame
,
341 /* object tracking */
343 TRACE_EVENT(i915_gem_object_create
,
344 TP_PROTO(struct drm_i915_gem_object
*obj
),
348 __field(struct drm_i915_gem_object
*, obj
)
354 __entry
->size
= obj
->base
.size
;
357 TP_printk("obj=%p, size=0x%llx", __entry
->obj
, __entry
->size
)
360 TRACE_EVENT(i915_gem_shrink
,
361 TP_PROTO(struct drm_i915_private
*i915
, unsigned long target
, unsigned flags
),
362 TP_ARGS(i915
, target
, flags
),
366 __field(unsigned long, target
)
367 __field(unsigned, flags
)
371 __entry
->dev
= i915
->drm
.primary
->index
;
372 __entry
->target
= target
;
373 __entry
->flags
= flags
;
376 TP_printk("dev=%d, target=%lu, flags=%x",
377 __entry
->dev
, __entry
->target
, __entry
->flags
)
380 TRACE_EVENT(i915_vma_bind
,
381 TP_PROTO(struct i915_vma
*vma
, unsigned flags
),
385 __field(struct drm_i915_gem_object
*, obj
)
386 __field(struct i915_address_space
*, vm
)
389 __field(unsigned, flags
)
393 __entry
->obj
= vma
->obj
;
394 __entry
->vm
= vma
->vm
;
395 __entry
->offset
= vma
->node
.start
;
396 __entry
->size
= vma
->node
.size
;
397 __entry
->flags
= flags
;
400 TP_printk("obj=%p, offset=0x%016llx size=0x%llx%s vm=%p",
401 __entry
->obj
, __entry
->offset
, __entry
->size
,
402 __entry
->flags
& PIN_MAPPABLE
? ", mappable" : "",
406 TRACE_EVENT(i915_vma_unbind
,
407 TP_PROTO(struct i915_vma
*vma
),
411 __field(struct drm_i915_gem_object
*, obj
)
412 __field(struct i915_address_space
*, vm
)
418 __entry
->obj
= vma
->obj
;
419 __entry
->vm
= vma
->vm
;
420 __entry
->offset
= vma
->node
.start
;
421 __entry
->size
= vma
->node
.size
;
424 TP_printk("obj=%p, offset=0x%016llx size=0x%llx vm=%p",
425 __entry
->obj
, __entry
->offset
, __entry
->size
, __entry
->vm
)
428 TRACE_EVENT(i915_gem_object_pwrite
,
429 TP_PROTO(struct drm_i915_gem_object
*obj
, u64 offset
, u64 len
),
430 TP_ARGS(obj
, offset
, len
),
433 __field(struct drm_i915_gem_object
*, obj
)
440 __entry
->offset
= offset
;
444 TP_printk("obj=%p, offset=0x%llx, len=0x%llx",
445 __entry
->obj
, __entry
->offset
, __entry
->len
)
448 TRACE_EVENT(i915_gem_object_pread
,
449 TP_PROTO(struct drm_i915_gem_object
*obj
, u64 offset
, u64 len
),
450 TP_ARGS(obj
, offset
, len
),
453 __field(struct drm_i915_gem_object
*, obj
)
460 __entry
->offset
= offset
;
464 TP_printk("obj=%p, offset=0x%llx, len=0x%llx",
465 __entry
->obj
, __entry
->offset
, __entry
->len
)
468 TRACE_EVENT(i915_gem_object_fault
,
469 TP_PROTO(struct drm_i915_gem_object
*obj
, u64 index
, bool gtt
, bool write
),
470 TP_ARGS(obj
, index
, gtt
, write
),
473 __field(struct drm_i915_gem_object
*, obj
)
481 __entry
->index
= index
;
483 __entry
->write
= write
;
486 TP_printk("obj=%p, %s index=%llu %s",
488 __entry
->gtt
? "GTT" : "CPU",
490 __entry
->write
? ", writable" : "")
493 DECLARE_EVENT_CLASS(i915_gem_object
,
494 TP_PROTO(struct drm_i915_gem_object
*obj
),
498 __field(struct drm_i915_gem_object
*, obj
)
505 TP_printk("obj=%p", __entry
->obj
)
508 DEFINE_EVENT(i915_gem_object
, i915_gem_object_clflush
,
509 TP_PROTO(struct drm_i915_gem_object
*obj
),
513 DEFINE_EVENT(i915_gem_object
, i915_gem_object_destroy
,
514 TP_PROTO(struct drm_i915_gem_object
*obj
),
518 TRACE_EVENT(i915_gem_evict
,
519 TP_PROTO(struct i915_address_space
*vm
, u64 size
, u64 align
, unsigned int flags
),
520 TP_ARGS(vm
, size
, align
, flags
),
524 __field(struct i915_address_space
*, vm
)
527 __field(unsigned int, flags
)
531 __entry
->dev
= vm
->i915
->drm
.primary
->index
;
533 __entry
->size
= size
;
534 __entry
->align
= align
;
535 __entry
->flags
= flags
;
538 TP_printk("dev=%d, vm=%p, size=0x%llx, align=0x%llx %s",
539 __entry
->dev
, __entry
->vm
, __entry
->size
, __entry
->align
,
540 __entry
->flags
& PIN_MAPPABLE
? ", mappable" : "")
543 TRACE_EVENT(i915_gem_evict_node
,
544 TP_PROTO(struct i915_address_space
*vm
, struct drm_mm_node
*node
, unsigned int flags
),
545 TP_ARGS(vm
, node
, flags
),
549 __field(struct i915_address_space
*, vm
)
552 __field(unsigned long, color
)
553 __field(unsigned int, flags
)
557 __entry
->dev
= vm
->i915
->drm
.primary
->index
;
559 __entry
->start
= node
->start
;
560 __entry
->size
= node
->size
;
561 __entry
->color
= node
->color
;
562 __entry
->flags
= flags
;
565 TP_printk("dev=%d, vm=%p, start=0x%llx size=0x%llx, color=0x%lx, flags=%x",
566 __entry
->dev
, __entry
->vm
,
567 __entry
->start
, __entry
->size
,
568 __entry
->color
, __entry
->flags
)
571 TRACE_EVENT(i915_gem_evict_vm
,
572 TP_PROTO(struct i915_address_space
*vm
),
577 __field(struct i915_address_space
*, vm
)
581 __entry
->dev
= vm
->i915
->drm
.primary
->index
;
585 TP_printk("dev=%d, vm=%p", __entry
->dev
, __entry
->vm
)
588 TRACE_EVENT(i915_gem_ring_sync_to
,
589 TP_PROTO(struct i915_request
*to
, struct i915_request
*from
),
594 __field(u32
, from_class
)
595 __field(u32
, from_instance
)
596 __field(u32
, to_class
)
597 __field(u32
, to_instance
)
602 __entry
->dev
= from
->i915
->drm
.primary
->index
;
603 __entry
->from_class
= from
->engine
->uabi_class
;
604 __entry
->from_instance
= from
->engine
->instance
;
605 __entry
->to_class
= to
->engine
->uabi_class
;
606 __entry
->to_instance
= to
->engine
->instance
;
607 __entry
->seqno
= from
->global_seqno
;
610 TP_printk("dev=%u, sync-from=%u:%u, sync-to=%u:%u, seqno=%u",
612 __entry
->from_class
, __entry
->from_instance
,
613 __entry
->to_class
, __entry
->to_instance
,
617 TRACE_EVENT(i915_request_queue
,
618 TP_PROTO(struct i915_request
*rq
, u32 flags
),
626 __field(u16
, instance
)
632 __entry
->dev
= rq
->i915
->drm
.primary
->index
;
633 __entry
->hw_id
= rq
->gem_context
->hw_id
;
634 __entry
->class = rq
->engine
->uabi_class
;
635 __entry
->instance
= rq
->engine
->instance
;
636 __entry
->ctx
= rq
->fence
.context
;
637 __entry
->seqno
= rq
->fence
.seqno
;
638 __entry
->flags
= flags
;
641 TP_printk("dev=%u, engine=%u:%u, hw_id=%u, ctx=%llu, seqno=%u, flags=0x%x",
642 __entry
->dev
, __entry
->class, __entry
->instance
,
643 __entry
->hw_id
, __entry
->ctx
, __entry
->seqno
,
647 DECLARE_EVENT_CLASS(i915_request
,
648 TP_PROTO(struct i915_request
*rq
),
656 __field(u16
, instance
)
662 __entry
->dev
= rq
->i915
->drm
.primary
->index
;
663 __entry
->hw_id
= rq
->gem_context
->hw_id
;
664 __entry
->class = rq
->engine
->uabi_class
;
665 __entry
->instance
= rq
->engine
->instance
;
666 __entry
->ctx
= rq
->fence
.context
;
667 __entry
->seqno
= rq
->fence
.seqno
;
668 __entry
->global
= rq
->global_seqno
;
671 TP_printk("dev=%u, engine=%u:%u, hw_id=%u, ctx=%llu, seqno=%u, global=%u",
672 __entry
->dev
, __entry
->class, __entry
->instance
,
673 __entry
->hw_id
, __entry
->ctx
, __entry
->seqno
,
677 DEFINE_EVENT(i915_request
, i915_request_add
,
678 TP_PROTO(struct i915_request
*rq
),
682 #if defined(CONFIG_DRM_I915_LOW_LEVEL_TRACEPOINTS)
683 DEFINE_EVENT(i915_request
, i915_request_submit
,
684 TP_PROTO(struct i915_request
*rq
),
688 DEFINE_EVENT(i915_request
, i915_request_execute
,
689 TP_PROTO(struct i915_request
*rq
),
693 TRACE_EVENT(i915_request_in
,
694 TP_PROTO(struct i915_request
*rq
, unsigned int port
),
702 __field(u16
, instance
)
704 __field(u32
, global_seqno
)
710 __entry
->dev
= rq
->i915
->drm
.primary
->index
;
711 __entry
->hw_id
= rq
->gem_context
->hw_id
;
712 __entry
->class = rq
->engine
->uabi_class
;
713 __entry
->instance
= rq
->engine
->instance
;
714 __entry
->ctx
= rq
->fence
.context
;
715 __entry
->seqno
= rq
->fence
.seqno
;
716 __entry
->global_seqno
= rq
->global_seqno
;
717 __entry
->prio
= rq
->sched
.attr
.priority
;
718 __entry
->port
= port
;
721 TP_printk("dev=%u, engine=%u:%u, hw_id=%u, ctx=%llu, seqno=%u, prio=%u, global=%u, port=%u",
722 __entry
->dev
, __entry
->class, __entry
->instance
,
723 __entry
->hw_id
, __entry
->ctx
, __entry
->seqno
,
724 __entry
->prio
, __entry
->global_seqno
, __entry
->port
)
727 TRACE_EVENT(i915_request_out
,
728 TP_PROTO(struct i915_request
*rq
),
736 __field(u16
, instance
)
738 __field(u32
, global_seqno
)
739 __field(u32
, completed
)
743 __entry
->dev
= rq
->i915
->drm
.primary
->index
;
744 __entry
->hw_id
= rq
->gem_context
->hw_id
;
745 __entry
->class = rq
->engine
->uabi_class
;
746 __entry
->instance
= rq
->engine
->instance
;
747 __entry
->ctx
= rq
->fence
.context
;
748 __entry
->seqno
= rq
->fence
.seqno
;
749 __entry
->global_seqno
= rq
->global_seqno
;
750 __entry
->completed
= i915_request_completed(rq
);
753 TP_printk("dev=%u, engine=%u:%u, hw_id=%u, ctx=%llu, seqno=%u, global=%u, completed?=%u",
754 __entry
->dev
, __entry
->class, __entry
->instance
,
755 __entry
->hw_id
, __entry
->ctx
, __entry
->seqno
,
756 __entry
->global_seqno
, __entry
->completed
)
760 #if !defined(TRACE_HEADER_MULTI_READ)
762 trace_i915_request_submit(struct i915_request
*rq
)
767 trace_i915_request_execute(struct i915_request
*rq
)
772 trace_i915_request_in(struct i915_request
*rq
, unsigned int port
)
777 trace_i915_request_out(struct i915_request
*rq
)
783 TRACE_EVENT(intel_engine_notify
,
784 TP_PROTO(struct intel_engine_cs
*engine
, bool waiters
),
785 TP_ARGS(engine
, waiters
),
790 __field(u16
, instance
)
792 __field(bool, waiters
)
796 __entry
->dev
= engine
->i915
->drm
.primary
->index
;
797 __entry
->class = engine
->uabi_class
;
798 __entry
->instance
= engine
->instance
;
799 __entry
->seqno
= intel_engine_get_seqno(engine
);
800 __entry
->waiters
= waiters
;
803 TP_printk("dev=%u, engine=%u:%u, seqno=%u, waiters=%u",
804 __entry
->dev
, __entry
->class, __entry
->instance
,
805 __entry
->seqno
, __entry
->waiters
)
808 DEFINE_EVENT(i915_request
, i915_request_retire
,
809 TP_PROTO(struct i915_request
*rq
),
813 TRACE_EVENT(i915_request_wait_begin
,
814 TP_PROTO(struct i915_request
*rq
, unsigned int flags
),
822 __field(u16
, instance
)
825 __field(unsigned int, flags
)
828 /* NB: the blocking information is racy since mutex_is_locked
829 * doesn't check that the current thread holds the lock. The only
830 * other option would be to pass the boolean information of whether
831 * or not the class was blocking down through the stack which is
835 __entry
->dev
= rq
->i915
->drm
.primary
->index
;
836 __entry
->hw_id
= rq
->gem_context
->hw_id
;
837 __entry
->class = rq
->engine
->uabi_class
;
838 __entry
->instance
= rq
->engine
->instance
;
839 __entry
->ctx
= rq
->fence
.context
;
840 __entry
->seqno
= rq
->fence
.seqno
;
841 __entry
->global
= rq
->global_seqno
;
842 __entry
->flags
= flags
;
845 TP_printk("dev=%u, engine=%u:%u, hw_id=%u, ctx=%llu, seqno=%u, global=%u, blocking=%u, flags=0x%x",
846 __entry
->dev
, __entry
->class, __entry
->instance
,
847 __entry
->hw_id
, __entry
->ctx
, __entry
->seqno
,
848 __entry
->global
, !!(__entry
->flags
& I915_WAIT_LOCKED
),
852 DEFINE_EVENT(i915_request
, i915_request_wait_end
,
853 TP_PROTO(struct i915_request
*rq
),
857 TRACE_EVENT_CONDITION(i915_reg_rw
,
858 TP_PROTO(bool write
, i915_reg_t reg
, u64 val
, int len
, bool trace
),
860 TP_ARGS(write
, reg
, val
, len
, trace
),
872 __entry
->val
= (u64
)val
;
873 __entry
->reg
= i915_mmio_reg_offset(reg
);
874 __entry
->write
= write
;
878 TP_printk("%s reg=0x%x, len=%d, val=(0x%x, 0x%x)",
879 __entry
->write
? "write" : "read",
880 __entry
->reg
, __entry
->len
,
881 (u32
)(__entry
->val
& 0xffffffff),
882 (u32
)(__entry
->val
>> 32))
885 TRACE_EVENT(intel_gpu_freq_change
,
894 __entry
->freq
= freq
;
897 TP_printk("new_freq=%u", __entry
->freq
)
901 * DOC: i915_ppgtt_create and i915_ppgtt_release tracepoints
903 * With full ppgtt enabled each process using drm will allocate at least one
904 * translation table. With these traces it is possible to keep track of the
905 * allocation and of the lifetime of the tables; this can be used during
906 * testing/debug to verify that we are not leaking ppgtts.
907 * These traces identify the ppgtt through the vm pointer, which is also printed
908 * by the i915_vma_bind and i915_vma_unbind tracepoints.
910 DECLARE_EVENT_CLASS(i915_ppgtt
,
911 TP_PROTO(struct i915_address_space
*vm
),
915 __field(struct i915_address_space
*, vm
)
921 __entry
->dev
= vm
->i915
->drm
.primary
->index
;
924 TP_printk("dev=%u, vm=%p", __entry
->dev
, __entry
->vm
)
927 DEFINE_EVENT(i915_ppgtt
, i915_ppgtt_create
,
928 TP_PROTO(struct i915_address_space
*vm
),
932 DEFINE_EVENT(i915_ppgtt
, i915_ppgtt_release
,
933 TP_PROTO(struct i915_address_space
*vm
),
938 * DOC: i915_context_create and i915_context_free tracepoints
940 * These tracepoints are used to track creation and deletion of contexts.
941 * If full ppgtt is enabled, they also print the address of the vm assigned to
944 DECLARE_EVENT_CLASS(i915_context
,
945 TP_PROTO(struct i915_gem_context
*ctx
),
950 __field(struct i915_gem_context
*, ctx
)
952 __field(struct i915_address_space
*, vm
)
956 __entry
->dev
= ctx
->i915
->drm
.primary
->index
;
958 __entry
->hw_id
= ctx
->hw_id
;
959 __entry
->vm
= ctx
->ppgtt
? &ctx
->ppgtt
->vm
: NULL
;
962 TP_printk("dev=%u, ctx=%p, ctx_vm=%p, hw_id=%u",
963 __entry
->dev
, __entry
->ctx
, __entry
->vm
, __entry
->hw_id
)
966 DEFINE_EVENT(i915_context
, i915_context_create
,
967 TP_PROTO(struct i915_gem_context
*ctx
),
971 DEFINE_EVENT(i915_context
, i915_context_free
,
972 TP_PROTO(struct i915_gem_context
*ctx
),
976 #endif /* _I915_TRACE_H_ */
978 /* This part must be outside protection */
979 #undef TRACE_INCLUDE_PATH
980 #define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/i915
981 #include <trace/define_trace.h>