host1x.h 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  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 syncpt_id,
  99. u32 syncpt_incrs),
  100. TP_ARGS(name, cmdbufs, relocs, syncpt_id, syncpt_incrs),
  101. TP_STRUCT__entry(
  102. __field(const char *, name)
  103. __field(u32, cmdbufs)
  104. __field(u32, relocs)
  105. __field(u32, syncpt_id)
  106. __field(u32, syncpt_incrs)
  107. ),
  108. TP_fast_assign(
  109. __entry->name = name;
  110. __entry->cmdbufs = cmdbufs;
  111. __entry->relocs = relocs;
  112. __entry->syncpt_id = syncpt_id;
  113. __entry->syncpt_incrs = syncpt_incrs;
  114. ),
  115. TP_printk("name=%s, cmdbufs=%u, relocs=%u, syncpt_id=%u, "
  116. "syncpt_incrs=%u",
  117. __entry->name, __entry->cmdbufs, __entry->relocs,
  118. __entry->syncpt_id, __entry->syncpt_incrs)
  119. );
  120. TRACE_EVENT(host1x_channel_submitted,
  121. TP_PROTO(const char *name, u32 syncpt_base, u32 syncpt_max),
  122. TP_ARGS(name, syncpt_base, syncpt_max),
  123. TP_STRUCT__entry(
  124. __field(const char *, name)
  125. __field(u32, syncpt_base)
  126. __field(u32, syncpt_max)
  127. ),
  128. TP_fast_assign(
  129. __entry->name = name;
  130. __entry->syncpt_base = syncpt_base;
  131. __entry->syncpt_max = syncpt_max;
  132. ),
  133. TP_printk("name=%s, syncpt_base=%d, syncpt_max=%d",
  134. __entry->name, __entry->syncpt_base, __entry->syncpt_max)
  135. );
  136. TRACE_EVENT(host1x_channel_submit_complete,
  137. TP_PROTO(const char *name, int count, u32 thresh),
  138. TP_ARGS(name, count, thresh),
  139. TP_STRUCT__entry(
  140. __field(const char *, name)
  141. __field(int, count)
  142. __field(u32, thresh)
  143. ),
  144. TP_fast_assign(
  145. __entry->name = name;
  146. __entry->count = count;
  147. __entry->thresh = thresh;
  148. ),
  149. TP_printk("name=%s, count=%d, thresh=%d",
  150. __entry->name, __entry->count, __entry->thresh)
  151. );
  152. TRACE_EVENT(host1x_wait_cdma,
  153. TP_PROTO(const char *name, u32 eventid),
  154. TP_ARGS(name, eventid),
  155. TP_STRUCT__entry(
  156. __field(const char *, name)
  157. __field(u32, eventid)
  158. ),
  159. TP_fast_assign(
  160. __entry->name = name;
  161. __entry->eventid = eventid;
  162. ),
  163. TP_printk("name=%s, event=%d", __entry->name, __entry->eventid)
  164. );
  165. TRACE_EVENT(host1x_syncpt_load_min,
  166. TP_PROTO(u32 id, u32 val),
  167. TP_ARGS(id, val),
  168. TP_STRUCT__entry(
  169. __field(u32, id)
  170. __field(u32, val)
  171. ),
  172. TP_fast_assign(
  173. __entry->id = id;
  174. __entry->val = val;
  175. ),
  176. TP_printk("id=%d, val=%d", __entry->id, __entry->val)
  177. );
  178. TRACE_EVENT(host1x_syncpt_wait_check,
  179. TP_PROTO(struct host1x_bo *bo, u32 offset, u32 syncpt_id, u32 thresh,
  180. u32 min),
  181. TP_ARGS(bo, offset, syncpt_id, thresh, min),
  182. TP_STRUCT__entry(
  183. __field(struct host1x_bo *, bo)
  184. __field(u32, offset)
  185. __field(u32, syncpt_id)
  186. __field(u32, thresh)
  187. __field(u32, min)
  188. ),
  189. TP_fast_assign(
  190. __entry->bo = bo;
  191. __entry->offset = offset;
  192. __entry->syncpt_id = syncpt_id;
  193. __entry->thresh = thresh;
  194. __entry->min = min;
  195. ),
  196. TP_printk("bo=%p, offset=%05x, id=%d, thresh=%d, current=%d",
  197. __entry->bo, __entry->offset,
  198. __entry->syncpt_id, __entry->thresh,
  199. __entry->min)
  200. );
  201. #endif /* _TRACE_HOST1X_H */
  202. /* This part must be outside protection */
  203. #include <trace/define_trace.h>