Dave Airlie | 99ee7fa | 2010-11-23 11:47:49 +1000 | [diff] [blame] | 1 | #if !defined(_RADEON_TRACE_H) || defined(TRACE_HEADER_MULTI_READ) |
| 2 | #define _RADEON_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 radeon |
Dave Airlie | 99ee7fa | 2010-11-23 11:47:49 +1000 | [diff] [blame] | 12 | #define TRACE_INCLUDE_FILE radeon_trace |
| 13 | |
| 14 | TRACE_EVENT(radeon_bo_create, |
| 15 | TP_PROTO(struct radeon_bo *bo), |
| 16 | TP_ARGS(bo), |
| 17 | TP_STRUCT__entry( |
| 18 | __field(struct radeon_bo *, bo) |
| 19 | __field(u32, pages) |
| 20 | ), |
| 21 | |
| 22 | TP_fast_assign( |
| 23 | __entry->bo = bo; |
| 24 | __entry->pages = bo->tbo.num_pages; |
| 25 | ), |
| 26 | TP_printk("bo=%p, pages=%u", __entry->bo, __entry->pages) |
| 27 | ); |
| 28 | |
Christian König | 860024e | 2013-09-07 18:29:01 +0200 | [diff] [blame] | 29 | TRACE_EVENT(radeon_cs, |
| 30 | TP_PROTO(struct radeon_cs_parser *p), |
| 31 | TP_ARGS(p), |
| 32 | TP_STRUCT__entry( |
| 33 | __field(u32, ring) |
| 34 | __field(u32, dw) |
| 35 | __field(u32, fences) |
| 36 | ), |
| 37 | |
| 38 | TP_fast_assign( |
| 39 | __entry->ring = p->ring; |
Christian König | 6d2d13d | 2014-12-03 15:53:24 +0100 | [diff] [blame] | 40 | __entry->dw = p->chunk_ib->length_dw; |
Christian König | 860024e | 2013-09-07 18:29:01 +0200 | [diff] [blame] | 41 | __entry->fences = radeon_fence_count_emitted( |
| 42 | p->rdev, p->ring); |
| 43 | ), |
| 44 | TP_printk("ring=%u, dw=%u, fences=%u", |
| 45 | __entry->ring, __entry->dw, |
| 46 | __entry->fences) |
| 47 | ); |
| 48 | |
Christian König | 84d597b | 2013-11-25 15:42:10 +0100 | [diff] [blame] | 49 | TRACE_EVENT(radeon_vm_grab_id, |
| 50 | TP_PROTO(unsigned vmid, int ring), |
| 51 | TP_ARGS(vmid, ring), |
| 52 | TP_STRUCT__entry( |
| 53 | __field(u32, vmid) |
| 54 | __field(u32, ring) |
| 55 | ), |
| 56 | |
| 57 | TP_fast_assign( |
| 58 | __entry->vmid = vmid; |
| 59 | __entry->ring = ring; |
| 60 | ), |
| 61 | TP_printk("vmid=%u, ring=%u", __entry->vmid, __entry->ring) |
| 62 | ); |
| 63 | |
Christian König | 9c57a6b | 2013-11-25 15:42:11 +0100 | [diff] [blame] | 64 | TRACE_EVENT(radeon_vm_bo_update, |
| 65 | TP_PROTO(struct radeon_bo_va *bo_va), |
| 66 | TP_ARGS(bo_va), |
| 67 | TP_STRUCT__entry( |
| 68 | __field(u64, soffset) |
| 69 | __field(u64, eoffset) |
| 70 | __field(u32, flags) |
| 71 | ), |
| 72 | |
| 73 | TP_fast_assign( |
Alex Deucher | 0aea5e4 | 2014-07-30 11:49:56 -0400 | [diff] [blame] | 74 | __entry->soffset = bo_va->it.start; |
| 75 | __entry->eoffset = bo_va->it.last + 1; |
Christian König | 9c57a6b | 2013-11-25 15:42:11 +0100 | [diff] [blame] | 76 | __entry->flags = bo_va->flags; |
| 77 | ), |
| 78 | TP_printk("soffs=%010llx, eoffs=%010llx, flags=%08x", |
| 79 | __entry->soffset, __entry->eoffset, __entry->flags) |
| 80 | ); |
| 81 | |
Christian König | 74d360f | 2013-10-29 20:14:48 +0100 | [diff] [blame] | 82 | TRACE_EVENT(radeon_vm_set_page, |
| 83 | TP_PROTO(uint64_t pe, uint64_t addr, unsigned count, |
| 84 | uint32_t incr, uint32_t flags), |
| 85 | TP_ARGS(pe, addr, count, incr, flags), |
| 86 | TP_STRUCT__entry( |
| 87 | __field(u64, pe) |
| 88 | __field(u64, addr) |
| 89 | __field(u32, count) |
| 90 | __field(u32, incr) |
| 91 | __field(u32, flags) |
| 92 | ), |
| 93 | |
| 94 | TP_fast_assign( |
| 95 | __entry->pe = pe; |
| 96 | __entry->addr = addr; |
| 97 | __entry->count = count; |
| 98 | __entry->incr = incr; |
| 99 | __entry->flags = flags; |
| 100 | ), |
| 101 | TP_printk("pe=%010Lx, addr=%010Lx, incr=%u, flags=%08x, count=%u", |
| 102 | __entry->pe, __entry->addr, __entry->incr, |
| 103 | __entry->flags, __entry->count) |
| 104 | ); |
| 105 | |
Christian König | a3a9226 | 2014-07-22 17:42:34 +0200 | [diff] [blame] | 106 | TRACE_EVENT(radeon_vm_flush, |
| 107 | TP_PROTO(uint64_t pd_addr, unsigned ring, unsigned id), |
| 108 | TP_ARGS(pd_addr, ring, id), |
| 109 | TP_STRUCT__entry( |
| 110 | __field(u64, pd_addr) |
| 111 | __field(u32, ring) |
| 112 | __field(u32, id) |
| 113 | ), |
| 114 | |
| 115 | TP_fast_assign( |
| 116 | __entry->pd_addr = pd_addr; |
| 117 | __entry->ring = ring; |
| 118 | __entry->id = id; |
| 119 | ), |
| 120 | TP_printk("pd_addr=%010Lx, ring=%u, id=%u", |
| 121 | __entry->pd_addr, __entry->ring, __entry->id) |
| 122 | ); |
| 123 | |
Dave Airlie | 99ee7fa | 2010-11-23 11:47:49 +1000 | [diff] [blame] | 124 | DECLARE_EVENT_CLASS(radeon_fence_request, |
| 125 | |
Christian König | 1d78416 | 2014-01-23 14:24:17 +0100 | [diff] [blame] | 126 | TP_PROTO(struct drm_device *dev, int ring, u32 seqno), |
Dave Airlie | 99ee7fa | 2010-11-23 11:47:49 +1000 | [diff] [blame] | 127 | |
Christian König | 1d78416 | 2014-01-23 14:24:17 +0100 | [diff] [blame] | 128 | TP_ARGS(dev, ring, seqno), |
Dave Airlie | 99ee7fa | 2010-11-23 11:47:49 +1000 | [diff] [blame] | 129 | |
| 130 | TP_STRUCT__entry( |
| 131 | __field(u32, dev) |
Christian König | 1d78416 | 2014-01-23 14:24:17 +0100 | [diff] [blame] | 132 | __field(int, ring) |
Dave Airlie | 99ee7fa | 2010-11-23 11:47:49 +1000 | [diff] [blame] | 133 | __field(u32, seqno) |
| 134 | ), |
| 135 | |
| 136 | TP_fast_assign( |
| 137 | __entry->dev = dev->primary->index; |
Christian König | 1d78416 | 2014-01-23 14:24:17 +0100 | [diff] [blame] | 138 | __entry->ring = ring; |
Dave Airlie | 99ee7fa | 2010-11-23 11:47:49 +1000 | [diff] [blame] | 139 | __entry->seqno = seqno; |
| 140 | ), |
| 141 | |
Christian König | 1d78416 | 2014-01-23 14:24:17 +0100 | [diff] [blame] | 142 | TP_printk("dev=%u, ring=%d, seqno=%u", |
| 143 | __entry->dev, __entry->ring, __entry->seqno) |
Dave Airlie | 99ee7fa | 2010-11-23 11:47:49 +1000 | [diff] [blame] | 144 | ); |
| 145 | |
| 146 | DEFINE_EVENT(radeon_fence_request, radeon_fence_emit, |
| 147 | |
Christian König | 1d78416 | 2014-01-23 14:24:17 +0100 | [diff] [blame] | 148 | TP_PROTO(struct drm_device *dev, int ring, u32 seqno), |
Dave Airlie | 99ee7fa | 2010-11-23 11:47:49 +1000 | [diff] [blame] | 149 | |
Christian König | 1d78416 | 2014-01-23 14:24:17 +0100 | [diff] [blame] | 150 | TP_ARGS(dev, ring, seqno) |
Dave Airlie | 99ee7fa | 2010-11-23 11:47:49 +1000 | [diff] [blame] | 151 | ); |
| 152 | |
Dave Airlie | 99ee7fa | 2010-11-23 11:47:49 +1000 | [diff] [blame] | 153 | DEFINE_EVENT(radeon_fence_request, radeon_fence_wait_begin, |
| 154 | |
Christian König | 1d78416 | 2014-01-23 14:24:17 +0100 | [diff] [blame] | 155 | TP_PROTO(struct drm_device *dev, int ring, u32 seqno), |
Dave Airlie | 99ee7fa | 2010-11-23 11:47:49 +1000 | [diff] [blame] | 156 | |
Christian König | 1d78416 | 2014-01-23 14:24:17 +0100 | [diff] [blame] | 157 | TP_ARGS(dev, ring, seqno) |
Dave Airlie | 99ee7fa | 2010-11-23 11:47:49 +1000 | [diff] [blame] | 158 | ); |
| 159 | |
| 160 | DEFINE_EVENT(radeon_fence_request, radeon_fence_wait_end, |
| 161 | |
Christian König | 1d78416 | 2014-01-23 14:24:17 +0100 | [diff] [blame] | 162 | TP_PROTO(struct drm_device *dev, int ring, u32 seqno), |
Dave Airlie | 99ee7fa | 2010-11-23 11:47:49 +1000 | [diff] [blame] | 163 | |
Christian König | 1d78416 | 2014-01-23 14:24:17 +0100 | [diff] [blame] | 164 | TP_ARGS(dev, ring, seqno) |
Dave Airlie | 99ee7fa | 2010-11-23 11:47:49 +1000 | [diff] [blame] | 165 | ); |
| 166 | |
Christian König | bd80c8b | 2013-11-12 12:58:04 +0100 | [diff] [blame] | 167 | DECLARE_EVENT_CLASS(radeon_semaphore_request, |
| 168 | |
| 169 | TP_PROTO(int ring, struct radeon_semaphore *sem), |
| 170 | |
| 171 | TP_ARGS(ring, sem), |
| 172 | |
| 173 | TP_STRUCT__entry( |
| 174 | __field(int, ring) |
| 175 | __field(signed, waiters) |
| 176 | __field(uint64_t, gpu_addr) |
| 177 | ), |
| 178 | |
| 179 | TP_fast_assign( |
| 180 | __entry->ring = ring; |
| 181 | __entry->waiters = sem->waiters; |
| 182 | __entry->gpu_addr = sem->gpu_addr; |
| 183 | ), |
| 184 | |
| 185 | TP_printk("ring=%u, waiters=%d, addr=%010Lx", __entry->ring, |
| 186 | __entry->waiters, __entry->gpu_addr) |
| 187 | ); |
| 188 | |
| 189 | DEFINE_EVENT(radeon_semaphore_request, radeon_semaphore_signale, |
| 190 | |
| 191 | TP_PROTO(int ring, struct radeon_semaphore *sem), |
| 192 | |
| 193 | TP_ARGS(ring, sem) |
| 194 | ); |
| 195 | |
| 196 | DEFINE_EVENT(radeon_semaphore_request, radeon_semaphore_wait, |
| 197 | |
| 198 | TP_PROTO(int ring, struct radeon_semaphore *sem), |
| 199 | |
| 200 | TP_ARGS(ring, sem) |
| 201 | ); |
| 202 | |
Dave Airlie | 99ee7fa | 2010-11-23 11:47:49 +1000 | [diff] [blame] | 203 | #endif |
| 204 | |
| 205 | /* This part must be outside protection */ |
| 206 | #undef TRACE_INCLUDE_PATH |
| 207 | #define TRACE_INCLUDE_PATH . |
| 208 | #include <trace/define_trace.h> |