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> |
| 9 | |
| 10 | #undef TRACE_SYSTEM |
| 11 | #define TRACE_SYSTEM i915 |
| 12 | #define TRACE_SYSTEM_STRING __stringify(TRACE_SYSTEM) |
| 13 | #define TRACE_INCLUDE_FILE i915_trace |
| 14 | |
| 15 | /* object tracking */ |
| 16 | |
| 17 | TRACE_EVENT(i915_gem_object_create, |
| 18 | |
| 19 | TP_PROTO(struct drm_gem_object *obj), |
| 20 | |
| 21 | TP_ARGS(obj), |
| 22 | |
| 23 | TP_STRUCT__entry( |
| 24 | __field(struct drm_gem_object *, obj) |
| 25 | __field(u32, size) |
| 26 | ), |
| 27 | |
| 28 | TP_fast_assign( |
| 29 | __entry->obj = obj; |
| 30 | __entry->size = obj->size; |
| 31 | ), |
| 32 | |
| 33 | TP_printk("obj=%p, size=%u", __entry->obj, __entry->size) |
| 34 | ); |
| 35 | |
| 36 | TRACE_EVENT(i915_gem_object_bind, |
| 37 | |
| 38 | TP_PROTO(struct drm_gem_object *obj, u32 gtt_offset), |
| 39 | |
| 40 | TP_ARGS(obj, gtt_offset), |
| 41 | |
| 42 | TP_STRUCT__entry( |
| 43 | __field(struct drm_gem_object *, obj) |
| 44 | __field(u32, gtt_offset) |
| 45 | ), |
| 46 | |
| 47 | TP_fast_assign( |
| 48 | __entry->obj = obj; |
| 49 | __entry->gtt_offset = gtt_offset; |
| 50 | ), |
| 51 | |
| 52 | TP_printk("obj=%p, gtt_offset=%08x", |
| 53 | __entry->obj, __entry->gtt_offset) |
| 54 | ); |
| 55 | |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 56 | TRACE_EVENT(i915_gem_object_change_domain, |
| 57 | |
| 58 | TP_PROTO(struct drm_gem_object *obj, uint32_t old_read_domains, uint32_t old_write_domain), |
| 59 | |
| 60 | TP_ARGS(obj, old_read_domains, old_write_domain), |
| 61 | |
| 62 | TP_STRUCT__entry( |
| 63 | __field(struct drm_gem_object *, obj) |
| 64 | __field(u32, read_domains) |
| 65 | __field(u32, write_domain) |
| 66 | ), |
| 67 | |
| 68 | TP_fast_assign( |
| 69 | __entry->obj = obj; |
| 70 | __entry->read_domains = obj->read_domains | (old_read_domains << 16); |
| 71 | __entry->write_domain = obj->write_domain | (old_write_domain << 16); |
| 72 | ), |
| 73 | |
| 74 | TP_printk("obj=%p, read=%04x, write=%04x", |
| 75 | __entry->obj, |
| 76 | __entry->read_domains, __entry->write_domain) |
| 77 | ); |
| 78 | |
| 79 | TRACE_EVENT(i915_gem_object_get_fence, |
| 80 | |
| 81 | TP_PROTO(struct drm_gem_object *obj, int fence, int tiling_mode), |
| 82 | |
| 83 | TP_ARGS(obj, fence, tiling_mode), |
| 84 | |
| 85 | TP_STRUCT__entry( |
| 86 | __field(struct drm_gem_object *, obj) |
| 87 | __field(int, fence) |
| 88 | __field(int, tiling_mode) |
| 89 | ), |
| 90 | |
| 91 | TP_fast_assign( |
| 92 | __entry->obj = obj; |
| 93 | __entry->fence = fence; |
| 94 | __entry->tiling_mode = tiling_mode; |
| 95 | ), |
| 96 | |
| 97 | TP_printk("obj=%p, fence=%d, tiling=%d", |
| 98 | __entry->obj, __entry->fence, __entry->tiling_mode) |
| 99 | ); |
| 100 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 101 | DECLARE_EVENT_CLASS(i915_gem_object, |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 102 | |
| 103 | TP_PROTO(struct drm_gem_object *obj), |
| 104 | |
| 105 | TP_ARGS(obj), |
| 106 | |
| 107 | TP_STRUCT__entry( |
| 108 | __field(struct drm_gem_object *, obj) |
| 109 | ), |
| 110 | |
| 111 | TP_fast_assign( |
| 112 | __entry->obj = obj; |
| 113 | ), |
| 114 | |
| 115 | TP_printk("obj=%p", __entry->obj) |
| 116 | ); |
| 117 | |
Li Zefan | f41275e | 2010-05-24 16:25:44 +0800 | [diff] [blame] | 118 | DEFINE_EVENT(i915_gem_object, i915_gem_object_clflush, |
| 119 | |
| 120 | TP_PROTO(struct drm_gem_object *obj), |
| 121 | |
| 122 | TP_ARGS(obj) |
| 123 | ); |
| 124 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 125 | DEFINE_EVENT(i915_gem_object, i915_gem_object_unbind, |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 126 | |
| 127 | TP_PROTO(struct drm_gem_object *obj), |
| 128 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 129 | TP_ARGS(obj) |
| 130 | ); |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 131 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 132 | DEFINE_EVENT(i915_gem_object, i915_gem_object_destroy, |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 133 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 134 | TP_PROTO(struct drm_gem_object *obj), |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 135 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 136 | TP_ARGS(obj) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 137 | ); |
| 138 | |
| 139 | /* batch tracing */ |
| 140 | |
| 141 | TRACE_EVENT(i915_gem_request_submit, |
| 142 | |
| 143 | TP_PROTO(struct drm_device *dev, u32 seqno), |
| 144 | |
| 145 | TP_ARGS(dev, seqno), |
| 146 | |
| 147 | TP_STRUCT__entry( |
Chris Wilson | 4f49be5 | 2009-09-24 00:23:33 +0100 | [diff] [blame] | 148 | __field(u32, dev) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 149 | __field(u32, seqno) |
| 150 | ), |
| 151 | |
| 152 | TP_fast_assign( |
Chris Wilson | 4f49be5 | 2009-09-24 00:23:33 +0100 | [diff] [blame] | 153 | __entry->dev = dev->primary->index; |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 154 | __entry->seqno = seqno; |
Chris Wilson | 9d34e5d | 2009-09-24 05:26:06 +0100 | [diff] [blame] | 155 | i915_trace_irq_get(dev, seqno); |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 156 | ), |
| 157 | |
Chris Wilson | 4f49be5 | 2009-09-24 00:23:33 +0100 | [diff] [blame] | 158 | TP_printk("dev=%u, seqno=%u", __entry->dev, __entry->seqno) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 159 | ); |
| 160 | |
| 161 | TRACE_EVENT(i915_gem_request_flush, |
| 162 | |
| 163 | TP_PROTO(struct drm_device *dev, u32 seqno, |
| 164 | u32 flush_domains, u32 invalidate_domains), |
| 165 | |
| 166 | TP_ARGS(dev, seqno, flush_domains, invalidate_domains), |
| 167 | |
| 168 | TP_STRUCT__entry( |
Chris Wilson | 4f49be5 | 2009-09-24 00:23:33 +0100 | [diff] [blame] | 169 | __field(u32, dev) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 170 | __field(u32, seqno) |
| 171 | __field(u32, flush_domains) |
| 172 | __field(u32, invalidate_domains) |
| 173 | ), |
| 174 | |
| 175 | TP_fast_assign( |
Chris Wilson | 4f49be5 | 2009-09-24 00:23:33 +0100 | [diff] [blame] | 176 | __entry->dev = dev->primary->index; |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 177 | __entry->seqno = seqno; |
| 178 | __entry->flush_domains = flush_domains; |
| 179 | __entry->invalidate_domains = invalidate_domains; |
| 180 | ), |
| 181 | |
Chris Wilson | 4f49be5 | 2009-09-24 00:23:33 +0100 | [diff] [blame] | 182 | TP_printk("dev=%u, seqno=%u, flush=%04x, invalidate=%04x", |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 183 | __entry->dev, __entry->seqno, |
| 184 | __entry->flush_domains, __entry->invalidate_domains) |
| 185 | ); |
| 186 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 187 | DECLARE_EVENT_CLASS(i915_gem_request, |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 188 | |
| 189 | TP_PROTO(struct drm_device *dev, u32 seqno), |
| 190 | |
| 191 | TP_ARGS(dev, seqno), |
| 192 | |
| 193 | TP_STRUCT__entry( |
Chris Wilson | 4f49be5 | 2009-09-24 00:23:33 +0100 | [diff] [blame] | 194 | __field(u32, dev) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 195 | __field(u32, seqno) |
| 196 | ), |
| 197 | |
| 198 | TP_fast_assign( |
Chris Wilson | 4f49be5 | 2009-09-24 00:23:33 +0100 | [diff] [blame] | 199 | __entry->dev = dev->primary->index; |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 200 | __entry->seqno = seqno; |
| 201 | ), |
| 202 | |
Chris Wilson | 4f49be5 | 2009-09-24 00:23:33 +0100 | [diff] [blame] | 203 | TP_printk("dev=%u, seqno=%u", __entry->dev, __entry->seqno) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 204 | ); |
| 205 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 206 | DEFINE_EVENT(i915_gem_request, i915_gem_request_complete, |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 207 | |
| 208 | TP_PROTO(struct drm_device *dev, u32 seqno), |
| 209 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 210 | TP_ARGS(dev, seqno) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 211 | ); |
| 212 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 213 | DEFINE_EVENT(i915_gem_request, i915_gem_request_retire, |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 214 | |
| 215 | TP_PROTO(struct drm_device *dev, u32 seqno), |
| 216 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 217 | TP_ARGS(dev, seqno) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 218 | ); |
| 219 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 220 | DEFINE_EVENT(i915_gem_request, i915_gem_request_wait_begin, |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 221 | |
| 222 | TP_PROTO(struct drm_device *dev, u32 seqno), |
| 223 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 224 | TP_ARGS(dev, seqno) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 225 | ); |
| 226 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 227 | DEFINE_EVENT(i915_gem_request, i915_gem_request_wait_end, |
| 228 | |
| 229 | TP_PROTO(struct drm_device *dev, u32 seqno), |
| 230 | |
| 231 | TP_ARGS(dev, seqno) |
| 232 | ); |
| 233 | |
| 234 | DECLARE_EVENT_CLASS(i915_ring, |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 235 | |
| 236 | TP_PROTO(struct drm_device *dev), |
| 237 | |
| 238 | TP_ARGS(dev), |
| 239 | |
| 240 | TP_STRUCT__entry( |
Chris Wilson | 4f49be5 | 2009-09-24 00:23:33 +0100 | [diff] [blame] | 241 | __field(u32, dev) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 242 | ), |
| 243 | |
| 244 | TP_fast_assign( |
Chris Wilson | 4f49be5 | 2009-09-24 00:23:33 +0100 | [diff] [blame] | 245 | __entry->dev = dev->primary->index; |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 246 | ), |
| 247 | |
Chris Wilson | 4f49be5 | 2009-09-24 00:23:33 +0100 | [diff] [blame] | 248 | TP_printk("dev=%u", __entry->dev) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 249 | ); |
| 250 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 251 | DEFINE_EVENT(i915_ring, i915_ring_wait_begin, |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 252 | |
| 253 | TP_PROTO(struct drm_device *dev), |
| 254 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 255 | TP_ARGS(dev) |
| 256 | ); |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 257 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 258 | DEFINE_EVENT(i915_ring, i915_ring_wait_end, |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 259 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 260 | TP_PROTO(struct drm_device *dev), |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 261 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 262 | TP_ARGS(dev) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 263 | ); |
| 264 | |
Jesse Barnes | e5510fa | 2010-07-01 16:48:37 -0700 | [diff] [blame^] | 265 | TRACE_EVENT(i915_flip_request, |
| 266 | TP_PROTO(int plane, struct drm_gem_object *obj), |
| 267 | |
| 268 | TP_ARGS(plane, obj), |
| 269 | |
| 270 | TP_STRUCT__entry( |
| 271 | __field(int, plane) |
| 272 | __field(struct drm_gem_object *, obj) |
| 273 | ), |
| 274 | |
| 275 | TP_fast_assign( |
| 276 | __entry->plane = plane; |
| 277 | __entry->obj = obj; |
| 278 | ), |
| 279 | |
| 280 | TP_printk("plane=%d, obj=%p", __entry->plane, __entry->obj) |
| 281 | ); |
| 282 | |
| 283 | TRACE_EVENT(i915_flip_complete, |
| 284 | TP_PROTO(int plane, struct drm_gem_object *obj), |
| 285 | |
| 286 | TP_ARGS(plane, obj), |
| 287 | |
| 288 | TP_STRUCT__entry( |
| 289 | __field(int, plane) |
| 290 | __field(struct drm_gem_object *, obj) |
| 291 | ), |
| 292 | |
| 293 | TP_fast_assign( |
| 294 | __entry->plane = plane; |
| 295 | __entry->obj = obj; |
| 296 | ), |
| 297 | |
| 298 | TP_printk("plane=%d, obj=%p", __entry->plane, __entry->obj) |
| 299 | ); |
| 300 | |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 301 | #endif /* _I915_TRACE_H_ */ |
| 302 | |
| 303 | /* This part must be outside protection */ |
| 304 | #undef TRACE_INCLUDE_PATH |
Peter Clifton | a7c5427 | 2010-05-03 13:24:41 +0100 | [diff] [blame] | 305 | #define TRACE_INCLUDE_PATH . |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 306 | #include <trace/define_trace.h> |