host1x.h 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. /*
  2. * include/trace/events/host1x.h
  3. *
  4. * host1x event logging to ftrace.
  5. *
  6. * Copyright (c) 2010-2013, NVIDIA Corporation.
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful, but WITHOUT
  14. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  15. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  16. * more details.
  17. *
  18. * You should have received a copy of the GNU General Public License along
  19. * with this program; if not, write to the Free Software Foundation, Inc.,
  20. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  21. */
  22. #undef TRACE_SYSTEM
  23. #define TRACE_SYSTEM host1x
  24. #if !defined(_TRACE_HOST1X_H) || defined(TRACE_HEADER_MULTI_READ)
  25. #define _TRACE_HOST1X_H
  26. #include <linux/ktime.h>
  27. #include <linux/tracepoint.h>
  28. struct host1x_bo;
  29. DECLARE_EVENT_CLASS(host1x,
  30. TP_PROTO(const char *name),
  31. TP_ARGS(name),
  32. TP_STRUCT__entry(__field(const char *, name)),
  33. TP_fast_assign(__entry->name = name;),
  34. TP_printk("name=%s", __entry->name)
  35. );
  36. DEFINE_EVENT(host1x, host1x_channel_open,
  37. TP_PROTO(const char *name),
  38. TP_ARGS(name)
  39. );
  40. DEFINE_EVENT(host1x, host1x_channel_release,
  41. TP_PROTO(const char *name),
  42. TP_ARGS(name)
  43. );
  44. DEFINE_EVENT(host1x, host1x_cdma_begin,
  45. TP_PROTO(const char *name),
  46. TP_ARGS(name)
  47. );
  48. DEFINE_EVENT(host1x, host1x_cdma_end,
  49. TP_PROTO(const char *name),
  50. TP_ARGS(name)
  51. );
  52. TRACE_EVENT(host1x_cdma_push,
  53. TP_PROTO(const char *name, u32 op1, u32 op2),
  54. TP_ARGS(name, op1, op2),
  55. TP_STRUCT__entry(
  56. __field(const char *, name)
  57. __field(u32, op1)
  58. __field(u32, op2)
  59. ),
  60. TP_fast_assign(
  61. __entry->name = name;
  62. __entry->op1 = op1;
  63. __entry->op2 = op2;
  64. ),
  65. TP_printk("name=%s, op1=%08x, op2=%08x",
  66. __entry->name, __entry->op1, __entry->op2)
  67. );
  68. TRACE_EVENT(host1x_cdma_push_gather,
  69. TP_PROTO(const char *name, struct host1x_bo *bo,
  70. u32 words, u32 offset, void *cmdbuf),
  71. TP_ARGS(name, bo, words, offset, cmdbuf),
  72. TP_STRUCT__entry(
  73. __field(const char *, name)
  74. __field(struct host1x_bo *, bo)
  75. __field(u32, words)
  76. __field(u32, offset)
  77. __field(bool, cmdbuf)
  78. __dynamic_array(u32, cmdbuf, words)
  79. ),
  80. TP_fast_assign(
  81. if (cmdbuf) {
  82. memcpy(__get_dynamic_array(cmdbuf), cmdbuf+offset,
  83. words * sizeof(u32));
  84. }
  85. __entry->cmdbuf = cmdbuf;
  86. __entry->name = name;
  87. __entry->bo = bo;
  88. __entry->words = words;
  89. __entry->offset = offset;
  90. ),
  91. TP_printk("name=%s, bo=%p, words=%u, offset=%d, contents=[%s]",
  92. __entry->name, __entry->bo,
  93. __entry->words, __entry->offset,
  94. __print_hex(__get_dynamic_array(cmdbuf),
  95. __entry->cmdbuf ? __entry->words * 4 : 0))
  96. );
  97. TRACE_EVENT(host1x_channel_submit,
  98. TP_PROTO(const char *name, u32 cmdbufs, u32 relocs, u32 waitchks,
  99. u32 syncpt_id, u32 syncpt_incrs),
  100. TP_ARGS(name, cmdbufs, relocs, waitchks, syncpt_id, syncpt_incrs),
  101. TP_STRUCT__entry(
  102. __field(const char *, name)
  103. __field(u32, cmdbufs)
  104. __field(u32, relocs)
  105. __field(u32, waitchks)
  106. __field(u32, syncpt_id)
  107. __field(u32, syncpt_incrs)
  108. ),
  109. TP_fast_assign(
  110. __entry->name = name;
  111. __entry->cmdbufs = cmdbufs;
  112. __entry->relocs = relocs;
  113. __entry->waitchks = waitchks;
  114. __entry->syncpt_id = syncpt_id;
  115. __entry->syncpt_incrs = syncpt_incrs;
  116. ),
  117. TP_printk("name=%s, cmdbufs=%u, relocs=%u, waitchks=%d,"
  118. "syncpt_id=%u, syncpt_incrs=%u",
  119. __entry->name, __entry->cmdbufs, __entry->relocs, __entry->waitchks,
  120. __entry->syncpt_id, __entry->syncpt_incrs)
  121. );
  122. TRACE_EVENT(host1x_channel_submitted,
  123. TP_PROTO(const char *name, u32 syncpt_base, u32 syncpt_max),
  124. TP_ARGS(name, syncpt_base, syncpt_max),
  125. TP_STRUCT__entry(
  126. __field(const char *, name)
  127. __field(u32, syncpt_base)
  128. __field(u32, syncpt_max)
  129. ),
  130. TP_fast_assign(
  131. __entry->name = name;
  132. __entry->syncpt_base = syncpt_base;
  133. __entry->syncpt_max = syncpt_max;
  134. ),
  135. TP_printk("name=%s, syncpt_base=%d, syncpt_max=%d",
  136. __entry->name, __entry->syncpt_base, __entry->syncpt_max)
  137. );
  138. TRACE_EVENT(host1x_channel_submit_complete,
  139. TP_PROTO(const char *name, int count, u32 thresh),
  140. TP_ARGS(name, count, thresh),
  141. TP_STRUCT__entry(
  142. __field(const char *, name)
  143. __field(int, count)
  144. __field(u32, thresh)
  145. ),
  146. TP_fast_assign(
  147. __entry->name = name;
  148. __entry->count = count;
  149. __entry->thresh = thresh;
  150. ),
  151. TP_printk("name=%s, count=%d, thresh=%d",
  152. __entry->name, __entry->count, __entry->thresh)
  153. );
  154. TRACE_EVENT(host1x_wait_cdma,
  155. TP_PROTO(const char *name, u32 eventid),
  156. TP_ARGS(name, eventid),
  157. TP_STRUCT__entry(
  158. __field(const char *, name)
  159. __field(u32, eventid)
  160. ),
  161. TP_fast_assign(
  162. __entry->name = name;
  163. __entry->eventid = eventid;
  164. ),
  165. TP_printk("name=%s, event=%d", __entry->name, __entry->eventid)
  166. );
  167. TRACE_EVENT(host1x_syncpt_load_min,
  168. TP_PROTO(u32 id, u32 val),
  169. TP_ARGS(id, val),
  170. TP_STRUCT__entry(
  171. __field(u32, id)
  172. __field(u32, val)
  173. ),
  174. TP_fast_assign(
  175. __entry->id = id;
  176. __entry->val = val;
  177. ),
  178. TP_printk("id=%d, val=%d", __entry->id, __entry->val)
  179. );
  180. TRACE_EVENT(host1x_syncpt_wait_check,
  181. TP_PROTO(struct host1x_bo *bo, u32 offset, u32 syncpt_id, u32 thresh,
  182. u32 min),
  183. TP_ARGS(bo, offset, syncpt_id, thresh, min),
  184. TP_STRUCT__entry(
  185. __field(struct host1x_bo *, bo)
  186. __field(u32, offset)
  187. __field(u32, syncpt_id)
  188. __field(u32, thresh)
  189. __field(u32, min)
  190. ),
  191. TP_fast_assign(
  192. __entry->bo = bo;
  193. __entry->offset = offset;
  194. __entry->syncpt_id = syncpt_id;
  195. __entry->thresh = thresh;
  196. __entry->min = min;
  197. ),
  198. TP_printk("bo=%p, offset=%05x, id=%d, thresh=%d, current=%d",
  199. __entry->bo, __entry->offset,
  200. __entry->syncpt_id, __entry->thresh,
  201. __entry->min)
  202. );
  203. #endif /* _TRACE_HOST1X_H */
  204. /* This part must be outside protection */
  205. #include <trace/define_trace.h>