msm_vidc.h 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348
  1. /* Copyright (c) 2014-2017, The Linux Foundation. All rights reserved.
  2. *
  3. * This program is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License version 2 and
  5. * only version 2 as published by the Free Software Foundation.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. *
  12. */
  13. #undef TRACE_SYSTEM
  14. #define TRACE_SYSTEM msm_vidc
  15. #if !defined(_TRACE_MSM_VIDC_H_) || defined(TRACE_HEADER_MULTI_READ)
  16. #define _TRACE_MSM_VIDC_H
  17. #include <linux/types.h>
  18. #include <linux/tracepoint.h>
  19. DECLARE_EVENT_CLASS(msm_v4l2_vidc,
  20. TP_PROTO(char *dummy),
  21. TP_ARGS(dummy),
  22. TP_STRUCT__entry(
  23. __field(char *, dummy)
  24. ),
  25. TP_fast_assign(
  26. __entry->dummy = dummy;
  27. ),
  28. TP_printk("%s", __entry->dummy)
  29. );
  30. DEFINE_EVENT(msm_v4l2_vidc, msm_v4l2_vidc_open_start,
  31. TP_PROTO(char *dummy),
  32. TP_ARGS(dummy)
  33. );
  34. DEFINE_EVENT(msm_v4l2_vidc, msm_v4l2_vidc_open_end,
  35. TP_PROTO(char *dummy),
  36. TP_ARGS(dummy)
  37. );
  38. DEFINE_EVENT(msm_v4l2_vidc, msm_v4l2_vidc_close_start,
  39. TP_PROTO(char *dummy),
  40. TP_ARGS(dummy)
  41. );
  42. DEFINE_EVENT(msm_v4l2_vidc, msm_v4l2_vidc_close_end,
  43. TP_PROTO(char *dummy),
  44. TP_ARGS(dummy)
  45. );
  46. DEFINE_EVENT(msm_v4l2_vidc, msm_v4l2_vidc_fw_load_start,
  47. TP_PROTO(char *dummy),
  48. TP_ARGS(dummy)
  49. );
  50. DEFINE_EVENT(msm_v4l2_vidc, msm_v4l2_vidc_fw_load_end,
  51. TP_PROTO(char *dummy),
  52. TP_ARGS(dummy)
  53. );
  54. DECLARE_EVENT_CLASS(msm_vidc_common,
  55. TP_PROTO(void *instp, int old_state, int new_state),
  56. TP_ARGS(instp, old_state, new_state),
  57. TP_STRUCT__entry(
  58. __field(void *, instp)
  59. __field(int, old_state)
  60. __field(int, new_state)
  61. ),
  62. TP_fast_assign(
  63. __entry->instp = instp;
  64. __entry->old_state = old_state;
  65. __entry->new_state = new_state;
  66. ),
  67. TP_printk("Moved inst: %p from 0x%x to 0x%x",
  68. __entry->instp,
  69. __entry->old_state,
  70. __entry->new_state)
  71. );
  72. DEFINE_EVENT(msm_vidc_common, msm_vidc_common_state_change,
  73. TP_PROTO(void *instp, int old_state, int new_state),
  74. TP_ARGS(instp, old_state, new_state)
  75. );
  76. DECLARE_EVENT_CLASS(venus_hfi_var,
  77. TP_PROTO(u32 cp_start, u32 cp_size,
  78. u32 cp_nonpixel_start, u32 cp_nonpixel_size),
  79. TP_ARGS(cp_start, cp_size, cp_nonpixel_start, cp_nonpixel_size),
  80. TP_STRUCT__entry(
  81. __field(u32, cp_start)
  82. __field(u32, cp_size)
  83. __field(u32, cp_nonpixel_start)
  84. __field(u32, cp_nonpixel_size)
  85. ),
  86. TP_fast_assign(
  87. __entry->cp_start = cp_start;
  88. __entry->cp_size = cp_size;
  89. __entry->cp_nonpixel_start = cp_nonpixel_start;
  90. __entry->cp_nonpixel_size = cp_nonpixel_size;
  91. ),
  92. TP_printk(
  93. "TZBSP_MEM_PROTECT_VIDEO_VAR done, cp_start : 0x%x, cp_size : 0x%x, cp_nonpixel_start : 0x%x, cp_nonpixel_size : 0x%x",
  94. __entry->cp_start,
  95. __entry->cp_size,
  96. __entry->cp_nonpixel_start,
  97. __entry->cp_nonpixel_size)
  98. );
  99. DEFINE_EVENT(venus_hfi_var, venus_hfi_var_done,
  100. TP_PROTO(u32 cp_start, u32 cp_size,
  101. u32 cp_nonpixel_start, u32 cp_nonpixel_size),
  102. TP_ARGS(cp_start, cp_size, cp_nonpixel_start, cp_nonpixel_size)
  103. );
  104. DECLARE_EVENT_CLASS(msm_v4l2_vidc_buffer_events,
  105. TP_PROTO(char *event_type, u32 device_addr, int64_t timestamp,
  106. u32 alloc_len, u32 filled_len, u32 offset),
  107. TP_ARGS(event_type, device_addr, timestamp, alloc_len,
  108. filled_len, offset),
  109. TP_STRUCT__entry(
  110. __field(char *, event_type)
  111. __field(u32, device_addr)
  112. __field(int64_t, timestamp)
  113. __field(u32, alloc_len)
  114. __field(u32, filled_len)
  115. __field(u32, offset)
  116. ),
  117. TP_fast_assign(
  118. __entry->event_type = event_type;
  119. __entry->device_addr = device_addr;
  120. __entry->timestamp = timestamp;
  121. __entry->alloc_len = alloc_len;
  122. __entry->filled_len = filled_len;
  123. __entry->offset = offset;
  124. ),
  125. TP_printk(
  126. "%s, device_addr : 0x%x, timestamp : %lld, alloc_len : 0x%x, filled_len : 0x%x, offset : 0x%x",
  127. __entry->event_type,
  128. __entry->device_addr,
  129. __entry->timestamp,
  130. __entry->alloc_len,
  131. __entry->filled_len,
  132. __entry->offset)
  133. );
  134. DEFINE_EVENT(msm_v4l2_vidc_buffer_events, msm_v4l2_vidc_buffer_event_start,
  135. TP_PROTO(char *event_type, u32 device_addr, int64_t timestamp,
  136. u32 alloc_len, u32 filled_len, u32 offset),
  137. TP_ARGS(event_type, device_addr, timestamp, alloc_len,
  138. filled_len, offset)
  139. );
  140. DEFINE_EVENT(msm_v4l2_vidc_buffer_events, msm_v4l2_vidc_buffer_event_end,
  141. TP_PROTO(char *event_type, u32 device_addr, int64_t timestamp,
  142. u32 alloc_len, u32 filled_len, u32 offset),
  143. TP_ARGS(event_type, device_addr, timestamp, alloc_len,
  144. filled_len, offset)
  145. );
  146. DECLARE_EVENT_CLASS(msm_smem_buffer_ion_ops,
  147. TP_PROTO(char *buffer_op, u32 buffer_type, u32 heap_mask,
  148. size_t size, u32 align, u32 flags, int map_kernel),
  149. TP_ARGS(buffer_op, buffer_type, heap_mask, size, align,
  150. flags, map_kernel),
  151. TP_STRUCT__entry(
  152. __field(char *, buffer_op)
  153. __field(u32, buffer_type)
  154. __field(u32, heap_mask)
  155. __field(u32, size)
  156. __field(u32, align)
  157. __field(u32, flags)
  158. __field(int, map_kernel)
  159. ),
  160. TP_fast_assign(
  161. __entry->buffer_op = buffer_op;
  162. __entry->buffer_type = buffer_type;
  163. __entry->heap_mask = heap_mask;
  164. __entry->size = size;
  165. __entry->align = align;
  166. __entry->flags = flags;
  167. __entry->map_kernel = map_kernel;
  168. ),
  169. TP_printk(
  170. "%s, buffer_type : 0x%x, heap_mask : 0x%x, size : 0x%x, align : 0x%x, flags : 0x%x, map_kernel : %d",
  171. __entry->buffer_op,
  172. __entry->buffer_type,
  173. __entry->heap_mask,
  174. __entry->size,
  175. __entry->align,
  176. __entry->flags,
  177. __entry->map_kernel)
  178. );
  179. DEFINE_EVENT(msm_smem_buffer_ion_ops, msm_smem_buffer_ion_op_start,
  180. TP_PROTO(char *buffer_op, u32 buffer_type, u32 heap_mask,
  181. size_t size, u32 align, u32 flags, int map_kernel),
  182. TP_ARGS(buffer_op, buffer_type, heap_mask, size, align,
  183. flags, map_kernel)
  184. );
  185. DEFINE_EVENT(msm_smem_buffer_ion_ops, msm_smem_buffer_ion_op_end,
  186. TP_PROTO(char *buffer_op, u32 buffer_type, u32 heap_mask,
  187. size_t size, u32 align, u32 flags, int map_kernel),
  188. TP_ARGS(buffer_op, buffer_type, heap_mask, size, align,
  189. flags, map_kernel)
  190. );
  191. DECLARE_EVENT_CLASS(msm_smem_buffer_iommu_ops,
  192. TP_PROTO(char *buffer_op, int domain_num, int partition_num,
  193. unsigned long align, unsigned long iova,
  194. unsigned long buffer_size),
  195. TP_ARGS(buffer_op, domain_num, partition_num, align, iova, buffer_size),
  196. TP_STRUCT__entry(
  197. __field(char *, buffer_op)
  198. __field(int, domain_num)
  199. __field(int, partition_num)
  200. __field(unsigned long, align)
  201. __field(unsigned long, iova)
  202. __field(unsigned long, buffer_size)
  203. ),
  204. TP_fast_assign(
  205. __entry->buffer_op = buffer_op;
  206. __entry->domain_num = domain_num;
  207. __entry->partition_num = partition_num;
  208. __entry->align = align;
  209. __entry->iova = iova;
  210. __entry->buffer_size = buffer_size;
  211. ),
  212. TP_printk(
  213. "%s, domain : %d, partition : %d, align : %lx, iova : 0x%lx, buffer_size=%lx",
  214. __entry->buffer_op,
  215. __entry->domain_num,
  216. __entry->partition_num,
  217. __entry->align,
  218. __entry->iova,
  219. __entry->buffer_size)
  220. );
  221. DEFINE_EVENT(msm_smem_buffer_iommu_ops, msm_smem_buffer_iommu_op_start,
  222. TP_PROTO(char *buffer_op, int domain_num, int partition_num,
  223. unsigned long align, unsigned long iova,
  224. unsigned long buffer_size),
  225. TP_ARGS(buffer_op, domain_num, partition_num, align, iova, buffer_size)
  226. );
  227. DEFINE_EVENT(msm_smem_buffer_iommu_ops, msm_smem_buffer_iommu_op_end,
  228. TP_PROTO(char *buffer_op, int domain_num, int partition_num,
  229. unsigned long align, unsigned long iova,
  230. unsigned long buffer_size),
  231. TP_ARGS(buffer_op, domain_num, partition_num, align, iova, buffer_size)
  232. );
  233. DECLARE_EVENT_CLASS(msm_vidc_perf,
  234. TP_PROTO(const char *name, unsigned long value),
  235. TP_ARGS(name, value),
  236. TP_STRUCT__entry(
  237. __field(const char *, name)
  238. __field(unsigned long, value)
  239. ),
  240. TP_fast_assign(
  241. __entry->name = name;
  242. __entry->value = value;
  243. ),
  244. TP_printk("%s %lu", __entry->name, __entry->value)
  245. );
  246. DEFINE_EVENT(msm_vidc_perf, msm_vidc_perf_clock_scale,
  247. TP_PROTO(const char *clock_name, unsigned long frequency),
  248. TP_ARGS(clock_name, frequency)
  249. );
  250. DEFINE_EVENT(msm_vidc_perf, msm_vidc_perf_bus_vote,
  251. TP_PROTO(const char *governor_mode, unsigned long ab),
  252. TP_ARGS(governor_mode, ab)
  253. );
  254. #endif
  255. #include <trace/define_trace.h>