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