host1x.h 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  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. DECLARE_EVENT_CLASS(host1x,
  29. TP_PROTO(const char *name),
  30. TP_ARGS(name),
  31. TP_STRUCT__entry(__field(const char *, name)),
  32. TP_fast_assign(__entry->name = name;),
  33. TP_printk("name=%s", __entry->name)
  34. );
  35. DEFINE_EVENT(host1x, host1x_channel_open,
  36. TP_PROTO(const char *name),
  37. TP_ARGS(name)
  38. );
  39. DEFINE_EVENT(host1x, host1x_channel_release,
  40. TP_PROTO(const char *name),
  41. TP_ARGS(name)
  42. );
  43. DEFINE_EVENT(host1x, host1x_cdma_begin,
  44. TP_PROTO(const char *name),
  45. TP_ARGS(name)
  46. );
  47. DEFINE_EVENT(host1x, host1x_cdma_end,
  48. TP_PROTO(const char *name),
  49. TP_ARGS(name)
  50. );
  51. TRACE_EVENT(host1x_cdma_push,
  52. TP_PROTO(const char *name, u32 op1, u32 op2),
  53. TP_ARGS(name, op1, op2),
  54. TP_STRUCT__entry(
  55. __field(const char *, name)
  56. __field(u32, op1)
  57. __field(u32, op2)
  58. ),
  59. TP_fast_assign(
  60. __entry->name = name;
  61. __entry->op1 = op1;
  62. __entry->op2 = op2;
  63. ),
  64. TP_printk("name=%s, op1=%08x, op2=%08x",
  65. __entry->name, __entry->op1, __entry->op2)
  66. );
  67. TRACE_EVENT(host1x_cdma_push_gather,
  68. TP_PROTO(const char *name, u32 mem_id,
  69. u32 words, u32 offset, void *cmdbuf),
  70. TP_ARGS(name, mem_id, words, offset, cmdbuf),
  71. TP_STRUCT__entry(
  72. __field(const char *, name)
  73. __field(u32, mem_id)
  74. __field(u32, words)
  75. __field(u32, offset)
  76. __field(bool, cmdbuf)
  77. __dynamic_array(u32, cmdbuf, words)
  78. ),
  79. TP_fast_assign(
  80. if (cmdbuf) {
  81. memcpy(__get_dynamic_array(cmdbuf), cmdbuf+offset,
  82. words * sizeof(u32));
  83. }
  84. __entry->cmdbuf = cmdbuf;
  85. __entry->name = name;
  86. __entry->mem_id = mem_id;
  87. __entry->words = words;
  88. __entry->offset = offset;
  89. ),
  90. TP_printk("name=%s, mem_id=%08x, words=%u, offset=%d, contents=[%s]",
  91. __entry->name, __entry->mem_id,
  92. __entry->words, __entry->offset,
  93. __print_hex(__get_dynamic_array(cmdbuf),
  94. __entry->cmdbuf ? __entry->words * 4 : 0))
  95. );
  96. TRACE_EVENT(host1x_channel_submit,
  97. TP_PROTO(const char *name, u32 cmdbufs, u32 relocs, u32 waitchks,
  98. u32 syncpt_id, u32 syncpt_incrs),
  99. TP_ARGS(name, cmdbufs, relocs, waitchks, syncpt_id, syncpt_incrs),
  100. TP_STRUCT__entry(
  101. __field(const char *, name)
  102. __field(u32, cmdbufs)
  103. __field(u32, relocs)
  104. __field(u32, waitchks)
  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->waitchks = waitchks;
  113. __entry->syncpt_id = syncpt_id;
  114. __entry->syncpt_incrs = syncpt_incrs;
  115. ),
  116. TP_printk("name=%s, cmdbufs=%u, relocs=%u, waitchks=%d,"
  117. "syncpt_id=%u, syncpt_incrs=%u",
  118. __entry->name, __entry->cmdbufs, __entry->relocs, __entry->waitchks,
  119. __entry->syncpt_id, __entry->syncpt_incrs)
  120. );
  121. TRACE_EVENT(host1x_channel_submitted,
  122. TP_PROTO(const char *name, u32 syncpt_base, u32 syncpt_max),
  123. TP_ARGS(name, syncpt_base, syncpt_max),
  124. TP_STRUCT__entry(
  125. __field(const char *, name)
  126. __field(u32, syncpt_base)
  127. __field(u32, syncpt_max)
  128. ),
  129. TP_fast_assign(
  130. __entry->name = name;
  131. __entry->syncpt_base = syncpt_base;
  132. __entry->syncpt_max = syncpt_max;
  133. ),
  134. TP_printk("name=%s, syncpt_base=%d, syncpt_max=%d",
  135. __entry->name, __entry->syncpt_base, __entry->syncpt_max)
  136. );
  137. TRACE_EVENT(host1x_channel_submit_complete,
  138. TP_PROTO(const char *name, int count, u32 thresh),
  139. TP_ARGS(name, count, thresh),
  140. TP_STRUCT__entry(
  141. __field(const char *, name)
  142. __field(int, count)
  143. __field(u32, thresh)
  144. ),
  145. TP_fast_assign(
  146. __entry->name = name;
  147. __entry->count = count;
  148. __entry->thresh = thresh;
  149. ),
  150. TP_printk("name=%s, count=%d, thresh=%d",
  151. __entry->name, __entry->count, __entry->thresh)
  152. );
  153. TRACE_EVENT(host1x_wait_cdma,
  154. TP_PROTO(const char *name, u32 eventid),
  155. TP_ARGS(name, eventid),
  156. TP_STRUCT__entry(
  157. __field(const char *, name)
  158. __field(u32, eventid)
  159. ),
  160. TP_fast_assign(
  161. __entry->name = name;
  162. __entry->eventid = eventid;
  163. ),
  164. TP_printk("name=%s, event=%d", __entry->name, __entry->eventid)
  165. );
  166. TRACE_EVENT(host1x_syncpt_load_min,
  167. TP_PROTO(u32 id, u32 val),
  168. TP_ARGS(id, val),
  169. TP_STRUCT__entry(
  170. __field(u32, id)
  171. __field(u32, val)
  172. ),
  173. TP_fast_assign(
  174. __entry->id = id;
  175. __entry->val = val;
  176. ),
  177. TP_printk("id=%d, val=%d", __entry->id, __entry->val)
  178. );
  179. TRACE_EVENT(host1x_syncpt_wait_check,
  180. TP_PROTO(void *mem_id, u32 offset, u32 syncpt_id, u32 thresh, u32 min),
  181. TP_ARGS(mem_id, offset, syncpt_id, thresh, min),
  182. TP_STRUCT__entry(
  183. __field(void *, mem_id)
  184. __field(u32, offset)
  185. __field(u32, syncpt_id)
  186. __field(u32, thresh)
  187. __field(u32, min)
  188. ),
  189. TP_fast_assign(
  190. __entry->mem_id = mem_id;
  191. __entry->offset = offset;
  192. __entry->syncpt_id = syncpt_id;
  193. __entry->thresh = thresh;
  194. __entry->min = min;
  195. ),
  196. TP_printk("mem_id=%p, offset=%05x, id=%d, thresh=%d, current=%d",
  197. __entry->mem_id, __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>