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