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" |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 10 | #include "intel_ringbuffer.h" |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 11 | |
| 12 | #undef TRACE_SYSTEM |
| 13 | #define TRACE_SYSTEM i915 |
| 14 | #define TRACE_SYSTEM_STRING __stringify(TRACE_SYSTEM) |
| 15 | #define TRACE_INCLUDE_FILE i915_trace |
| 16 | |
| 17 | /* object tracking */ |
| 18 | |
| 19 | TRACE_EVENT(i915_gem_object_create, |
Chris Wilson | 05394f3 | 2010-11-08 19:18:58 +0000 | [diff] [blame] | 20 | TP_PROTO(struct drm_i915_gem_object *obj), |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 21 | TP_ARGS(obj), |
| 22 | |
| 23 | TP_STRUCT__entry( |
Chris Wilson | 05394f3 | 2010-11-08 19:18:58 +0000 | [diff] [blame] | 24 | __field(struct drm_i915_gem_object *, obj) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 25 | __field(u32, size) |
| 26 | ), |
| 27 | |
| 28 | TP_fast_assign( |
| 29 | __entry->obj = obj; |
Chris Wilson | 05394f3 | 2010-11-08 19:18:58 +0000 | [diff] [blame] | 30 | __entry->size = obj->base.size; |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 31 | ), |
| 32 | |
| 33 | TP_printk("obj=%p, size=%u", __entry->obj, __entry->size) |
| 34 | ); |
| 35 | |
Ben Widawsky | 07fe0b1 | 2013-07-31 17:00:10 -0700 | [diff] [blame] | 36 | TRACE_EVENT(i915_vma_bind, |
| 37 | TP_PROTO(struct i915_vma *vma, bool mappable), |
| 38 | TP_ARGS(vma, mappable), |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 39 | |
| 40 | TP_STRUCT__entry( |
Chris Wilson | 05394f3 | 2010-11-08 19:18:58 +0000 | [diff] [blame] | 41 | __field(struct drm_i915_gem_object *, obj) |
Ben Widawsky | 07fe0b1 | 2013-07-31 17:00:10 -0700 | [diff] [blame] | 42 | __field(struct i915_address_space *, vm) |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 43 | __field(u32, offset) |
| 44 | __field(u32, size) |
Daniel Vetter | ec57d26 | 2010-09-30 23:42:15 +0200 | [diff] [blame] | 45 | __field(bool, mappable) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 46 | ), |
| 47 | |
| 48 | TP_fast_assign( |
Ben Widawsky | 07fe0b1 | 2013-07-31 17:00:10 -0700 | [diff] [blame] | 49 | __entry->obj = vma->obj; |
| 50 | __entry->vm = vma->vm; |
| 51 | __entry->offset = vma->node.start; |
| 52 | __entry->size = vma->node.size; |
Daniel Vetter | ec57d26 | 2010-09-30 23:42:15 +0200 | [diff] [blame] | 53 | __entry->mappable = mappable; |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 54 | ), |
| 55 | |
Ben Widawsky | 07fe0b1 | 2013-07-31 17:00:10 -0700 | [diff] [blame] | 56 | TP_printk("obj=%p, offset=%08x size=%x%s vm=%p", |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 57 | __entry->obj, __entry->offset, __entry->size, |
Ben Widawsky | 07fe0b1 | 2013-07-31 17:00:10 -0700 | [diff] [blame] | 58 | __entry->mappable ? ", mappable" : "", |
| 59 | __entry->vm) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 60 | ); |
| 61 | |
Ben Widawsky | 07fe0b1 | 2013-07-31 17:00:10 -0700 | [diff] [blame] | 62 | TRACE_EVENT(i915_vma_unbind, |
| 63 | TP_PROTO(struct i915_vma *vma), |
| 64 | TP_ARGS(vma), |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 65 | |
| 66 | TP_STRUCT__entry( |
| 67 | __field(struct drm_i915_gem_object *, obj) |
Ben Widawsky | 07fe0b1 | 2013-07-31 17:00:10 -0700 | [diff] [blame] | 68 | __field(struct i915_address_space *, vm) |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 69 | __field(u32, offset) |
| 70 | __field(u32, size) |
| 71 | ), |
| 72 | |
| 73 | TP_fast_assign( |
Ben Widawsky | 07fe0b1 | 2013-07-31 17:00:10 -0700 | [diff] [blame] | 74 | __entry->obj = vma->obj; |
| 75 | __entry->vm = vma->vm; |
| 76 | __entry->offset = vma->node.start; |
| 77 | __entry->size = vma->node.size; |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 78 | ), |
| 79 | |
Ben Widawsky | 07fe0b1 | 2013-07-31 17:00:10 -0700 | [diff] [blame] | 80 | TP_printk("obj=%p, offset=%08x size=%x vm=%p", |
| 81 | __entry->obj, __entry->offset, __entry->size, __entry->vm) |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 82 | ); |
| 83 | |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 84 | TRACE_EVENT(i915_gem_object_change_domain, |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 85 | TP_PROTO(struct drm_i915_gem_object *obj, u32 old_read, u32 old_write), |
| 86 | TP_ARGS(obj, old_read, old_write), |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 87 | |
| 88 | TP_STRUCT__entry( |
Chris Wilson | 05394f3 | 2010-11-08 19:18:58 +0000 | [diff] [blame] | 89 | __field(struct drm_i915_gem_object *, obj) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 90 | __field(u32, read_domains) |
| 91 | __field(u32, write_domain) |
| 92 | ), |
| 93 | |
| 94 | TP_fast_assign( |
| 95 | __entry->obj = obj; |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 96 | __entry->read_domains = obj->base.read_domains | (old_read << 16); |
| 97 | __entry->write_domain = obj->base.write_domain | (old_write << 16); |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 98 | ), |
| 99 | |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 100 | TP_printk("obj=%p, read=%02x=>%02x, write=%02x=>%02x", |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 101 | __entry->obj, |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 102 | __entry->read_domains >> 16, |
| 103 | __entry->read_domains & 0xffff, |
| 104 | __entry->write_domain >> 16, |
| 105 | __entry->write_domain & 0xffff) |
| 106 | ); |
| 107 | |
| 108 | TRACE_EVENT(i915_gem_object_pwrite, |
| 109 | TP_PROTO(struct drm_i915_gem_object *obj, u32 offset, u32 len), |
| 110 | TP_ARGS(obj, offset, len), |
| 111 | |
| 112 | TP_STRUCT__entry( |
| 113 | __field(struct drm_i915_gem_object *, obj) |
| 114 | __field(u32, offset) |
| 115 | __field(u32, len) |
| 116 | ), |
| 117 | |
| 118 | TP_fast_assign( |
| 119 | __entry->obj = obj; |
| 120 | __entry->offset = offset; |
| 121 | __entry->len = len; |
| 122 | ), |
| 123 | |
| 124 | TP_printk("obj=%p, offset=%u, len=%u", |
| 125 | __entry->obj, __entry->offset, __entry->len) |
| 126 | ); |
| 127 | |
| 128 | TRACE_EVENT(i915_gem_object_pread, |
| 129 | TP_PROTO(struct drm_i915_gem_object *obj, u32 offset, u32 len), |
| 130 | TP_ARGS(obj, offset, len), |
| 131 | |
| 132 | TP_STRUCT__entry( |
| 133 | __field(struct drm_i915_gem_object *, obj) |
| 134 | __field(u32, offset) |
| 135 | __field(u32, len) |
| 136 | ), |
| 137 | |
| 138 | TP_fast_assign( |
| 139 | __entry->obj = obj; |
| 140 | __entry->offset = offset; |
| 141 | __entry->len = len; |
| 142 | ), |
| 143 | |
| 144 | TP_printk("obj=%p, offset=%u, len=%u", |
| 145 | __entry->obj, __entry->offset, __entry->len) |
| 146 | ); |
| 147 | |
| 148 | TRACE_EVENT(i915_gem_object_fault, |
| 149 | TP_PROTO(struct drm_i915_gem_object *obj, u32 index, bool gtt, bool write), |
| 150 | TP_ARGS(obj, index, gtt, write), |
| 151 | |
| 152 | TP_STRUCT__entry( |
| 153 | __field(struct drm_i915_gem_object *, obj) |
| 154 | __field(u32, index) |
| 155 | __field(bool, gtt) |
| 156 | __field(bool, write) |
| 157 | ), |
| 158 | |
| 159 | TP_fast_assign( |
| 160 | __entry->obj = obj; |
| 161 | __entry->index = index; |
| 162 | __entry->gtt = gtt; |
| 163 | __entry->write = write; |
| 164 | ), |
| 165 | |
| 166 | TP_printk("obj=%p, %s index=%u %s", |
| 167 | __entry->obj, |
| 168 | __entry->gtt ? "GTT" : "CPU", |
| 169 | __entry->index, |
| 170 | __entry->write ? ", writable" : "") |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 171 | ); |
| 172 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 173 | DECLARE_EVENT_CLASS(i915_gem_object, |
Chris Wilson | 05394f3 | 2010-11-08 19:18:58 +0000 | [diff] [blame] | 174 | TP_PROTO(struct drm_i915_gem_object *obj), |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 175 | TP_ARGS(obj), |
| 176 | |
| 177 | TP_STRUCT__entry( |
Chris Wilson | 05394f3 | 2010-11-08 19:18:58 +0000 | [diff] [blame] | 178 | __field(struct drm_i915_gem_object *, obj) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 179 | ), |
| 180 | |
| 181 | TP_fast_assign( |
| 182 | __entry->obj = obj; |
| 183 | ), |
| 184 | |
| 185 | TP_printk("obj=%p", __entry->obj) |
| 186 | ); |
| 187 | |
Li Zefan | f41275e | 2010-05-24 16:25:44 +0800 | [diff] [blame] | 188 | DEFINE_EVENT(i915_gem_object, i915_gem_object_clflush, |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 189 | TP_PROTO(struct drm_i915_gem_object *obj), |
| 190 | TP_ARGS(obj) |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 191 | ); |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 192 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 193 | DEFINE_EVENT(i915_gem_object, i915_gem_object_destroy, |
Chris Wilson | 05394f3 | 2010-11-08 19:18:58 +0000 | [diff] [blame] | 194 | TP_PROTO(struct drm_i915_gem_object *obj), |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 195 | TP_ARGS(obj) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 196 | ); |
| 197 | |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 198 | TRACE_EVENT(i915_gem_evict, |
| 199 | TP_PROTO(struct drm_device *dev, u32 size, u32 align, bool mappable), |
| 200 | TP_ARGS(dev, size, align, mappable), |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 201 | |
| 202 | TP_STRUCT__entry( |
Chris Wilson | 4f49be5 | 2009-09-24 00:23:33 +0100 | [diff] [blame] | 203 | __field(u32, dev) |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 204 | __field(u32, size) |
| 205 | __field(u32, align) |
| 206 | __field(bool, mappable) |
| 207 | ), |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 208 | |
| 209 | TP_fast_assign( |
Chris Wilson | 4f49be5 | 2009-09-24 00:23:33 +0100 | [diff] [blame] | 210 | __entry->dev = dev->primary->index; |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 211 | __entry->size = size; |
| 212 | __entry->align = align; |
| 213 | __entry->mappable = mappable; |
| 214 | ), |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 215 | |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 216 | TP_printk("dev=%d, size=%d, align=%d %s", |
| 217 | __entry->dev, __entry->size, __entry->align, |
| 218 | __entry->mappable ? ", mappable" : "") |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 219 | ); |
| 220 | |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 221 | TRACE_EVENT(i915_gem_evict_everything, |
Chris Wilson | 6c085a7 | 2012-08-20 11:40:46 +0200 | [diff] [blame] | 222 | TP_PROTO(struct drm_device *dev), |
| 223 | TP_ARGS(dev), |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 224 | |
| 225 | TP_STRUCT__entry( |
Chris Wilson | 4f49be5 | 2009-09-24 00:23:33 +0100 | [diff] [blame] | 226 | __field(u32, dev) |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 227 | ), |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 228 | |
| 229 | TP_fast_assign( |
Chris Wilson | 4f49be5 | 2009-09-24 00:23:33 +0100 | [diff] [blame] | 230 | __entry->dev = dev->primary->index; |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 231 | ), |
| 232 | |
Chris Wilson | 6c085a7 | 2012-08-20 11:40:46 +0200 | [diff] [blame] | 233 | TP_printk("dev=%d", __entry->dev) |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 234 | ); |
| 235 | |
Ben Widawsky | bcccff8 | 2013-09-24 09:57:56 -0700 | [diff] [blame] | 236 | TRACE_EVENT(i915_gem_evict_vm, |
| 237 | TP_PROTO(struct i915_address_space *vm), |
| 238 | TP_ARGS(vm), |
| 239 | |
| 240 | TP_STRUCT__entry( |
| 241 | __field(struct i915_address_space *, vm) |
| 242 | ), |
| 243 | |
| 244 | TP_fast_assign( |
| 245 | __entry->vm = vm; |
| 246 | ), |
| 247 | |
| 248 | TP_printk("dev=%d, vm=%p", __entry->vm->dev->primary->index, __entry->vm) |
| 249 | ); |
| 250 | |
Chris Wilson | b52b89d | 2013-09-25 11:43:28 +0100 | [diff] [blame] | 251 | TRACE_EVENT(i915_gem_ring_sync_to, |
| 252 | TP_PROTO(struct intel_ring_buffer *from, |
| 253 | struct intel_ring_buffer *to, |
| 254 | u32 seqno), |
| 255 | TP_ARGS(from, to, seqno), |
| 256 | |
| 257 | TP_STRUCT__entry( |
| 258 | __field(u32, dev) |
| 259 | __field(u32, sync_from) |
| 260 | __field(u32, sync_to) |
| 261 | __field(u32, seqno) |
| 262 | ), |
| 263 | |
| 264 | TP_fast_assign( |
| 265 | __entry->dev = from->dev->primary->index; |
| 266 | __entry->sync_from = from->id; |
| 267 | __entry->sync_to = to->id; |
| 268 | __entry->seqno = seqno; |
| 269 | ), |
| 270 | |
| 271 | TP_printk("dev=%u, sync-from=%u, sync-to=%u, seqno=%u", |
| 272 | __entry->dev, |
| 273 | __entry->sync_from, __entry->sync_to, |
| 274 | __entry->seqno) |
| 275 | ); |
| 276 | |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 277 | TRACE_EVENT(i915_gem_ring_dispatch, |
Chris Wilson | d7d4eed | 2012-10-17 12:09:54 +0100 | [diff] [blame] | 278 | TP_PROTO(struct intel_ring_buffer *ring, u32 seqno, u32 flags), |
| 279 | TP_ARGS(ring, seqno, flags), |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 280 | |
| 281 | TP_STRUCT__entry( |
| 282 | __field(u32, dev) |
| 283 | __field(u32, ring) |
| 284 | __field(u32, seqno) |
Chris Wilson | d7d4eed | 2012-10-17 12:09:54 +0100 | [diff] [blame] | 285 | __field(u32, flags) |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 286 | ), |
| 287 | |
| 288 | TP_fast_assign( |
| 289 | __entry->dev = ring->dev->primary->index; |
| 290 | __entry->ring = ring->id; |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 291 | __entry->seqno = seqno; |
Chris Wilson | d7d4eed | 2012-10-17 12:09:54 +0100 | [diff] [blame] | 292 | __entry->flags = flags; |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 293 | i915_trace_irq_get(ring, seqno); |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 294 | ), |
| 295 | |
Chris Wilson | d7d4eed | 2012-10-17 12:09:54 +0100 | [diff] [blame] | 296 | TP_printk("dev=%u, ring=%u, seqno=%u, flags=%x", |
| 297 | __entry->dev, __entry->ring, __entry->seqno, __entry->flags) |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 298 | ); |
| 299 | |
| 300 | TRACE_EVENT(i915_gem_ring_flush, |
| 301 | TP_PROTO(struct intel_ring_buffer *ring, u32 invalidate, u32 flush), |
| 302 | TP_ARGS(ring, invalidate, flush), |
| 303 | |
| 304 | TP_STRUCT__entry( |
| 305 | __field(u32, dev) |
| 306 | __field(u32, ring) |
| 307 | __field(u32, invalidate) |
| 308 | __field(u32, flush) |
| 309 | ), |
| 310 | |
| 311 | TP_fast_assign( |
| 312 | __entry->dev = ring->dev->primary->index; |
| 313 | __entry->ring = ring->id; |
| 314 | __entry->invalidate = invalidate; |
| 315 | __entry->flush = flush; |
| 316 | ), |
| 317 | |
| 318 | TP_printk("dev=%u, ring=%x, invalidate=%04x, flush=%04x", |
| 319 | __entry->dev, __entry->ring, |
| 320 | __entry->invalidate, __entry->flush) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 321 | ); |
| 322 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 323 | DECLARE_EVENT_CLASS(i915_gem_request, |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 324 | TP_PROTO(struct intel_ring_buffer *ring, u32 seqno), |
| 325 | TP_ARGS(ring, seqno), |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 326 | |
| 327 | TP_STRUCT__entry( |
Chris Wilson | 4f49be5 | 2009-09-24 00:23:33 +0100 | [diff] [blame] | 328 | __field(u32, dev) |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 329 | __field(u32, ring) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 330 | __field(u32, seqno) |
| 331 | ), |
| 332 | |
| 333 | TP_fast_assign( |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 334 | __entry->dev = ring->dev->primary->index; |
| 335 | __entry->ring = ring->id; |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 336 | __entry->seqno = seqno; |
| 337 | ), |
| 338 | |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 339 | TP_printk("dev=%u, ring=%u, seqno=%u", |
| 340 | __entry->dev, __entry->ring, __entry->seqno) |
| 341 | ); |
| 342 | |
| 343 | DEFINE_EVENT(i915_gem_request, i915_gem_request_add, |
| 344 | TP_PROTO(struct intel_ring_buffer *ring, u32 seqno), |
| 345 | TP_ARGS(ring, seqno) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 346 | ); |
| 347 | |
Chris Wilson | 814e9b5 | 2013-09-23 17:33:19 -0300 | [diff] [blame] | 348 | TRACE_EVENT(i915_gem_request_complete, |
| 349 | TP_PROTO(struct intel_ring_buffer *ring), |
| 350 | TP_ARGS(ring), |
| 351 | |
| 352 | TP_STRUCT__entry( |
| 353 | __field(u32, dev) |
| 354 | __field(u32, ring) |
| 355 | __field(u32, seqno) |
| 356 | ), |
| 357 | |
| 358 | TP_fast_assign( |
| 359 | __entry->dev = ring->dev->primary->index; |
| 360 | __entry->ring = ring->id; |
| 361 | __entry->seqno = ring->get_seqno(ring, false); |
| 362 | ), |
| 363 | |
| 364 | TP_printk("dev=%u, ring=%u, seqno=%u", |
| 365 | __entry->dev, __entry->ring, __entry->seqno) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 366 | ); |
| 367 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 368 | DEFINE_EVENT(i915_gem_request, i915_gem_request_retire, |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 369 | TP_PROTO(struct intel_ring_buffer *ring, u32 seqno), |
| 370 | TP_ARGS(ring, seqno) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 371 | ); |
| 372 | |
Ben Widawsky | f3fd376 | 2012-05-24 15:03:09 -0700 | [diff] [blame] | 373 | TRACE_EVENT(i915_gem_request_wait_begin, |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 374 | TP_PROTO(struct intel_ring_buffer *ring, u32 seqno), |
Ben Widawsky | f3fd376 | 2012-05-24 15:03:09 -0700 | [diff] [blame] | 375 | TP_ARGS(ring, seqno), |
| 376 | |
| 377 | TP_STRUCT__entry( |
| 378 | __field(u32, dev) |
| 379 | __field(u32, ring) |
| 380 | __field(u32, seqno) |
| 381 | __field(bool, blocking) |
| 382 | ), |
| 383 | |
| 384 | /* NB: the blocking information is racy since mutex_is_locked |
| 385 | * doesn't check that the current thread holds the lock. The only |
| 386 | * other option would be to pass the boolean information of whether |
| 387 | * or not the class was blocking down through the stack which is |
| 388 | * less desirable. |
| 389 | */ |
| 390 | TP_fast_assign( |
| 391 | __entry->dev = ring->dev->primary->index; |
| 392 | __entry->ring = ring->id; |
| 393 | __entry->seqno = seqno; |
| 394 | __entry->blocking = mutex_is_locked(&ring->dev->struct_mutex); |
| 395 | ), |
| 396 | |
| 397 | TP_printk("dev=%u, ring=%u, seqno=%u, blocking=%s", |
| 398 | __entry->dev, __entry->ring, __entry->seqno, |
| 399 | __entry->blocking ? "yes (NB)" : "no") |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 400 | ); |
| 401 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 402 | DEFINE_EVENT(i915_gem_request, i915_gem_request_wait_end, |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 403 | TP_PROTO(struct intel_ring_buffer *ring, u32 seqno), |
| 404 | TP_ARGS(ring, seqno) |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 405 | ); |
| 406 | |
| 407 | DECLARE_EVENT_CLASS(i915_ring, |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 408 | TP_PROTO(struct intel_ring_buffer *ring), |
| 409 | TP_ARGS(ring), |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 410 | |
| 411 | TP_STRUCT__entry( |
Chris Wilson | 4f49be5 | 2009-09-24 00:23:33 +0100 | [diff] [blame] | 412 | __field(u32, dev) |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 413 | __field(u32, ring) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 414 | ), |
| 415 | |
| 416 | TP_fast_assign( |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 417 | __entry->dev = ring->dev->primary->index; |
| 418 | __entry->ring = ring->id; |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 419 | ), |
| 420 | |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 421 | TP_printk("dev=%u, ring=%u", __entry->dev, __entry->ring) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 422 | ); |
| 423 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 424 | DEFINE_EVENT(i915_ring, i915_ring_wait_begin, |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 425 | TP_PROTO(struct intel_ring_buffer *ring), |
| 426 | TP_ARGS(ring) |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 427 | ); |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 428 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 429 | DEFINE_EVENT(i915_ring, i915_ring_wait_end, |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 430 | TP_PROTO(struct intel_ring_buffer *ring), |
| 431 | TP_ARGS(ring) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 432 | ); |
| 433 | |
Jesse Barnes | e5510fa | 2010-07-01 16:48:37 -0700 | [diff] [blame] | 434 | TRACE_EVENT(i915_flip_request, |
Chris Wilson | 05394f3 | 2010-11-08 19:18:58 +0000 | [diff] [blame] | 435 | TP_PROTO(int plane, struct drm_i915_gem_object *obj), |
Jesse Barnes | e5510fa | 2010-07-01 16:48:37 -0700 | [diff] [blame] | 436 | |
| 437 | TP_ARGS(plane, obj), |
| 438 | |
| 439 | TP_STRUCT__entry( |
| 440 | __field(int, plane) |
Chris Wilson | 05394f3 | 2010-11-08 19:18:58 +0000 | [diff] [blame] | 441 | __field(struct drm_i915_gem_object *, obj) |
Jesse Barnes | e5510fa | 2010-07-01 16:48:37 -0700 | [diff] [blame] | 442 | ), |
| 443 | |
| 444 | TP_fast_assign( |
| 445 | __entry->plane = plane; |
| 446 | __entry->obj = obj; |
| 447 | ), |
| 448 | |
| 449 | TP_printk("plane=%d, obj=%p", __entry->plane, __entry->obj) |
| 450 | ); |
| 451 | |
| 452 | TRACE_EVENT(i915_flip_complete, |
Chris Wilson | 05394f3 | 2010-11-08 19:18:58 +0000 | [diff] [blame] | 453 | TP_PROTO(int plane, struct drm_i915_gem_object *obj), |
Jesse Barnes | e5510fa | 2010-07-01 16:48:37 -0700 | [diff] [blame] | 454 | |
| 455 | TP_ARGS(plane, obj), |
| 456 | |
| 457 | TP_STRUCT__entry( |
| 458 | __field(int, plane) |
Chris Wilson | 05394f3 | 2010-11-08 19:18:58 +0000 | [diff] [blame] | 459 | __field(struct drm_i915_gem_object *, obj) |
Jesse Barnes | e5510fa | 2010-07-01 16:48:37 -0700 | [diff] [blame] | 460 | ), |
| 461 | |
| 462 | TP_fast_assign( |
| 463 | __entry->plane = plane; |
| 464 | __entry->obj = obj; |
| 465 | ), |
| 466 | |
| 467 | TP_printk("plane=%d, obj=%p", __entry->plane, __entry->obj) |
| 468 | ); |
| 469 | |
Chris Wilson | ed71f1b | 2013-07-19 20:36:56 +0100 | [diff] [blame] | 470 | TRACE_EVENT_CONDITION(i915_reg_rw, |
| 471 | TP_PROTO(bool write, u32 reg, u64 val, int len, bool trace), |
Yuanhan Liu | ba4f01a | 2010-11-08 17:09:41 +0800 | [diff] [blame] | 472 | |
Chris Wilson | ed71f1b | 2013-07-19 20:36:56 +0100 | [diff] [blame] | 473 | TP_ARGS(write, reg, val, len, trace), |
| 474 | |
| 475 | TP_CONDITION(trace), |
Yuanhan Liu | ba4f01a | 2010-11-08 17:09:41 +0800 | [diff] [blame] | 476 | |
Akshay Joshi | 0206e35 | 2011-08-16 15:34:10 -0400 | [diff] [blame] | 477 | TP_STRUCT__entry( |
| 478 | __field(u64, val) |
| 479 | __field(u32, reg) |
| 480 | __field(u16, write) |
| 481 | __field(u16, len) |
| 482 | ), |
Yuanhan Liu | ba4f01a | 2010-11-08 17:09:41 +0800 | [diff] [blame] | 483 | |
Akshay Joshi | 0206e35 | 2011-08-16 15:34:10 -0400 | [diff] [blame] | 484 | TP_fast_assign( |
| 485 | __entry->val = (u64)val; |
| 486 | __entry->reg = reg; |
| 487 | __entry->write = write; |
| 488 | __entry->len = len; |
| 489 | ), |
Yuanhan Liu | ba4f01a | 2010-11-08 17:09:41 +0800 | [diff] [blame] | 490 | |
Akshay Joshi | 0206e35 | 2011-08-16 15:34:10 -0400 | [diff] [blame] | 491 | TP_printk("%s reg=0x%x, len=%d, val=(0x%x, 0x%x)", |
| 492 | __entry->write ? "write" : "read", |
| 493 | __entry->reg, __entry->len, |
| 494 | (u32)(__entry->val & 0xffffffff), |
| 495 | (u32)(__entry->val >> 32)) |
Yuanhan Liu | ba4f01a | 2010-11-08 17:09:41 +0800 | [diff] [blame] | 496 | ); |
| 497 | |
Daniel Vetter | be2cde9 | 2012-08-30 13:26:48 +0200 | [diff] [blame] | 498 | TRACE_EVENT(intel_gpu_freq_change, |
| 499 | TP_PROTO(u32 freq), |
| 500 | TP_ARGS(freq), |
| 501 | |
| 502 | TP_STRUCT__entry( |
| 503 | __field(u32, freq) |
| 504 | ), |
| 505 | |
| 506 | TP_fast_assign( |
| 507 | __entry->freq = freq; |
| 508 | ), |
| 509 | |
| 510 | TP_printk("new_freq=%u", __entry->freq) |
| 511 | ); |
| 512 | |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 513 | #endif /* _I915_TRACE_H_ */ |
| 514 | |
| 515 | /* This part must be outside protection */ |
| 516 | #undef TRACE_INCLUDE_PATH |
Peter Clifton | a7c5427 | 2010-05-03 13:24:41 +0100 | [diff] [blame] | 517 | #define TRACE_INCLUDE_PATH . |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 518 | #include <trace/define_trace.h> |