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 | |
| 36 | TRACE_EVENT(i915_gem_object_bind, |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 37 | TP_PROTO(struct drm_i915_gem_object *obj, bool mappable), |
| 38 | TP_ARGS(obj, 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) |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 42 | __field(u32, offset) |
| 43 | __field(u32, size) |
Daniel Vetter | ec57d26 | 2010-09-30 23:42:15 +0200 | [diff] [blame] | 44 | __field(bool, mappable) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 45 | ), |
| 46 | |
| 47 | TP_fast_assign( |
| 48 | __entry->obj = obj; |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 49 | __entry->offset = obj->gtt_space->start; |
| 50 | __entry->size = obj->gtt_space->size; |
Daniel Vetter | ec57d26 | 2010-09-30 23:42:15 +0200 | [diff] [blame] | 51 | __entry->mappable = mappable; |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 52 | ), |
| 53 | |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 54 | TP_printk("obj=%p, offset=%08x size=%x%s", |
| 55 | __entry->obj, __entry->offset, __entry->size, |
Daniel Vetter | ec57d26 | 2010-09-30 23:42:15 +0200 | [diff] [blame] | 56 | __entry->mappable ? ", mappable" : "") |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 57 | ); |
| 58 | |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 59 | TRACE_EVENT(i915_gem_object_unbind, |
| 60 | TP_PROTO(struct drm_i915_gem_object *obj), |
| 61 | TP_ARGS(obj), |
| 62 | |
| 63 | TP_STRUCT__entry( |
| 64 | __field(struct drm_i915_gem_object *, obj) |
| 65 | __field(u32, offset) |
| 66 | __field(u32, size) |
| 67 | ), |
| 68 | |
| 69 | TP_fast_assign( |
| 70 | __entry->obj = obj; |
| 71 | __entry->offset = obj->gtt_space->start; |
| 72 | __entry->size = obj->gtt_space->size; |
| 73 | ), |
| 74 | |
| 75 | TP_printk("obj=%p, offset=%08x size=%x", |
| 76 | __entry->obj, __entry->offset, __entry->size) |
| 77 | ); |
| 78 | |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 79 | TRACE_EVENT(i915_gem_object_change_domain, |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 80 | TP_PROTO(struct drm_i915_gem_object *obj, u32 old_read, u32 old_write), |
| 81 | TP_ARGS(obj, old_read, old_write), |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 82 | |
| 83 | TP_STRUCT__entry( |
Chris Wilson | 05394f3 | 2010-11-08 19:18:58 +0000 | [diff] [blame] | 84 | __field(struct drm_i915_gem_object *, obj) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 85 | __field(u32, read_domains) |
| 86 | __field(u32, write_domain) |
| 87 | ), |
| 88 | |
| 89 | TP_fast_assign( |
| 90 | __entry->obj = obj; |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 91 | __entry->read_domains = obj->base.read_domains | (old_read << 16); |
| 92 | __entry->write_domain = obj->base.write_domain | (old_write << 16); |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 93 | ), |
| 94 | |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 95 | TP_printk("obj=%p, read=%02x=>%02x, write=%02x=>%02x", |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 96 | __entry->obj, |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 97 | __entry->read_domains >> 16, |
| 98 | __entry->read_domains & 0xffff, |
| 99 | __entry->write_domain >> 16, |
| 100 | __entry->write_domain & 0xffff) |
| 101 | ); |
| 102 | |
| 103 | TRACE_EVENT(i915_gem_object_pwrite, |
| 104 | TP_PROTO(struct drm_i915_gem_object *obj, u32 offset, u32 len), |
| 105 | TP_ARGS(obj, offset, len), |
| 106 | |
| 107 | TP_STRUCT__entry( |
| 108 | __field(struct drm_i915_gem_object *, obj) |
| 109 | __field(u32, offset) |
| 110 | __field(u32, len) |
| 111 | ), |
| 112 | |
| 113 | TP_fast_assign( |
| 114 | __entry->obj = obj; |
| 115 | __entry->offset = offset; |
| 116 | __entry->len = len; |
| 117 | ), |
| 118 | |
| 119 | TP_printk("obj=%p, offset=%u, len=%u", |
| 120 | __entry->obj, __entry->offset, __entry->len) |
| 121 | ); |
| 122 | |
| 123 | TRACE_EVENT(i915_gem_object_pread, |
| 124 | TP_PROTO(struct drm_i915_gem_object *obj, u32 offset, u32 len), |
| 125 | TP_ARGS(obj, offset, len), |
| 126 | |
| 127 | TP_STRUCT__entry( |
| 128 | __field(struct drm_i915_gem_object *, obj) |
| 129 | __field(u32, offset) |
| 130 | __field(u32, len) |
| 131 | ), |
| 132 | |
| 133 | TP_fast_assign( |
| 134 | __entry->obj = obj; |
| 135 | __entry->offset = offset; |
| 136 | __entry->len = len; |
| 137 | ), |
| 138 | |
| 139 | TP_printk("obj=%p, offset=%u, len=%u", |
| 140 | __entry->obj, __entry->offset, __entry->len) |
| 141 | ); |
| 142 | |
| 143 | TRACE_EVENT(i915_gem_object_fault, |
| 144 | TP_PROTO(struct drm_i915_gem_object *obj, u32 index, bool gtt, bool write), |
| 145 | TP_ARGS(obj, index, gtt, write), |
| 146 | |
| 147 | TP_STRUCT__entry( |
| 148 | __field(struct drm_i915_gem_object *, obj) |
| 149 | __field(u32, index) |
| 150 | __field(bool, gtt) |
| 151 | __field(bool, write) |
| 152 | ), |
| 153 | |
| 154 | TP_fast_assign( |
| 155 | __entry->obj = obj; |
| 156 | __entry->index = index; |
| 157 | __entry->gtt = gtt; |
| 158 | __entry->write = write; |
| 159 | ), |
| 160 | |
| 161 | TP_printk("obj=%p, %s index=%u %s", |
| 162 | __entry->obj, |
| 163 | __entry->gtt ? "GTT" : "CPU", |
| 164 | __entry->index, |
| 165 | __entry->write ? ", writable" : "") |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 166 | ); |
| 167 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 168 | DECLARE_EVENT_CLASS(i915_gem_object, |
Chris Wilson | 05394f3 | 2010-11-08 19:18:58 +0000 | [diff] [blame] | 169 | TP_PROTO(struct drm_i915_gem_object *obj), |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 170 | TP_ARGS(obj), |
| 171 | |
| 172 | TP_STRUCT__entry( |
Chris Wilson | 05394f3 | 2010-11-08 19:18:58 +0000 | [diff] [blame] | 173 | __field(struct drm_i915_gem_object *, obj) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 174 | ), |
| 175 | |
| 176 | TP_fast_assign( |
| 177 | __entry->obj = obj; |
| 178 | ), |
| 179 | |
| 180 | TP_printk("obj=%p", __entry->obj) |
| 181 | ); |
| 182 | |
Li Zefan | f41275e | 2010-05-24 16:25:44 +0800 | [diff] [blame] | 183 | DEFINE_EVENT(i915_gem_object, i915_gem_object_clflush, |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 184 | TP_PROTO(struct drm_i915_gem_object *obj), |
| 185 | TP_ARGS(obj) |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 186 | ); |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 187 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 188 | DEFINE_EVENT(i915_gem_object, i915_gem_object_destroy, |
Chris Wilson | 05394f3 | 2010-11-08 19:18:58 +0000 | [diff] [blame] | 189 | TP_PROTO(struct drm_i915_gem_object *obj), |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 190 | TP_ARGS(obj) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 191 | ); |
| 192 | |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 193 | TRACE_EVENT(i915_gem_evict, |
| 194 | TP_PROTO(struct drm_device *dev, u32 size, u32 align, bool mappable), |
| 195 | TP_ARGS(dev, size, align, mappable), |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 196 | |
| 197 | TP_STRUCT__entry( |
Chris Wilson | 4f49be5 | 2009-09-24 00:23:33 +0100 | [diff] [blame] | 198 | __field(u32, dev) |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 199 | __field(u32, size) |
| 200 | __field(u32, align) |
| 201 | __field(bool, mappable) |
| 202 | ), |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 203 | |
| 204 | TP_fast_assign( |
Chris Wilson | 4f49be5 | 2009-09-24 00:23:33 +0100 | [diff] [blame] | 205 | __entry->dev = dev->primary->index; |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 206 | __entry->size = size; |
| 207 | __entry->align = align; |
| 208 | __entry->mappable = mappable; |
| 209 | ), |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 210 | |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 211 | TP_printk("dev=%d, size=%d, align=%d %s", |
| 212 | __entry->dev, __entry->size, __entry->align, |
| 213 | __entry->mappable ? ", mappable" : "") |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 214 | ); |
| 215 | |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 216 | TRACE_EVENT(i915_gem_evict_everything, |
| 217 | TP_PROTO(struct drm_device *dev, bool purgeable), |
| 218 | TP_ARGS(dev, purgeable), |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 219 | |
| 220 | TP_STRUCT__entry( |
Chris Wilson | 4f49be5 | 2009-09-24 00:23:33 +0100 | [diff] [blame] | 221 | __field(u32, dev) |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 222 | __field(bool, purgeable) |
| 223 | ), |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 224 | |
| 225 | TP_fast_assign( |
Chris Wilson | 4f49be5 | 2009-09-24 00:23:33 +0100 | [diff] [blame] | 226 | __entry->dev = dev->primary->index; |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 227 | __entry->purgeable = purgeable; |
| 228 | ), |
| 229 | |
| 230 | TP_printk("dev=%d%s", |
| 231 | __entry->dev, |
| 232 | __entry->purgeable ? ", purgeable only" : "") |
| 233 | ); |
| 234 | |
| 235 | TRACE_EVENT(i915_gem_ring_dispatch, |
| 236 | TP_PROTO(struct intel_ring_buffer *ring, u32 seqno), |
| 237 | TP_ARGS(ring, seqno), |
| 238 | |
| 239 | TP_STRUCT__entry( |
| 240 | __field(u32, dev) |
| 241 | __field(u32, ring) |
| 242 | __field(u32, seqno) |
| 243 | ), |
| 244 | |
| 245 | TP_fast_assign( |
| 246 | __entry->dev = ring->dev->primary->index; |
| 247 | __entry->ring = ring->id; |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 248 | __entry->seqno = seqno; |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 249 | i915_trace_irq_get(ring, seqno); |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 250 | ), |
| 251 | |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 252 | TP_printk("dev=%u, ring=%u, seqno=%u", |
| 253 | __entry->dev, __entry->ring, __entry->seqno) |
| 254 | ); |
| 255 | |
| 256 | TRACE_EVENT(i915_gem_ring_flush, |
| 257 | TP_PROTO(struct intel_ring_buffer *ring, u32 invalidate, u32 flush), |
| 258 | TP_ARGS(ring, invalidate, flush), |
| 259 | |
| 260 | TP_STRUCT__entry( |
| 261 | __field(u32, dev) |
| 262 | __field(u32, ring) |
| 263 | __field(u32, invalidate) |
| 264 | __field(u32, flush) |
| 265 | ), |
| 266 | |
| 267 | TP_fast_assign( |
| 268 | __entry->dev = ring->dev->primary->index; |
| 269 | __entry->ring = ring->id; |
| 270 | __entry->invalidate = invalidate; |
| 271 | __entry->flush = flush; |
| 272 | ), |
| 273 | |
| 274 | TP_printk("dev=%u, ring=%x, invalidate=%04x, flush=%04x", |
| 275 | __entry->dev, __entry->ring, |
| 276 | __entry->invalidate, __entry->flush) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 277 | ); |
| 278 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 279 | DECLARE_EVENT_CLASS(i915_gem_request, |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 280 | TP_PROTO(struct intel_ring_buffer *ring, u32 seqno), |
| 281 | TP_ARGS(ring, seqno), |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 282 | |
| 283 | TP_STRUCT__entry( |
Chris Wilson | 4f49be5 | 2009-09-24 00:23:33 +0100 | [diff] [blame] | 284 | __field(u32, dev) |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 285 | __field(u32, ring) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 286 | __field(u32, seqno) |
| 287 | ), |
| 288 | |
| 289 | TP_fast_assign( |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 290 | __entry->dev = ring->dev->primary->index; |
| 291 | __entry->ring = ring->id; |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 292 | __entry->seqno = seqno; |
| 293 | ), |
| 294 | |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 295 | TP_printk("dev=%u, ring=%u, seqno=%u", |
| 296 | __entry->dev, __entry->ring, __entry->seqno) |
| 297 | ); |
| 298 | |
| 299 | DEFINE_EVENT(i915_gem_request, i915_gem_request_add, |
| 300 | TP_PROTO(struct intel_ring_buffer *ring, u32 seqno), |
| 301 | TP_ARGS(ring, seqno) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 302 | ); |
| 303 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 304 | DEFINE_EVENT(i915_gem_request, i915_gem_request_complete, |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 305 | TP_PROTO(struct intel_ring_buffer *ring, u32 seqno), |
| 306 | TP_ARGS(ring, seqno) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 307 | ); |
| 308 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 309 | DEFINE_EVENT(i915_gem_request, i915_gem_request_retire, |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 310 | TP_PROTO(struct intel_ring_buffer *ring, u32 seqno), |
| 311 | TP_ARGS(ring, seqno) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 312 | ); |
| 313 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 314 | DEFINE_EVENT(i915_gem_request, i915_gem_request_wait_begin, |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 315 | TP_PROTO(struct intel_ring_buffer *ring, u32 seqno), |
| 316 | TP_ARGS(ring, seqno) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 317 | ); |
| 318 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 319 | DEFINE_EVENT(i915_gem_request, i915_gem_request_wait_end, |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 320 | TP_PROTO(struct intel_ring_buffer *ring, u32 seqno), |
| 321 | TP_ARGS(ring, seqno) |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 322 | ); |
| 323 | |
| 324 | DECLARE_EVENT_CLASS(i915_ring, |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 325 | TP_PROTO(struct intel_ring_buffer *ring), |
| 326 | TP_ARGS(ring), |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 327 | |
| 328 | TP_STRUCT__entry( |
Chris Wilson | 4f49be5 | 2009-09-24 00:23:33 +0100 | [diff] [blame] | 329 | __field(u32, dev) |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 330 | __field(u32, ring) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 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 | ), |
| 337 | |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 338 | TP_printk("dev=%u, ring=%u", __entry->dev, __entry->ring) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 339 | ); |
| 340 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 341 | DEFINE_EVENT(i915_ring, i915_ring_wait_begin, |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 342 | TP_PROTO(struct intel_ring_buffer *ring), |
| 343 | TP_ARGS(ring) |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 344 | ); |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 345 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 346 | DEFINE_EVENT(i915_ring, i915_ring_wait_end, |
Chris Wilson | db53a30 | 2011-02-03 11:57:46 +0000 | [diff] [blame] | 347 | TP_PROTO(struct intel_ring_buffer *ring), |
| 348 | TP_ARGS(ring) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 349 | ); |
| 350 | |
Jesse Barnes | e5510fa | 2010-07-01 16:48:37 -0700 | [diff] [blame] | 351 | TRACE_EVENT(i915_flip_request, |
Chris Wilson | 05394f3 | 2010-11-08 19:18:58 +0000 | [diff] [blame] | 352 | TP_PROTO(int plane, struct drm_i915_gem_object *obj), |
Jesse Barnes | e5510fa | 2010-07-01 16:48:37 -0700 | [diff] [blame] | 353 | |
| 354 | TP_ARGS(plane, obj), |
| 355 | |
| 356 | TP_STRUCT__entry( |
| 357 | __field(int, plane) |
Chris Wilson | 05394f3 | 2010-11-08 19:18:58 +0000 | [diff] [blame] | 358 | __field(struct drm_i915_gem_object *, obj) |
Jesse Barnes | e5510fa | 2010-07-01 16:48:37 -0700 | [diff] [blame] | 359 | ), |
| 360 | |
| 361 | TP_fast_assign( |
| 362 | __entry->plane = plane; |
| 363 | __entry->obj = obj; |
| 364 | ), |
| 365 | |
| 366 | TP_printk("plane=%d, obj=%p", __entry->plane, __entry->obj) |
| 367 | ); |
| 368 | |
| 369 | TRACE_EVENT(i915_flip_complete, |
Chris Wilson | 05394f3 | 2010-11-08 19:18:58 +0000 | [diff] [blame] | 370 | TP_PROTO(int plane, struct drm_i915_gem_object *obj), |
Jesse Barnes | e5510fa | 2010-07-01 16:48:37 -0700 | [diff] [blame] | 371 | |
| 372 | TP_ARGS(plane, obj), |
| 373 | |
| 374 | TP_STRUCT__entry( |
| 375 | __field(int, plane) |
Chris Wilson | 05394f3 | 2010-11-08 19:18:58 +0000 | [diff] [blame] | 376 | __field(struct drm_i915_gem_object *, obj) |
Jesse Barnes | e5510fa | 2010-07-01 16:48:37 -0700 | [diff] [blame] | 377 | ), |
| 378 | |
| 379 | TP_fast_assign( |
| 380 | __entry->plane = plane; |
| 381 | __entry->obj = obj; |
| 382 | ), |
| 383 | |
| 384 | TP_printk("plane=%d, obj=%p", __entry->plane, __entry->obj) |
| 385 | ); |
| 386 | |
Yuanhan Liu | ba4f01a | 2010-11-08 17:09:41 +0800 | [diff] [blame] | 387 | TRACE_EVENT(i915_reg_rw, |
Akshay Joshi | 0206e35 | 2011-08-16 15:34:10 -0400 | [diff] [blame] | 388 | TP_PROTO(bool write, u32 reg, u64 val, int len), |
Yuanhan Liu | ba4f01a | 2010-11-08 17:09:41 +0800 | [diff] [blame] | 389 | |
Akshay Joshi | 0206e35 | 2011-08-16 15:34:10 -0400 | [diff] [blame] | 390 | TP_ARGS(write, reg, val, len), |
Yuanhan Liu | ba4f01a | 2010-11-08 17:09:41 +0800 | [diff] [blame] | 391 | |
Akshay Joshi | 0206e35 | 2011-08-16 15:34:10 -0400 | [diff] [blame] | 392 | TP_STRUCT__entry( |
| 393 | __field(u64, val) |
| 394 | __field(u32, reg) |
| 395 | __field(u16, write) |
| 396 | __field(u16, len) |
| 397 | ), |
Yuanhan Liu | ba4f01a | 2010-11-08 17:09:41 +0800 | [diff] [blame] | 398 | |
Akshay Joshi | 0206e35 | 2011-08-16 15:34:10 -0400 | [diff] [blame] | 399 | TP_fast_assign( |
| 400 | __entry->val = (u64)val; |
| 401 | __entry->reg = reg; |
| 402 | __entry->write = write; |
| 403 | __entry->len = len; |
| 404 | ), |
Yuanhan Liu | ba4f01a | 2010-11-08 17:09:41 +0800 | [diff] [blame] | 405 | |
Akshay Joshi | 0206e35 | 2011-08-16 15:34:10 -0400 | [diff] [blame] | 406 | TP_printk("%s reg=0x%x, len=%d, val=(0x%x, 0x%x)", |
| 407 | __entry->write ? "write" : "read", |
| 408 | __entry->reg, __entry->len, |
| 409 | (u32)(__entry->val & 0xffffffff), |
| 410 | (u32)(__entry->val >> 32)) |
Yuanhan Liu | ba4f01a | 2010-11-08 17:09:41 +0800 | [diff] [blame] | 411 | ); |
| 412 | |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 413 | #endif /* _I915_TRACE_H_ */ |
| 414 | |
| 415 | /* This part must be outside protection */ |
| 416 | #undef TRACE_INCLUDE_PATH |
Peter Clifton | a7c5427 | 2010-05-03 13:24:41 +0100 | [diff] [blame] | 417 | #define TRACE_INCLUDE_PATH . |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 418 | #include <trace/define_trace.h> |