Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 1 | #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 Wilson | 05394f3 | 2010-11-08 19:18:58 +0000 | [diff] [blame] | 9 | #include "i915_drv.h" |
Ville Syrjälä | 25ef284 | 2014-04-29 13:35:48 +0300 | [diff] [blame] | 10 | #include "intel_drv.h" |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 11 | #include "intel_ringbuffer.h" |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 12 | |
| 13 | #undef TRACE_SYSTEM |
| 14 | #define TRACE_SYSTEM i915 |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 15 | #define TRACE_INCLUDE_FILE i915_trace |
| 16 | |
Ville Syrjälä | 25ef284 | 2014-04-29 13:35:48 +0300 | [diff] [blame] | 17 | /* pipe updates */ |
| 18 | |
| 19 | TRACE_EVENT(i915_pipe_update_start, |
Jesse Barnes | d637ce3 | 2015-09-17 08:08:32 -0700 | [diff] [blame] | 20 | TP_PROTO(struct intel_crtc *crtc), |
| 21 | TP_ARGS(crtc), |
Ville Syrjälä | 25ef284 | 2014-04-29 13:35:48 +0300 | [diff] [blame] | 22 | |
| 23 | TP_STRUCT__entry( |
| 24 | __field(enum pipe, pipe) |
| 25 | __field(u32, frame) |
| 26 | __field(u32, scanline) |
| 27 | __field(u32, min) |
| 28 | __field(u32, max) |
| 29 | ), |
| 30 | |
| 31 | TP_fast_assign( |
| 32 | __entry->pipe = crtc->pipe; |
| 33 | __entry->frame = crtc->base.dev->driver->get_vblank_counter(crtc->base.dev, |
| 34 | crtc->pipe); |
| 35 | __entry->scanline = intel_get_crtc_scanline(crtc); |
Jesse Barnes | d637ce3 | 2015-09-17 08:08:32 -0700 | [diff] [blame] | 36 | __entry->min = crtc->debug.min_vbl; |
| 37 | __entry->max = crtc->debug.max_vbl; |
Ville Syrjälä | 25ef284 | 2014-04-29 13:35:48 +0300 | [diff] [blame] | 38 | ), |
| 39 | |
| 40 | TP_printk("pipe %c, frame=%u, scanline=%u, min=%u, max=%u", |
| 41 | pipe_name(__entry->pipe), __entry->frame, |
| 42 | __entry->scanline, __entry->min, __entry->max) |
| 43 | ); |
| 44 | |
| 45 | TRACE_EVENT(i915_pipe_update_vblank_evaded, |
Jesse Barnes | d637ce3 | 2015-09-17 08:08:32 -0700 | [diff] [blame] | 46 | TP_PROTO(struct intel_crtc *crtc), |
| 47 | TP_ARGS(crtc), |
Ville Syrjälä | 25ef284 | 2014-04-29 13:35:48 +0300 | [diff] [blame] | 48 | |
| 49 | TP_STRUCT__entry( |
| 50 | __field(enum pipe, pipe) |
| 51 | __field(u32, frame) |
| 52 | __field(u32, scanline) |
| 53 | __field(u32, min) |
| 54 | __field(u32, max) |
| 55 | ), |
| 56 | |
| 57 | TP_fast_assign( |
| 58 | __entry->pipe = crtc->pipe; |
Jesse Barnes | d637ce3 | 2015-09-17 08:08:32 -0700 | [diff] [blame] | 59 | __entry->frame = crtc->debug.start_vbl_count; |
| 60 | __entry->scanline = crtc->debug.scanline_start; |
| 61 | __entry->min = crtc->debug.min_vbl; |
| 62 | __entry->max = crtc->debug.max_vbl; |
Ville Syrjälä | 25ef284 | 2014-04-29 13:35:48 +0300 | [diff] [blame] | 63 | ), |
| 64 | |
| 65 | TP_printk("pipe %c, frame=%u, scanline=%u, min=%u, max=%u", |
| 66 | pipe_name(__entry->pipe), __entry->frame, |
| 67 | __entry->scanline, __entry->min, __entry->max) |
| 68 | ); |
| 69 | |
| 70 | TRACE_EVENT(i915_pipe_update_end, |
Jesse Barnes | d637ce3 | 2015-09-17 08:08:32 -0700 | [diff] [blame] | 71 | TP_PROTO(struct intel_crtc *crtc, u32 frame, int scanline_end), |
| 72 | TP_ARGS(crtc, frame, scanline_end), |
Ville Syrjälä | 25ef284 | 2014-04-29 13:35:48 +0300 | [diff] [blame] | 73 | |
| 74 | TP_STRUCT__entry( |
| 75 | __field(enum pipe, pipe) |
| 76 | __field(u32, frame) |
| 77 | __field(u32, scanline) |
| 78 | ), |
| 79 | |
| 80 | TP_fast_assign( |
| 81 | __entry->pipe = crtc->pipe; |
| 82 | __entry->frame = frame; |
Jesse Barnes | d637ce3 | 2015-09-17 08:08:32 -0700 | [diff] [blame] | 83 | __entry->scanline = scanline_end; |
Ville Syrjälä | 25ef284 | 2014-04-29 13:35:48 +0300 | [diff] [blame] | 84 | ), |
| 85 | |
| 86 | TP_printk("pipe %c, frame=%u, scanline=%u", |
| 87 | pipe_name(__entry->pipe), __entry->frame, |
| 88 | __entry->scanline) |
| 89 | ); |
| 90 | |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 91 | /* object tracking */ |
| 92 | |
| 93 | TRACE_EVENT(i915_gem_object_create, |
Chris Wilson | 05394f3 | 2010-11-08 19:18:58 +0000 | [diff] [blame] | 94 | TP_PROTO(struct drm_i915_gem_object *obj), |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 95 | TP_ARGS(obj), |
| 96 | |
| 97 | TP_STRUCT__entry( |
Chris Wilson | 05394f3 | 2010-11-08 19:18:58 +0000 | [diff] [blame] | 98 | __field(struct drm_i915_gem_object *, obj) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 99 | __field(u32, size) |
| 100 | ), |
| 101 | |
| 102 | TP_fast_assign( |
| 103 | __entry->obj = obj; |
Chris Wilson | 05394f3 | 2010-11-08 19:18:58 +0000 | [diff] [blame] | 104 | __entry->size = obj->base.size; |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 105 | ), |
| 106 | |
| 107 | TP_printk("obj=%p, size=%u", __entry->obj, __entry->size) |
| 108 | ); |
| 109 | |
Chris Wilson | 3abafa5 | 2015-10-01 12:18:26 +0100 | [diff] [blame] | 110 | TRACE_EVENT(i915_gem_shrink, |
| 111 | TP_PROTO(struct drm_i915_private *i915, unsigned long target, unsigned flags), |
| 112 | TP_ARGS(i915, target, flags), |
| 113 | |
| 114 | TP_STRUCT__entry( |
| 115 | __field(int, dev) |
| 116 | __field(unsigned long, target) |
| 117 | __field(unsigned, flags) |
| 118 | ), |
| 119 | |
| 120 | TP_fast_assign( |
Chris Wilson | 91c8a32 | 2016-07-05 10:40:23 +0100 | [diff] [blame] | 121 | __entry->dev = i915->drm.primary->index; |
Chris Wilson | 3abafa5 | 2015-10-01 12:18:26 +0100 | [diff] [blame] | 122 | __entry->target = target; |
| 123 | __entry->flags = flags; |
| 124 | ), |
| 125 | |
| 126 | TP_printk("dev=%d, target=%lu, flags=%x", |
| 127 | __entry->dev, __entry->target, __entry->flags) |
| 128 | ); |
| 129 | |
Ben Widawsky | 07fe0b1 | 2013-07-31 17:00:10 -0700 | [diff] [blame] | 130 | TRACE_EVENT(i915_vma_bind, |
Daniel Vetter | 1ec9e26 | 2014-02-14 14:01:11 +0100 | [diff] [blame] | 131 | TP_PROTO(struct i915_vma *vma, unsigned flags), |
| 132 | TP_ARGS(vma, flags), |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 133 | |
| 134 | TP_STRUCT__entry( |
Chris Wilson | 05394f3 | 2010-11-08 19:18:58 +0000 | [diff] [blame] | 135 | __field(struct drm_i915_gem_object *, obj) |
Ben Widawsky | 07fe0b1 | 2013-07-31 17:00:10 -0700 | [diff] [blame] | 136 | __field(struct i915_address_space *, vm) |
Ben Widawsky | 3393871 | 2015-01-22 17:01:23 +0000 | [diff] [blame] | 137 | __field(u64, offset) |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 138 | __field(u32, size) |
Daniel Vetter | 1ec9e26 | 2014-02-14 14:01:11 +0100 | [diff] [blame] | 139 | __field(unsigned, flags) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 140 | ), |
| 141 | |
| 142 | TP_fast_assign( |
Ben Widawsky | 07fe0b1 | 2013-07-31 17:00:10 -0700 | [diff] [blame] | 143 | __entry->obj = vma->obj; |
| 144 | __entry->vm = vma->vm; |
| 145 | __entry->offset = vma->node.start; |
| 146 | __entry->size = vma->node.size; |
Daniel Vetter | 1ec9e26 | 2014-02-14 14:01:11 +0100 | [diff] [blame] | 147 | __entry->flags = flags; |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 148 | ), |
| 149 | |
Ben Widawsky | 3393871 | 2015-01-22 17:01:23 +0000 | [diff] [blame] | 150 | TP_printk("obj=%p, offset=%016llx size=%x%s vm=%p", |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 151 | __entry->obj, __entry->offset, __entry->size, |
Daniel Vetter | 1ec9e26 | 2014-02-14 14:01:11 +0100 | [diff] [blame] | 152 | __entry->flags & PIN_MAPPABLE ? ", mappable" : "", |
Ben Widawsky | 07fe0b1 | 2013-07-31 17:00:10 -0700 | [diff] [blame] | 153 | __entry->vm) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 154 | ); |
| 155 | |
Ben Widawsky | 07fe0b1 | 2013-07-31 17:00:10 -0700 | [diff] [blame] | 156 | TRACE_EVENT(i915_vma_unbind, |
| 157 | TP_PROTO(struct i915_vma *vma), |
| 158 | TP_ARGS(vma), |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 159 | |
| 160 | TP_STRUCT__entry( |
| 161 | __field(struct drm_i915_gem_object *, obj) |
Ben Widawsky | 07fe0b1 | 2013-07-31 17:00:10 -0700 | [diff] [blame] | 162 | __field(struct i915_address_space *, vm) |
Ben Widawsky | 3393871 | 2015-01-22 17:01:23 +0000 | [diff] [blame] | 163 | __field(u64, offset) |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 164 | __field(u32, size) |
| 165 | ), |
| 166 | |
| 167 | TP_fast_assign( |
Ben Widawsky | 07fe0b1 | 2013-07-31 17:00:10 -0700 | [diff] [blame] | 168 | __entry->obj = vma->obj; |
| 169 | __entry->vm = vma->vm; |
| 170 | __entry->offset = vma->node.start; |
| 171 | __entry->size = vma->node.size; |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 172 | ), |
| 173 | |
Ben Widawsky | 3393871 | 2015-01-22 17:01:23 +0000 | [diff] [blame] | 174 | TP_printk("obj=%p, offset=%016llx size=%x vm=%p", |
Ben Widawsky | 07fe0b1 | 2013-07-31 17:00:10 -0700 | [diff] [blame] | 175 | __entry->obj, __entry->offset, __entry->size, __entry->vm) |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 176 | ); |
| 177 | |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 178 | TRACE_EVENT(i915_gem_object_change_domain, |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 179 | TP_PROTO(struct drm_i915_gem_object *obj, u32 old_read, u32 old_write), |
| 180 | TP_ARGS(obj, old_read, old_write), |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 181 | |
| 182 | TP_STRUCT__entry( |
Chris Wilson | 05394f3 | 2010-11-08 19:18:58 +0000 | [diff] [blame] | 183 | __field(struct drm_i915_gem_object *, obj) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 184 | __field(u32, read_domains) |
| 185 | __field(u32, write_domain) |
| 186 | ), |
| 187 | |
| 188 | TP_fast_assign( |
| 189 | __entry->obj = obj; |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 190 | __entry->read_domains = obj->base.read_domains | (old_read << 16); |
| 191 | __entry->write_domain = obj->base.write_domain | (old_write << 16); |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 192 | ), |
| 193 | |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 194 | TP_printk("obj=%p, read=%02x=>%02x, write=%02x=>%02x", |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 195 | __entry->obj, |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 196 | __entry->read_domains >> 16, |
| 197 | __entry->read_domains & 0xffff, |
| 198 | __entry->write_domain >> 16, |
| 199 | __entry->write_domain & 0xffff) |
| 200 | ); |
| 201 | |
| 202 | TRACE_EVENT(i915_gem_object_pwrite, |
| 203 | TP_PROTO(struct drm_i915_gem_object *obj, u32 offset, u32 len), |
| 204 | TP_ARGS(obj, offset, len), |
| 205 | |
| 206 | TP_STRUCT__entry( |
| 207 | __field(struct drm_i915_gem_object *, obj) |
| 208 | __field(u32, offset) |
| 209 | __field(u32, len) |
| 210 | ), |
| 211 | |
| 212 | TP_fast_assign( |
| 213 | __entry->obj = obj; |
| 214 | __entry->offset = offset; |
| 215 | __entry->len = len; |
| 216 | ), |
| 217 | |
| 218 | TP_printk("obj=%p, offset=%u, len=%u", |
| 219 | __entry->obj, __entry->offset, __entry->len) |
| 220 | ); |
| 221 | |
| 222 | TRACE_EVENT(i915_gem_object_pread, |
| 223 | TP_PROTO(struct drm_i915_gem_object *obj, u32 offset, u32 len), |
| 224 | TP_ARGS(obj, offset, len), |
| 225 | |
| 226 | TP_STRUCT__entry( |
| 227 | __field(struct drm_i915_gem_object *, obj) |
| 228 | __field(u32, offset) |
| 229 | __field(u32, len) |
| 230 | ), |
| 231 | |
| 232 | TP_fast_assign( |
| 233 | __entry->obj = obj; |
| 234 | __entry->offset = offset; |
| 235 | __entry->len = len; |
| 236 | ), |
| 237 | |
| 238 | TP_printk("obj=%p, offset=%u, len=%u", |
| 239 | __entry->obj, __entry->offset, __entry->len) |
| 240 | ); |
| 241 | |
| 242 | TRACE_EVENT(i915_gem_object_fault, |
| 243 | TP_PROTO(struct drm_i915_gem_object *obj, u32 index, bool gtt, bool write), |
| 244 | TP_ARGS(obj, index, gtt, write), |
| 245 | |
| 246 | TP_STRUCT__entry( |
| 247 | __field(struct drm_i915_gem_object *, obj) |
| 248 | __field(u32, index) |
| 249 | __field(bool, gtt) |
| 250 | __field(bool, write) |
| 251 | ), |
| 252 | |
| 253 | TP_fast_assign( |
| 254 | __entry->obj = obj; |
| 255 | __entry->index = index; |
| 256 | __entry->gtt = gtt; |
| 257 | __entry->write = write; |
| 258 | ), |
| 259 | |
| 260 | TP_printk("obj=%p, %s index=%u %s", |
| 261 | __entry->obj, |
| 262 | __entry->gtt ? "GTT" : "CPU", |
| 263 | __entry->index, |
| 264 | __entry->write ? ", writable" : "") |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 265 | ); |
| 266 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 267 | DECLARE_EVENT_CLASS(i915_gem_object, |
Chris Wilson | 05394f3 | 2010-11-08 19:18:58 +0000 | [diff] [blame] | 268 | TP_PROTO(struct drm_i915_gem_object *obj), |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 269 | TP_ARGS(obj), |
| 270 | |
| 271 | TP_STRUCT__entry( |
Chris Wilson | 05394f3 | 2010-11-08 19:18:58 +0000 | [diff] [blame] | 272 | __field(struct drm_i915_gem_object *, obj) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 273 | ), |
| 274 | |
| 275 | TP_fast_assign( |
| 276 | __entry->obj = obj; |
| 277 | ), |
| 278 | |
| 279 | TP_printk("obj=%p", __entry->obj) |
| 280 | ); |
| 281 | |
Li Zefan | f41275e | 2010-05-24 16:25:44 +0800 | [diff] [blame] | 282 | DEFINE_EVENT(i915_gem_object, i915_gem_object_clflush, |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 283 | TP_PROTO(struct drm_i915_gem_object *obj), |
| 284 | TP_ARGS(obj) |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 285 | ); |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 286 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 287 | DEFINE_EVENT(i915_gem_object, i915_gem_object_destroy, |
Chris Wilson | 05394f3 | 2010-11-08 19:18:58 +0000 | [diff] [blame] | 288 | TP_PROTO(struct drm_i915_gem_object *obj), |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 289 | TP_ARGS(obj) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 290 | ); |
| 291 | |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 292 | TRACE_EVENT(i915_gem_evict, |
Chris Wilson | e522ac2 | 2016-08-04 16:32:18 +0100 | [diff] [blame] | 293 | TP_PROTO(struct i915_address_space *vm, u32 size, u32 align, unsigned int flags), |
| 294 | TP_ARGS(vm, size, align, flags), |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 295 | |
| 296 | TP_STRUCT__entry( |
Chris Wilson | 4f49be5 | 2009-09-24 00:23:33 +0100 | [diff] [blame] | 297 | __field(u32, dev) |
Chris Wilson | e522ac2 | 2016-08-04 16:32:18 +0100 | [diff] [blame] | 298 | __field(struct i915_address_space *, vm) |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 299 | __field(u32, size) |
| 300 | __field(u32, align) |
Chris Wilson | e522ac2 | 2016-08-04 16:32:18 +0100 | [diff] [blame] | 301 | __field(unsigned int, flags) |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 302 | ), |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 303 | |
| 304 | TP_fast_assign( |
Chris Wilson | c6385c9 | 2016-11-29 12:42:05 +0000 | [diff] [blame] | 305 | __entry->dev = vm->i915->drm.primary->index; |
Chris Wilson | e522ac2 | 2016-08-04 16:32:18 +0100 | [diff] [blame] | 306 | __entry->vm = vm; |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 307 | __entry->size = size; |
| 308 | __entry->align = align; |
Daniel Vetter | 1ec9e26 | 2014-02-14 14:01:11 +0100 | [diff] [blame] | 309 | __entry->flags = flags; |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 310 | ), |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 311 | |
Chris Wilson | e522ac2 | 2016-08-04 16:32:18 +0100 | [diff] [blame] | 312 | TP_printk("dev=%d, vm=%p, size=%d, align=%d %s", |
| 313 | __entry->dev, __entry->vm, __entry->size, __entry->align, |
Daniel Vetter | 1ec9e26 | 2014-02-14 14:01:11 +0100 | [diff] [blame] | 314 | __entry->flags & PIN_MAPPABLE ? ", mappable" : "") |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 315 | ); |
| 316 | |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 317 | TRACE_EVENT(i915_gem_evict_everything, |
Chris Wilson | 6c085a7 | 2012-08-20 11:40:46 +0200 | [diff] [blame] | 318 | TP_PROTO(struct drm_device *dev), |
| 319 | TP_ARGS(dev), |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 320 | |
| 321 | TP_STRUCT__entry( |
Chris Wilson | 4f49be5 | 2009-09-24 00:23:33 +0100 | [diff] [blame] | 322 | __field(u32, dev) |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 323 | ), |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 324 | |
| 325 | TP_fast_assign( |
Chris Wilson | 4f49be5 | 2009-09-24 00:23:33 +0100 | [diff] [blame] | 326 | __entry->dev = dev->primary->index; |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 327 | ), |
| 328 | |
Chris Wilson | 6c085a7 | 2012-08-20 11:40:46 +0200 | [diff] [blame] | 329 | TP_printk("dev=%d", __entry->dev) |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 330 | ); |
| 331 | |
Ben Widawsky | bcccff8 | 2013-09-24 09:57:56 -0700 | [diff] [blame] | 332 | TRACE_EVENT(i915_gem_evict_vm, |
| 333 | TP_PROTO(struct i915_address_space *vm), |
| 334 | TP_ARGS(vm), |
| 335 | |
| 336 | TP_STRUCT__entry( |
Steven Rostedt | 9297ebf | 2014-03-18 11:27:37 -0400 | [diff] [blame] | 337 | __field(u32, dev) |
Ben Widawsky | bcccff8 | 2013-09-24 09:57:56 -0700 | [diff] [blame] | 338 | __field(struct i915_address_space *, vm) |
| 339 | ), |
| 340 | |
| 341 | TP_fast_assign( |
Chris Wilson | c6385c9 | 2016-11-29 12:42:05 +0000 | [diff] [blame] | 342 | __entry->dev = vm->i915->drm.primary->index; |
Ben Widawsky | bcccff8 | 2013-09-24 09:57:56 -0700 | [diff] [blame] | 343 | __entry->vm = vm; |
| 344 | ), |
| 345 | |
Steven Rostedt | 9297ebf | 2014-03-18 11:27:37 -0400 | [diff] [blame] | 346 | TP_printk("dev=%d, vm=%p", __entry->dev, __entry->vm) |
Ben Widawsky | bcccff8 | 2013-09-24 09:57:56 -0700 | [diff] [blame] | 347 | ); |
| 348 | |
Chris Wilson | 625d988 | 2017-01-11 11:23:11 +0000 | [diff] [blame] | 349 | TRACE_EVENT(i915_gem_evict_node, |
| 350 | TP_PROTO(struct i915_address_space *vm, struct drm_mm_node *node, unsigned int flags), |
| 351 | TP_ARGS(vm, node, flags), |
Chris Wilson | 172ae5b | 2016-12-05 14:29:37 +0000 | [diff] [blame] | 352 | |
| 353 | TP_STRUCT__entry( |
| 354 | __field(u32, dev) |
| 355 | __field(struct i915_address_space *, vm) |
| 356 | __field(u64, start) |
| 357 | __field(u64, size) |
| 358 | __field(unsigned long, color) |
| 359 | __field(unsigned int, flags) |
| 360 | ), |
| 361 | |
| 362 | TP_fast_assign( |
Chris Wilson | 625d988 | 2017-01-11 11:23:11 +0000 | [diff] [blame] | 363 | __entry->dev = vm->i915->drm.primary->index; |
| 364 | __entry->vm = vm; |
| 365 | __entry->start = node->start; |
| 366 | __entry->size = node->size; |
| 367 | __entry->color = node->color; |
Chris Wilson | 172ae5b | 2016-12-05 14:29:37 +0000 | [diff] [blame] | 368 | __entry->flags = flags; |
| 369 | ), |
| 370 | |
| 371 | TP_printk("dev=%d, vm=%p, start=%llx size=%llx, color=%lx, flags=%x", |
| 372 | __entry->dev, __entry->vm, |
| 373 | __entry->start, __entry->size, |
| 374 | __entry->color, __entry->flags) |
| 375 | ); |
| 376 | |
Chris Wilson | b52b89d | 2013-09-25 11:43:28 +0100 | [diff] [blame] | 377 | TRACE_EVENT(i915_gem_ring_sync_to, |
Chris Wilson | 8e63717 | 2016-08-02 22:50:26 +0100 | [diff] [blame] | 378 | TP_PROTO(struct drm_i915_gem_request *to, |
| 379 | struct drm_i915_gem_request *from), |
| 380 | TP_ARGS(to, from), |
Chris Wilson | b52b89d | 2013-09-25 11:43:28 +0100 | [diff] [blame] | 381 | |
| 382 | TP_STRUCT__entry( |
| 383 | __field(u32, dev) |
| 384 | __field(u32, sync_from) |
| 385 | __field(u32, sync_to) |
| 386 | __field(u32, seqno) |
| 387 | ), |
| 388 | |
| 389 | TP_fast_assign( |
Chris Wilson | 91c8a32 | 2016-07-05 10:40:23 +0100 | [diff] [blame] | 390 | __entry->dev = from->i915->drm.primary->index; |
Chris Wilson | 8e63717 | 2016-08-02 22:50:26 +0100 | [diff] [blame] | 391 | __entry->sync_from = from->engine->id; |
| 392 | __entry->sync_to = to->engine->id; |
Chris Wilson | 65e4760 | 2016-10-28 13:58:49 +0100 | [diff] [blame] | 393 | __entry->seqno = from->global_seqno; |
Chris Wilson | b52b89d | 2013-09-25 11:43:28 +0100 | [diff] [blame] | 394 | ), |
| 395 | |
| 396 | TP_printk("dev=%u, sync-from=%u, sync-to=%u, seqno=%u", |
| 397 | __entry->dev, |
| 398 | __entry->sync_from, __entry->sync_to, |
| 399 | __entry->seqno) |
| 400 | ); |
| 401 | |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 402 | TRACE_EVENT(i915_gem_ring_dispatch, |
John Harrison | 74328ee | 2014-11-24 18:49:38 +0000 | [diff] [blame] | 403 | TP_PROTO(struct drm_i915_gem_request *req, u32 flags), |
| 404 | TP_ARGS(req, flags), |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 405 | |
| 406 | TP_STRUCT__entry( |
| 407 | __field(u32, dev) |
| 408 | __field(u32, ring) |
| 409 | __field(u32, seqno) |
Chris Wilson | d7d4eed | 2012-10-17 12:09:54 +0100 | [diff] [blame] | 410 | __field(u32, flags) |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 411 | ), |
| 412 | |
| 413 | TP_fast_assign( |
Chris Wilson | 91c8a32 | 2016-07-05 10:40:23 +0100 | [diff] [blame] | 414 | __entry->dev = req->i915->drm.primary->index; |
Chris Wilson | c033666 | 2016-05-06 15:40:21 +0100 | [diff] [blame] | 415 | __entry->ring = req->engine->id; |
Chris Wilson | 65e4760 | 2016-10-28 13:58:49 +0100 | [diff] [blame] | 416 | __entry->seqno = req->global_seqno; |
Chris Wilson | d7d4eed | 2012-10-17 12:09:54 +0100 | [diff] [blame] | 417 | __entry->flags = flags; |
Chris Wilson | f54d186 | 2016-10-25 13:00:45 +0100 | [diff] [blame] | 418 | dma_fence_enable_sw_signaling(&req->fence); |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 419 | ), |
| 420 | |
Chris Wilson | d7d4eed | 2012-10-17 12:09:54 +0100 | [diff] [blame] | 421 | TP_printk("dev=%u, ring=%u, seqno=%u, flags=%x", |
| 422 | __entry->dev, __entry->ring, __entry->seqno, __entry->flags) |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 423 | ); |
| 424 | |
| 425 | TRACE_EVENT(i915_gem_ring_flush, |
John Harrison | a84c3ae | 2015-05-29 17:43:57 +0100 | [diff] [blame] | 426 | TP_PROTO(struct drm_i915_gem_request *req, u32 invalidate, u32 flush), |
| 427 | TP_ARGS(req, invalidate, flush), |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 428 | |
| 429 | TP_STRUCT__entry( |
| 430 | __field(u32, dev) |
| 431 | __field(u32, ring) |
| 432 | __field(u32, invalidate) |
| 433 | __field(u32, flush) |
| 434 | ), |
| 435 | |
| 436 | TP_fast_assign( |
Chris Wilson | 91c8a32 | 2016-07-05 10:40:23 +0100 | [diff] [blame] | 437 | __entry->dev = req->i915->drm.primary->index; |
Tvrtko Ursulin | 4a570db | 2016-03-16 11:00:38 +0000 | [diff] [blame] | 438 | __entry->ring = req->engine->id; |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 439 | __entry->invalidate = invalidate; |
| 440 | __entry->flush = flush; |
| 441 | ), |
| 442 | |
| 443 | TP_printk("dev=%u, ring=%x, invalidate=%04x, flush=%04x", |
| 444 | __entry->dev, __entry->ring, |
| 445 | __entry->invalidate, __entry->flush) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 446 | ); |
| 447 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 448 | DECLARE_EVENT_CLASS(i915_gem_request, |
John Harrison | 74328ee | 2014-11-24 18:49:38 +0000 | [diff] [blame] | 449 | TP_PROTO(struct drm_i915_gem_request *req), |
| 450 | TP_ARGS(req), |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 451 | |
| 452 | TP_STRUCT__entry( |
Chris Wilson | 4f49be5 | 2009-09-24 00:23:33 +0100 | [diff] [blame] | 453 | __field(u32, dev) |
Tvrtko Ursulin | e235b53 | 2017-02-21 09:13:43 +0000 | [diff] [blame^] | 454 | __field(u32, ctx) |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 455 | __field(u32, ring) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 456 | __field(u32, seqno) |
Tvrtko Ursulin | e235b53 | 2017-02-21 09:13:43 +0000 | [diff] [blame^] | 457 | __field(u32, global) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 458 | ), |
| 459 | |
| 460 | TP_fast_assign( |
Chris Wilson | 91c8a32 | 2016-07-05 10:40:23 +0100 | [diff] [blame] | 461 | __entry->dev = req->i915->drm.primary->index; |
Tvrtko Ursulin | e235b53 | 2017-02-21 09:13:43 +0000 | [diff] [blame^] | 462 | __entry->ctx = req->ctx->hw_id; |
Chris Wilson | c033666 | 2016-05-06 15:40:21 +0100 | [diff] [blame] | 463 | __entry->ring = req->engine->id; |
Tvrtko Ursulin | e235b53 | 2017-02-21 09:13:43 +0000 | [diff] [blame^] | 464 | __entry->seqno = req->fence.seqno; |
| 465 | __entry->global = req->global_seqno; |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 466 | ), |
| 467 | |
Tvrtko Ursulin | e235b53 | 2017-02-21 09:13:43 +0000 | [diff] [blame^] | 468 | TP_printk("dev=%u, ring=%u, ctx=%u, seqno=%u, global=%u", |
| 469 | __entry->dev, __entry->ring, __entry->ctx, __entry->seqno, |
| 470 | __entry->global) |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 471 | ); |
| 472 | |
| 473 | DEFINE_EVENT(i915_gem_request, i915_gem_request_add, |
John Harrison | 74328ee | 2014-11-24 18:49:38 +0000 | [diff] [blame] | 474 | TP_PROTO(struct drm_i915_gem_request *req), |
| 475 | TP_ARGS(req) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 476 | ); |
| 477 | |
John Harrison | bcfcc8b | 2014-12-05 13:49:36 +0000 | [diff] [blame] | 478 | TRACE_EVENT(i915_gem_request_notify, |
Tvrtko Ursulin | 4a570db | 2016-03-16 11:00:38 +0000 | [diff] [blame] | 479 | TP_PROTO(struct intel_engine_cs *engine), |
| 480 | TP_ARGS(engine), |
Chris Wilson | 814e9b5 | 2013-09-23 17:33:19 -0300 | [diff] [blame] | 481 | |
| 482 | TP_STRUCT__entry( |
| 483 | __field(u32, dev) |
| 484 | __field(u32, ring) |
| 485 | __field(u32, seqno) |
| 486 | ), |
| 487 | |
| 488 | TP_fast_assign( |
Chris Wilson | 91c8a32 | 2016-07-05 10:40:23 +0100 | [diff] [blame] | 489 | __entry->dev = engine->i915->drm.primary->index; |
Tvrtko Ursulin | 4a570db | 2016-03-16 11:00:38 +0000 | [diff] [blame] | 490 | __entry->ring = engine->id; |
Chris Wilson | 1b7744e | 2016-07-01 17:23:17 +0100 | [diff] [blame] | 491 | __entry->seqno = intel_engine_get_seqno(engine); |
Chris Wilson | 814e9b5 | 2013-09-23 17:33:19 -0300 | [diff] [blame] | 492 | ), |
| 493 | |
| 494 | TP_printk("dev=%u, ring=%u, seqno=%u", |
| 495 | __entry->dev, __entry->ring, __entry->seqno) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 496 | ); |
| 497 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 498 | DEFINE_EVENT(i915_gem_request, i915_gem_request_retire, |
John Harrison | 74328ee | 2014-11-24 18:49:38 +0000 | [diff] [blame] | 499 | TP_PROTO(struct drm_i915_gem_request *req), |
| 500 | TP_ARGS(req) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 501 | ); |
| 502 | |
John Harrison | bcfcc8b | 2014-12-05 13:49:36 +0000 | [diff] [blame] | 503 | DEFINE_EVENT(i915_gem_request, i915_gem_request_complete, |
| 504 | TP_PROTO(struct drm_i915_gem_request *req), |
| 505 | TP_ARGS(req) |
| 506 | ); |
| 507 | |
Ben Widawsky | f3fd376 | 2012-05-24 15:03:09 -0700 | [diff] [blame] | 508 | TRACE_EVENT(i915_gem_request_wait_begin, |
John Harrison | 74328ee | 2014-11-24 18:49:38 +0000 | [diff] [blame] | 509 | TP_PROTO(struct drm_i915_gem_request *req), |
| 510 | TP_ARGS(req), |
Ben Widawsky | f3fd376 | 2012-05-24 15:03:09 -0700 | [diff] [blame] | 511 | |
| 512 | TP_STRUCT__entry( |
| 513 | __field(u32, dev) |
| 514 | __field(u32, ring) |
| 515 | __field(u32, seqno) |
| 516 | __field(bool, blocking) |
| 517 | ), |
| 518 | |
| 519 | /* NB: the blocking information is racy since mutex_is_locked |
| 520 | * doesn't check that the current thread holds the lock. The only |
| 521 | * other option would be to pass the boolean information of whether |
| 522 | * or not the class was blocking down through the stack which is |
| 523 | * less desirable. |
| 524 | */ |
| 525 | TP_fast_assign( |
Chris Wilson | 91c8a32 | 2016-07-05 10:40:23 +0100 | [diff] [blame] | 526 | __entry->dev = req->i915->drm.primary->index; |
Chris Wilson | c033666 | 2016-05-06 15:40:21 +0100 | [diff] [blame] | 527 | __entry->ring = req->engine->id; |
Chris Wilson | 65e4760 | 2016-10-28 13:58:49 +0100 | [diff] [blame] | 528 | __entry->seqno = req->global_seqno; |
John Harrison | 74328ee | 2014-11-24 18:49:38 +0000 | [diff] [blame] | 529 | __entry->blocking = |
Chris Wilson | 91c8a32 | 2016-07-05 10:40:23 +0100 | [diff] [blame] | 530 | mutex_is_locked(&req->i915->drm.struct_mutex); |
Ben Widawsky | f3fd376 | 2012-05-24 15:03:09 -0700 | [diff] [blame] | 531 | ), |
| 532 | |
Chris Wilson | d7b9ca2 | 2015-04-07 16:21:09 +0100 | [diff] [blame] | 533 | TP_printk("dev=%u, ring=%u, seqno=%u, blocking=%s", |
| 534 | __entry->dev, __entry->ring, |
John Harrison | bcfcc8b | 2014-12-05 13:49:36 +0000 | [diff] [blame] | 535 | __entry->seqno, __entry->blocking ? "yes (NB)" : "no") |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 536 | ); |
| 537 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 538 | DEFINE_EVENT(i915_gem_request, i915_gem_request_wait_end, |
John Harrison | 74328ee | 2014-11-24 18:49:38 +0000 | [diff] [blame] | 539 | TP_PROTO(struct drm_i915_gem_request *req), |
| 540 | TP_ARGS(req) |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 541 | ); |
| 542 | |
Jesse Barnes | e5510fa | 2010-07-01 16:48:37 -0700 | [diff] [blame] | 543 | TRACE_EVENT(i915_flip_request, |
Chris Wilson | 05394f3 | 2010-11-08 19:18:58 +0000 | [diff] [blame] | 544 | TP_PROTO(int plane, struct drm_i915_gem_object *obj), |
Jesse Barnes | e5510fa | 2010-07-01 16:48:37 -0700 | [diff] [blame] | 545 | |
| 546 | TP_ARGS(plane, obj), |
| 547 | |
| 548 | TP_STRUCT__entry( |
| 549 | __field(int, plane) |
Chris Wilson | 05394f3 | 2010-11-08 19:18:58 +0000 | [diff] [blame] | 550 | __field(struct drm_i915_gem_object *, obj) |
Jesse Barnes | e5510fa | 2010-07-01 16:48:37 -0700 | [diff] [blame] | 551 | ), |
| 552 | |
| 553 | TP_fast_assign( |
| 554 | __entry->plane = plane; |
| 555 | __entry->obj = obj; |
| 556 | ), |
| 557 | |
| 558 | TP_printk("plane=%d, obj=%p", __entry->plane, __entry->obj) |
| 559 | ); |
| 560 | |
| 561 | TRACE_EVENT(i915_flip_complete, |
Chris Wilson | 05394f3 | 2010-11-08 19:18:58 +0000 | [diff] [blame] | 562 | TP_PROTO(int plane, struct drm_i915_gem_object *obj), |
Jesse Barnes | e5510fa | 2010-07-01 16:48:37 -0700 | [diff] [blame] | 563 | |
| 564 | TP_ARGS(plane, obj), |
| 565 | |
| 566 | TP_STRUCT__entry( |
| 567 | __field(int, plane) |
Chris Wilson | 05394f3 | 2010-11-08 19:18:58 +0000 | [diff] [blame] | 568 | __field(struct drm_i915_gem_object *, obj) |
Jesse Barnes | e5510fa | 2010-07-01 16:48:37 -0700 | [diff] [blame] | 569 | ), |
| 570 | |
| 571 | TP_fast_assign( |
| 572 | __entry->plane = plane; |
| 573 | __entry->obj = obj; |
| 574 | ), |
| 575 | |
| 576 | TP_printk("plane=%d, obj=%p", __entry->plane, __entry->obj) |
| 577 | ); |
| 578 | |
Chris Wilson | ed71f1b | 2013-07-19 20:36:56 +0100 | [diff] [blame] | 579 | TRACE_EVENT_CONDITION(i915_reg_rw, |
Ville Syrjälä | f0f59a0 | 2015-11-18 15:33:26 +0200 | [diff] [blame] | 580 | TP_PROTO(bool write, i915_reg_t reg, u64 val, int len, bool trace), |
Yuanhan Liu | ba4f01a | 2010-11-08 17:09:41 +0800 | [diff] [blame] | 581 | |
Chris Wilson | ed71f1b | 2013-07-19 20:36:56 +0100 | [diff] [blame] | 582 | TP_ARGS(write, reg, val, len, trace), |
| 583 | |
| 584 | TP_CONDITION(trace), |
Yuanhan Liu | ba4f01a | 2010-11-08 17:09:41 +0800 | [diff] [blame] | 585 | |
Akshay Joshi | 0206e35 | 2011-08-16 15:34:10 -0400 | [diff] [blame] | 586 | TP_STRUCT__entry( |
| 587 | __field(u64, val) |
| 588 | __field(u32, reg) |
| 589 | __field(u16, write) |
| 590 | __field(u16, len) |
| 591 | ), |
Yuanhan Liu | ba4f01a | 2010-11-08 17:09:41 +0800 | [diff] [blame] | 592 | |
Akshay Joshi | 0206e35 | 2011-08-16 15:34:10 -0400 | [diff] [blame] | 593 | TP_fast_assign( |
| 594 | __entry->val = (u64)val; |
Ville Syrjälä | f0f59a0 | 2015-11-18 15:33:26 +0200 | [diff] [blame] | 595 | __entry->reg = i915_mmio_reg_offset(reg); |
Akshay Joshi | 0206e35 | 2011-08-16 15:34:10 -0400 | [diff] [blame] | 596 | __entry->write = write; |
| 597 | __entry->len = len; |
| 598 | ), |
Yuanhan Liu | ba4f01a | 2010-11-08 17:09:41 +0800 | [diff] [blame] | 599 | |
Akshay Joshi | 0206e35 | 2011-08-16 15:34:10 -0400 | [diff] [blame] | 600 | TP_printk("%s reg=0x%x, len=%d, val=(0x%x, 0x%x)", |
| 601 | __entry->write ? "write" : "read", |
| 602 | __entry->reg, __entry->len, |
| 603 | (u32)(__entry->val & 0xffffffff), |
| 604 | (u32)(__entry->val >> 32)) |
Yuanhan Liu | ba4f01a | 2010-11-08 17:09:41 +0800 | [diff] [blame] | 605 | ); |
| 606 | |
Daniel Vetter | be2cde9 | 2012-08-30 13:26:48 +0200 | [diff] [blame] | 607 | TRACE_EVENT(intel_gpu_freq_change, |
| 608 | TP_PROTO(u32 freq), |
| 609 | TP_ARGS(freq), |
| 610 | |
| 611 | TP_STRUCT__entry( |
| 612 | __field(u32, freq) |
| 613 | ), |
| 614 | |
| 615 | TP_fast_assign( |
| 616 | __entry->freq = freq; |
| 617 | ), |
| 618 | |
| 619 | TP_printk("new_freq=%u", __entry->freq) |
| 620 | ); |
| 621 | |
Daniele Ceraolo Spurio | 198c974 | 2014-11-10 13:44:31 +0000 | [diff] [blame] | 622 | /** |
| 623 | * DOC: i915_ppgtt_create and i915_ppgtt_release tracepoints |
| 624 | * |
| 625 | * With full ppgtt enabled each process using drm will allocate at least one |
| 626 | * translation table. With these traces it is possible to keep track of the |
| 627 | * allocation and of the lifetime of the tables; this can be used during |
| 628 | * testing/debug to verify that we are not leaking ppgtts. |
| 629 | * These traces identify the ppgtt through the vm pointer, which is also printed |
| 630 | * by the i915_vma_bind and i915_vma_unbind tracepoints. |
| 631 | */ |
| 632 | DECLARE_EVENT_CLASS(i915_ppgtt, |
| 633 | TP_PROTO(struct i915_address_space *vm), |
| 634 | TP_ARGS(vm), |
| 635 | |
| 636 | TP_STRUCT__entry( |
| 637 | __field(struct i915_address_space *, vm) |
| 638 | __field(u32, dev) |
| 639 | ), |
| 640 | |
| 641 | TP_fast_assign( |
| 642 | __entry->vm = vm; |
Chris Wilson | c6385c9 | 2016-11-29 12:42:05 +0000 | [diff] [blame] | 643 | __entry->dev = vm->i915->drm.primary->index; |
Daniele Ceraolo Spurio | 198c974 | 2014-11-10 13:44:31 +0000 | [diff] [blame] | 644 | ), |
| 645 | |
| 646 | TP_printk("dev=%u, vm=%p", __entry->dev, __entry->vm) |
| 647 | ) |
| 648 | |
| 649 | DEFINE_EVENT(i915_ppgtt, i915_ppgtt_create, |
| 650 | TP_PROTO(struct i915_address_space *vm), |
| 651 | TP_ARGS(vm) |
| 652 | ); |
| 653 | |
| 654 | DEFINE_EVENT(i915_ppgtt, i915_ppgtt_release, |
| 655 | TP_PROTO(struct i915_address_space *vm), |
| 656 | TP_ARGS(vm) |
| 657 | ); |
| 658 | |
| 659 | /** |
| 660 | * DOC: i915_context_create and i915_context_free tracepoints |
| 661 | * |
| 662 | * These tracepoints are used to track creation and deletion of contexts. |
| 663 | * If full ppgtt is enabled, they also print the address of the vm assigned to |
| 664 | * the context. |
| 665 | */ |
| 666 | DECLARE_EVENT_CLASS(i915_context, |
Chris Wilson | e2efd13 | 2016-05-24 14:53:34 +0100 | [diff] [blame] | 667 | TP_PROTO(struct i915_gem_context *ctx), |
Daniele Ceraolo Spurio | 198c974 | 2014-11-10 13:44:31 +0000 | [diff] [blame] | 668 | TP_ARGS(ctx), |
| 669 | |
| 670 | TP_STRUCT__entry( |
| 671 | __field(u32, dev) |
Chris Wilson | e2efd13 | 2016-05-24 14:53:34 +0100 | [diff] [blame] | 672 | __field(struct i915_gem_context *, ctx) |
Daniele Ceraolo Spurio | 198c974 | 2014-11-10 13:44:31 +0000 | [diff] [blame] | 673 | __field(struct i915_address_space *, vm) |
| 674 | ), |
| 675 | |
| 676 | TP_fast_assign( |
| 677 | __entry->ctx = ctx; |
| 678 | __entry->vm = ctx->ppgtt ? &ctx->ppgtt->base : NULL; |
Chris Wilson | 91c8a32 | 2016-07-05 10:40:23 +0100 | [diff] [blame] | 679 | __entry->dev = ctx->i915->drm.primary->index; |
Daniele Ceraolo Spurio | 198c974 | 2014-11-10 13:44:31 +0000 | [diff] [blame] | 680 | ), |
| 681 | |
| 682 | TP_printk("dev=%u, ctx=%p, ctx_vm=%p", |
| 683 | __entry->dev, __entry->ctx, __entry->vm) |
| 684 | ) |
| 685 | |
| 686 | DEFINE_EVENT(i915_context, i915_context_create, |
Chris Wilson | e2efd13 | 2016-05-24 14:53:34 +0100 | [diff] [blame] | 687 | TP_PROTO(struct i915_gem_context *ctx), |
Daniele Ceraolo Spurio | 198c974 | 2014-11-10 13:44:31 +0000 | [diff] [blame] | 688 | TP_ARGS(ctx) |
| 689 | ); |
| 690 | |
| 691 | DEFINE_EVENT(i915_context, i915_context_free, |
Chris Wilson | e2efd13 | 2016-05-24 14:53:34 +0100 | [diff] [blame] | 692 | TP_PROTO(struct i915_gem_context *ctx), |
Daniele Ceraolo Spurio | 198c974 | 2014-11-10 13:44:31 +0000 | [diff] [blame] | 693 | TP_ARGS(ctx) |
| 694 | ); |
| 695 | |
| 696 | /** |
| 697 | * DOC: switch_mm tracepoint |
| 698 | * |
| 699 | * This tracepoint allows tracking of the mm switch, which is an important point |
| 700 | * in the lifetime of the vm in the legacy submission path. This tracepoint is |
| 701 | * called only if full ppgtt is enabled. |
| 702 | */ |
| 703 | TRACE_EVENT(switch_mm, |
Chris Wilson | e2efd13 | 2016-05-24 14:53:34 +0100 | [diff] [blame] | 704 | TP_PROTO(struct intel_engine_cs *engine, struct i915_gem_context *to), |
Daniele Ceraolo Spurio | 198c974 | 2014-11-10 13:44:31 +0000 | [diff] [blame] | 705 | |
Tvrtko Ursulin | 4a570db | 2016-03-16 11:00:38 +0000 | [diff] [blame] | 706 | TP_ARGS(engine, to), |
Daniele Ceraolo Spurio | 198c974 | 2014-11-10 13:44:31 +0000 | [diff] [blame] | 707 | |
| 708 | TP_STRUCT__entry( |
| 709 | __field(u32, ring) |
Chris Wilson | e2efd13 | 2016-05-24 14:53:34 +0100 | [diff] [blame] | 710 | __field(struct i915_gem_context *, to) |
Daniele Ceraolo Spurio | 198c974 | 2014-11-10 13:44:31 +0000 | [diff] [blame] | 711 | __field(struct i915_address_space *, vm) |
| 712 | __field(u32, dev) |
| 713 | ), |
| 714 | |
| 715 | TP_fast_assign( |
Tvrtko Ursulin | 4a570db | 2016-03-16 11:00:38 +0000 | [diff] [blame] | 716 | __entry->ring = engine->id; |
Daniele Ceraolo Spurio | 198c974 | 2014-11-10 13:44:31 +0000 | [diff] [blame] | 717 | __entry->to = to; |
| 718 | __entry->vm = to->ppgtt? &to->ppgtt->base : NULL; |
Chris Wilson | 91c8a32 | 2016-07-05 10:40:23 +0100 | [diff] [blame] | 719 | __entry->dev = engine->i915->drm.primary->index; |
Daniele Ceraolo Spurio | 198c974 | 2014-11-10 13:44:31 +0000 | [diff] [blame] | 720 | ), |
| 721 | |
| 722 | TP_printk("dev=%u, ring=%u, ctx=%p, ctx_vm=%p", |
| 723 | __entry->dev, __entry->ring, __entry->to, __entry->vm) |
| 724 | ); |
| 725 | |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 726 | #endif /* _I915_TRACE_H_ */ |
| 727 | |
| 728 | /* This part must be outside protection */ |
| 729 | #undef TRACE_INCLUDE_PATH |
Peter Clifton | a7c5427 | 2010-05-03 13:24:41 +0100 | [diff] [blame] | 730 | #define TRACE_INCLUDE_PATH . |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 731 | #include <trace/define_trace.h> |