radeon_trace.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. #if !defined(_RADEON_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
  2. #define _RADEON_TRACE_H_
  3. #include <linux/stringify.h>
  4. #include <linux/types.h>
  5. #include <linux/tracepoint.h>
  6. #include <drm/drmP.h>
  7. #undef TRACE_SYSTEM
  8. #define TRACE_SYSTEM radeon
  9. #define TRACE_INCLUDE_FILE radeon_trace
  10. TRACE_EVENT(radeon_bo_create,
  11. TP_PROTO(struct radeon_bo *bo),
  12. TP_ARGS(bo),
  13. TP_STRUCT__entry(
  14. __field(struct radeon_bo *, bo)
  15. __field(u32, pages)
  16. ),
  17. TP_fast_assign(
  18. __entry->bo = bo;
  19. __entry->pages = bo->tbo.num_pages;
  20. ),
  21. TP_printk("bo=%p, pages=%u", __entry->bo, __entry->pages)
  22. );
  23. TRACE_EVENT(radeon_cs,
  24. TP_PROTO(struct radeon_cs_parser *p),
  25. TP_ARGS(p),
  26. TP_STRUCT__entry(
  27. __field(u32, ring)
  28. __field(u32, dw)
  29. __field(u32, fences)
  30. ),
  31. TP_fast_assign(
  32. __entry->ring = p->ring;
  33. __entry->dw = p->chunk_ib->length_dw;
  34. __entry->fences = radeon_fence_count_emitted(
  35. p->rdev, p->ring);
  36. ),
  37. TP_printk("ring=%u, dw=%u, fences=%u",
  38. __entry->ring, __entry->dw,
  39. __entry->fences)
  40. );
  41. TRACE_EVENT(radeon_vm_grab_id,
  42. TP_PROTO(unsigned vmid, int ring),
  43. TP_ARGS(vmid, ring),
  44. TP_STRUCT__entry(
  45. __field(u32, vmid)
  46. __field(u32, ring)
  47. ),
  48. TP_fast_assign(
  49. __entry->vmid = vmid;
  50. __entry->ring = ring;
  51. ),
  52. TP_printk("vmid=%u, ring=%u", __entry->vmid, __entry->ring)
  53. );
  54. TRACE_EVENT(radeon_vm_bo_update,
  55. TP_PROTO(struct radeon_bo_va *bo_va),
  56. TP_ARGS(bo_va),
  57. TP_STRUCT__entry(
  58. __field(u64, soffset)
  59. __field(u64, eoffset)
  60. __field(u32, flags)
  61. ),
  62. TP_fast_assign(
  63. __entry->soffset = bo_va->it.start;
  64. __entry->eoffset = bo_va->it.last + 1;
  65. __entry->flags = bo_va->flags;
  66. ),
  67. TP_printk("soffs=%010llx, eoffs=%010llx, flags=%08x",
  68. __entry->soffset, __entry->eoffset, __entry->flags)
  69. );
  70. TRACE_EVENT(radeon_vm_set_page,
  71. TP_PROTO(uint64_t pe, uint64_t addr, unsigned count,
  72. uint32_t incr, uint32_t flags),
  73. TP_ARGS(pe, addr, count, incr, flags),
  74. TP_STRUCT__entry(
  75. __field(u64, pe)
  76. __field(u64, addr)
  77. __field(u32, count)
  78. __field(u32, incr)
  79. __field(u32, flags)
  80. ),
  81. TP_fast_assign(
  82. __entry->pe = pe;
  83. __entry->addr = addr;
  84. __entry->count = count;
  85. __entry->incr = incr;
  86. __entry->flags = flags;
  87. ),
  88. TP_printk("pe=%010Lx, addr=%010Lx, incr=%u, flags=%08x, count=%u",
  89. __entry->pe, __entry->addr, __entry->incr,
  90. __entry->flags, __entry->count)
  91. );
  92. TRACE_EVENT(radeon_vm_flush,
  93. TP_PROTO(uint64_t pd_addr, unsigned ring, unsigned id),
  94. TP_ARGS(pd_addr, ring, id),
  95. TP_STRUCT__entry(
  96. __field(u64, pd_addr)
  97. __field(u32, ring)
  98. __field(u32, id)
  99. ),
  100. TP_fast_assign(
  101. __entry->pd_addr = pd_addr;
  102. __entry->ring = ring;
  103. __entry->id = id;
  104. ),
  105. TP_printk("pd_addr=%010Lx, ring=%u, id=%u",
  106. __entry->pd_addr, __entry->ring, __entry->id)
  107. );
  108. DECLARE_EVENT_CLASS(radeon_fence_request,
  109. TP_PROTO(struct drm_device *dev, int ring, u32 seqno),
  110. TP_ARGS(dev, ring, seqno),
  111. TP_STRUCT__entry(
  112. __field(u32, dev)
  113. __field(int, ring)
  114. __field(u32, seqno)
  115. ),
  116. TP_fast_assign(
  117. __entry->dev = dev->primary->index;
  118. __entry->ring = ring;
  119. __entry->seqno = seqno;
  120. ),
  121. TP_printk("dev=%u, ring=%d, seqno=%u",
  122. __entry->dev, __entry->ring, __entry->seqno)
  123. );
  124. DEFINE_EVENT(radeon_fence_request, radeon_fence_emit,
  125. TP_PROTO(struct drm_device *dev, int ring, u32 seqno),
  126. TP_ARGS(dev, ring, seqno)
  127. );
  128. DEFINE_EVENT(radeon_fence_request, radeon_fence_wait_begin,
  129. TP_PROTO(struct drm_device *dev, int ring, u32 seqno),
  130. TP_ARGS(dev, ring, seqno)
  131. );
  132. DEFINE_EVENT(radeon_fence_request, radeon_fence_wait_end,
  133. TP_PROTO(struct drm_device *dev, int ring, u32 seqno),
  134. TP_ARGS(dev, ring, seqno)
  135. );
  136. DECLARE_EVENT_CLASS(radeon_semaphore_request,
  137. TP_PROTO(int ring, struct radeon_semaphore *sem),
  138. TP_ARGS(ring, sem),
  139. TP_STRUCT__entry(
  140. __field(int, ring)
  141. __field(signed, waiters)
  142. __field(uint64_t, gpu_addr)
  143. ),
  144. TP_fast_assign(
  145. __entry->ring = ring;
  146. __entry->waiters = sem->waiters;
  147. __entry->gpu_addr = sem->gpu_addr;
  148. ),
  149. TP_printk("ring=%u, waiters=%d, addr=%010Lx", __entry->ring,
  150. __entry->waiters, __entry->gpu_addr)
  151. );
  152. DEFINE_EVENT(radeon_semaphore_request, radeon_semaphore_signale,
  153. TP_PROTO(int ring, struct radeon_semaphore *sem),
  154. TP_ARGS(ring, sem)
  155. );
  156. DEFINE_EVENT(radeon_semaphore_request, radeon_semaphore_wait,
  157. TP_PROTO(int ring, struct radeon_semaphore *sem),
  158. TP_ARGS(ring, sem)
  159. );
  160. #endif
  161. /* This part must be outside protection */
  162. #undef TRACE_INCLUDE_PATH
  163. #define TRACE_INCLUDE_PATH .
  164. #include <trace/define_trace.h>