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 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 118 | DECLARE_EVENT_CLASS(i915_gem_object, |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 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 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 135 | DEFINE_EVENT(i915_gem_object, i915_gem_object_unbind, |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 136 | |
| 137 | TP_PROTO(struct drm_gem_object *obj), |
| 138 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 139 | TP_ARGS(obj) |
| 140 | ); |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 141 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 142 | DEFINE_EVENT(i915_gem_object, i915_gem_object_destroy, |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 143 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 144 | TP_PROTO(struct drm_gem_object *obj), |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 145 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 146 | TP_ARGS(obj) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 147 | ); |
| 148 | |
| 149 | /* batch tracing */ |
| 150 | |
| 151 | TRACE_EVENT(i915_gem_request_submit, |
| 152 | |
| 153 | TP_PROTO(struct drm_device *dev, u32 seqno), |
| 154 | |
| 155 | TP_ARGS(dev, seqno), |
| 156 | |
| 157 | TP_STRUCT__entry( |
Chris Wilson | 4f49be5 | 2009-09-24 00:23:33 +0100 | [diff] [blame] | 158 | __field(u32, dev) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 159 | __field(u32, seqno) |
| 160 | ), |
| 161 | |
| 162 | TP_fast_assign( |
Chris Wilson | 4f49be5 | 2009-09-24 00:23:33 +0100 | [diff] [blame] | 163 | __entry->dev = dev->primary->index; |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 164 | __entry->seqno = seqno; |
Chris Wilson | 9d34e5d | 2009-09-24 05:26:06 +0100 | [diff] [blame] | 165 | i915_trace_irq_get(dev, seqno); |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 166 | ), |
| 167 | |
Chris Wilson | 4f49be5 | 2009-09-24 00:23:33 +0100 | [diff] [blame] | 168 | TP_printk("dev=%u, seqno=%u", __entry->dev, __entry->seqno) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 169 | ); |
| 170 | |
| 171 | TRACE_EVENT(i915_gem_request_flush, |
| 172 | |
| 173 | TP_PROTO(struct drm_device *dev, u32 seqno, |
| 174 | u32 flush_domains, u32 invalidate_domains), |
| 175 | |
| 176 | TP_ARGS(dev, seqno, flush_domains, invalidate_domains), |
| 177 | |
| 178 | TP_STRUCT__entry( |
Chris Wilson | 4f49be5 | 2009-09-24 00:23:33 +0100 | [diff] [blame] | 179 | __field(u32, dev) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 180 | __field(u32, seqno) |
| 181 | __field(u32, flush_domains) |
| 182 | __field(u32, invalidate_domains) |
| 183 | ), |
| 184 | |
| 185 | TP_fast_assign( |
Chris Wilson | 4f49be5 | 2009-09-24 00:23:33 +0100 | [diff] [blame] | 186 | __entry->dev = dev->primary->index; |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 187 | __entry->seqno = seqno; |
| 188 | __entry->flush_domains = flush_domains; |
| 189 | __entry->invalidate_domains = invalidate_domains; |
| 190 | ), |
| 191 | |
Chris Wilson | 4f49be5 | 2009-09-24 00:23:33 +0100 | [diff] [blame] | 192 | TP_printk("dev=%u, seqno=%u, flush=%04x, invalidate=%04x", |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 193 | __entry->dev, __entry->seqno, |
| 194 | __entry->flush_domains, __entry->invalidate_domains) |
| 195 | ); |
| 196 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 197 | DECLARE_EVENT_CLASS(i915_gem_request, |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 198 | |
| 199 | TP_PROTO(struct drm_device *dev, u32 seqno), |
| 200 | |
| 201 | TP_ARGS(dev, seqno), |
| 202 | |
| 203 | TP_STRUCT__entry( |
Chris Wilson | 4f49be5 | 2009-09-24 00:23:33 +0100 | [diff] [blame] | 204 | __field(u32, dev) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 205 | __field(u32, seqno) |
| 206 | ), |
| 207 | |
| 208 | TP_fast_assign( |
Chris Wilson | 4f49be5 | 2009-09-24 00:23:33 +0100 | [diff] [blame] | 209 | __entry->dev = dev->primary->index; |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 210 | __entry->seqno = seqno; |
| 211 | ), |
| 212 | |
Chris Wilson | 4f49be5 | 2009-09-24 00:23:33 +0100 | [diff] [blame] | 213 | TP_printk("dev=%u, seqno=%u", __entry->dev, __entry->seqno) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 214 | ); |
| 215 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 216 | DEFINE_EVENT(i915_gem_request, i915_gem_request_complete, |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 217 | |
| 218 | TP_PROTO(struct drm_device *dev, u32 seqno), |
| 219 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 220 | TP_ARGS(dev, seqno) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 221 | ); |
| 222 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 223 | DEFINE_EVENT(i915_gem_request, i915_gem_request_retire, |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 224 | |
| 225 | TP_PROTO(struct drm_device *dev, u32 seqno), |
| 226 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 227 | TP_ARGS(dev, seqno) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 228 | ); |
| 229 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 230 | DEFINE_EVENT(i915_gem_request, i915_gem_request_wait_begin, |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 231 | |
| 232 | TP_PROTO(struct drm_device *dev, u32 seqno), |
| 233 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 234 | TP_ARGS(dev, seqno) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 235 | ); |
| 236 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 237 | DEFINE_EVENT(i915_gem_request, i915_gem_request_wait_end, |
| 238 | |
| 239 | TP_PROTO(struct drm_device *dev, u32 seqno), |
| 240 | |
| 241 | TP_ARGS(dev, seqno) |
| 242 | ); |
| 243 | |
| 244 | DECLARE_EVENT_CLASS(i915_ring, |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 245 | |
| 246 | TP_PROTO(struct drm_device *dev), |
| 247 | |
| 248 | TP_ARGS(dev), |
| 249 | |
| 250 | TP_STRUCT__entry( |
Chris Wilson | 4f49be5 | 2009-09-24 00:23:33 +0100 | [diff] [blame] | 251 | __field(u32, dev) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 252 | ), |
| 253 | |
| 254 | TP_fast_assign( |
Chris Wilson | 4f49be5 | 2009-09-24 00:23:33 +0100 | [diff] [blame] | 255 | __entry->dev = dev->primary->index; |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 256 | ), |
| 257 | |
Chris Wilson | 4f49be5 | 2009-09-24 00:23:33 +0100 | [diff] [blame] | 258 | TP_printk("dev=%u", __entry->dev) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 259 | ); |
| 260 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 261 | DEFINE_EVENT(i915_ring, i915_ring_wait_begin, |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 262 | |
| 263 | TP_PROTO(struct drm_device *dev), |
| 264 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 265 | TP_ARGS(dev) |
| 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_ring, i915_ring_wait_end, |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 269 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 270 | TP_PROTO(struct drm_device *dev), |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 271 | |
Li Zefan | 903cf20 | 2010-03-11 16:41:45 +0800 | [diff] [blame] | 272 | TP_ARGS(dev) |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 273 | ); |
| 274 | |
| 275 | #endif /* _I915_TRACE_H_ */ |
| 276 | |
| 277 | /* This part must be outside protection */ |
| 278 | #undef TRACE_INCLUDE_PATH |
Peter Clifton | a7c5427 | 2010-05-03 13:24:41 +0100 | [diff] [blame^] | 279 | #define TRACE_INCLUDE_PATH . |
Chris Wilson | 1c5d22f | 2009-08-25 11:15:50 +0100 | [diff] [blame] | 280 | #include <trace/define_trace.h> |