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