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