msm_vidc_events.h 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2012-2021, The Linux Foundation. All rights reserved.
  4. */
  5. #if !defined(_TRACE_MSM_VIDC_H) || defined(TRACE_HEADER_MULTI_READ)
  6. #define _TRACE_MSM_VIDC_H
  7. #undef TRACE_SYSTEM
  8. #define TRACE_SYSTEM msm_vidc_events
  9. #undef TRACE_INCLUDE_PATH
  10. #define TRACE_INCLUDE_PATH .
  11. #undef TRACE_INCLUDE_FILE
  12. #define TRACE_INCLUDE_FILE msm_vidc_events
  13. #include <linux/tracepoint.h>
  14. #include "msm_vidc_inst.h"
  15. DECLARE_EVENT_CLASS(msm_v4l2_vidc_inst,
  16. TP_PROTO(char *dummy, struct msm_vidc_inst *inst),
  17. TP_ARGS(dummy, inst),
  18. TP_STRUCT__entry(
  19. __field(char *, dummy)
  20. __field(const char *, debug_str)
  21. ),
  22. TP_fast_assign(
  23. __entry->dummy = dummy;
  24. __entry->debug_str = inst ? inst->debug_str : (u8 *)"";
  25. ),
  26. TP_printk("%s: %s\n", __entry->dummy, __entry->debug_str)
  27. );
  28. DEFINE_EVENT(msm_v4l2_vidc_inst, msm_v4l2_vidc_open,
  29. TP_PROTO(char *dummy, struct msm_vidc_inst *inst),
  30. TP_ARGS(dummy, inst)
  31. );
  32. DEFINE_EVENT(msm_v4l2_vidc_inst, msm_v4l2_vidc_close,
  33. TP_PROTO(char *dummy, struct msm_vidc_inst *inst),
  34. TP_ARGS(dummy, inst)
  35. );
  36. DECLARE_EVENT_CLASS(msm_v4l2_vidc_fw_load,
  37. TP_PROTO(char *dummy),
  38. TP_ARGS(dummy),
  39. TP_STRUCT__entry(
  40. __field(char *, dummy)
  41. ),
  42. TP_fast_assign(
  43. __entry->dummy = dummy;
  44. ),
  45. TP_printk("%s\n", __entry->dummy)
  46. );
  47. DEFINE_EVENT(msm_v4l2_vidc_fw_load, msm_v4l2_vidc_fw_load,
  48. TP_PROTO(char *dummy),
  49. TP_ARGS(dummy)
  50. );
  51. DECLARE_EVENT_CLASS(msm_vidc_driver,
  52. TP_PROTO(struct msm_vidc_inst *inst, const char *func,
  53. const char *old_state, const char *new_state),
  54. TP_ARGS(inst, func, old_state, new_state),
  55. TP_STRUCT__entry(
  56. __field(const char *, debug_str)
  57. __field(const char *, func)
  58. __field(const char *, old_state)
  59. __field(const char *, new_state)
  60. ),
  61. TP_fast_assign(
  62. __entry->debug_str = inst ? inst->debug_str : (u8 *)"";
  63. __entry->func = func;
  64. __entry->old_state = old_state;
  65. __entry->new_state = new_state;
  66. ),
  67. TP_printk("%s: %s: state changed to %s from %s\n",
  68. __entry->debug_str,
  69. __entry->func,
  70. __entry->new_state,
  71. __entry->old_state)
  72. );
  73. DEFINE_EVENT(msm_vidc_driver, msm_vidc_common_state_change,
  74. TP_PROTO(struct msm_vidc_inst *inst, const char *func,
  75. const char *old_state, const char *new_state),
  76. TP_ARGS(inst, func, old_state, new_state)
  77. );
  78. DECLARE_EVENT_CLASS(venus_hfi_var,
  79. TP_PROTO(u32 cp_start, u32 cp_size,
  80. u32 cp_nonpixel_start, u32 cp_nonpixel_size),
  81. TP_ARGS(cp_start, cp_size, cp_nonpixel_start, cp_nonpixel_size),
  82. TP_STRUCT__entry(
  83. __field(u32, cp_start)
  84. __field(u32, cp_size)
  85. __field(u32, cp_nonpixel_start)
  86. __field(u32, cp_nonpixel_size)
  87. ),
  88. TP_fast_assign(
  89. __entry->cp_start = cp_start;
  90. __entry->cp_size = cp_size;
  91. __entry->cp_nonpixel_start = cp_nonpixel_start;
  92. __entry->cp_nonpixel_size = cp_nonpixel_size;
  93. ),
  94. TP_printk(
  95. "TZBSP_MEM_PROTECT_VIDEO_VAR done, cp_start : 0x%x, cp_size : 0x%x, cp_nonpixel_start : 0x%x, cp_nonpixel_size : 0x%x\n",
  96. __entry->cp_start,
  97. __entry->cp_size,
  98. __entry->cp_nonpixel_start,
  99. __entry->cp_nonpixel_size)
  100. );
  101. DEFINE_EVENT(venus_hfi_var, venus_hfi_var_done,
  102. TP_PROTO(u32 cp_start, u32 cp_size,
  103. u32 cp_nonpixel_start, u32 cp_nonpixel_size),
  104. TP_ARGS(cp_start, cp_size, cp_nonpixel_start, cp_nonpixel_size)
  105. );
  106. DECLARE_EVENT_CLASS(msm_v4l2_vidc_buffer_events,
  107. TP_PROTO(struct msm_vidc_inst *inst, const char *str, const char *buf_type,
  108. struct msm_vidc_buffer *vbuf, unsigned long inode, long ref_count),
  109. TP_ARGS(inst, str, buf_type, vbuf, inode, ref_count),
  110. TP_STRUCT__entry(
  111. __field(u8 *, debug_str)
  112. __field(const char *, str)
  113. __field(const char *, buf_type)
  114. __field(u32, index)
  115. __field(int, fd)
  116. __field(u32, data_offset)
  117. __field(u64, device_addr)
  118. __field(unsigned long, inode)
  119. __field(long, ref_count)
  120. __field(u32, buffer_size)
  121. __field(u32, data_size)
  122. __field(u32, flags)
  123. __field(u64, timestamp)
  124. __field(int, attr)
  125. __field(u64, etb)
  126. __field(u64, ebd)
  127. __field(u64, ftb)
  128. __field(u64, fbd)
  129. ),
  130. TP_fast_assign(
  131. __entry->debug_str = inst ? inst->debug_str : (u8 *)"";
  132. __entry->str = str;
  133. __entry->buf_type = buf_type;
  134. __entry->index = vbuf ? vbuf->index : -1;
  135. __entry->fd = vbuf ? vbuf->fd : 0;
  136. __entry->data_offset = vbuf ? vbuf->data_offset : 0;
  137. __entry->device_addr = vbuf ? vbuf->device_addr : 0;
  138. __entry->inode = inode;
  139. __entry->ref_count = ref_count;
  140. __entry->buffer_size = vbuf ? vbuf->buffer_size : 0;
  141. __entry->data_size = vbuf ? vbuf->data_size : 0;
  142. __entry->flags = vbuf ? vbuf->flags : 0;
  143. __entry->timestamp = vbuf ? vbuf->timestamp : 0;
  144. __entry->attr = vbuf ? vbuf->attr : 0;
  145. __entry->etb = inst ? inst->debug_count.etb : 0;
  146. __entry->ebd = inst ? inst->debug_count.ebd : 0;
  147. __entry->ftb = inst ? inst->debug_count.ftb : 0;
  148. __entry->fbd = inst ? inst->debug_count.fbd : 0;
  149. ),
  150. TP_printk(
  151. "%s: %s: %s: idx %2d fd %3d off %d daddr %#llx inode %8lu ref %2ld size %8d filled %8d flags %#x ts %8lld attr %#x counts(etb ebd ftb fbd) %4llu %4llu %4llu %4llu\n",
  152. __entry->debug_str, __entry->str, __entry->buf_type, __entry->index, __entry->fd,
  153. __entry->data_offset, __entry->device_addr, __entry->inode, __entry->ref_count,
  154. __entry->buffer_size, __entry->data_size, __entry->flags, __entry->timestamp,
  155. __entry->attr, __entry->etb, __entry->ebd, __entry->ftb, __entry->fbd)
  156. );
  157. DEFINE_EVENT(msm_v4l2_vidc_buffer_events, msm_v4l2_vidc_buffer_event_log,
  158. TP_PROTO(struct msm_vidc_inst *inst, const char *str, const char *buf_type,
  159. struct msm_vidc_buffer *vbuf, unsigned long inode, long ref_count),
  160. TP_ARGS(inst, str, buf_type, vbuf, inode, ref_count)
  161. );
  162. DECLARE_EVENT_CLASS(msm_vidc_perf,
  163. TP_PROTO(struct msm_vidc_inst *inst, u64 clk_freq, u64 bw_ddr, u64 bw_llcc),
  164. TP_ARGS(inst, clk_freq, bw_ddr, bw_llcc),
  165. TP_STRUCT__entry(
  166. __field(u8 *, debug_str)
  167. __field(u64, curr_freq)
  168. __field(u32, ddr_bw)
  169. __field(u32, sys_cache_bw)
  170. __field(u32, dcvs_flags)
  171. __field(u64, clk_freq)
  172. __field(u64, bw_ddr)
  173. __field(u64, bw_llcc)
  174. ),
  175. TP_fast_assign(
  176. __entry->debug_str = inst ? inst->debug_str : (u8 *)"";
  177. __entry->curr_freq = inst ? inst->power.curr_freq : 0;
  178. __entry->ddr_bw = inst ? inst->power.ddr_bw : 0;
  179. __entry->sys_cache_bw = inst ? inst->power.sys_cache_bw : 0;
  180. __entry->dcvs_flags = inst ? inst->power.dcvs_flags : 0;
  181. __entry->clk_freq = clk_freq;
  182. __entry->bw_ddr = bw_ddr;
  183. __entry->bw_llcc = bw_llcc;
  184. ),
  185. TP_printk("%s: power: inst: clk %lld ddr %d llcc %d dcvs flags %#x, core: clk %lld ddr %lld llcc %lld\n",
  186. __entry->debug_str, __entry->curr_freq, __entry->ddr_bw, __entry->sys_cache_bw,
  187. __entry->dcvs_flags, __entry->clk_freq, __entry->bw_ddr, __entry->bw_llcc)
  188. );
  189. DEFINE_EVENT(msm_vidc_perf, msm_vidc_perf_power_scale,
  190. TP_PROTO(struct msm_vidc_inst *inst, u64 clk_freq, u64 bw_ddr, u64 bw_llcc),
  191. TP_ARGS(inst, clk_freq, bw_ddr, bw_llcc)
  192. );
  193. DECLARE_EVENT_CLASS(msm_vidc_buffer_dma_ops,
  194. TP_PROTO(const char *buffer_op, void *dmabuf, u8 size, void *kvaddr,
  195. const char *buf_name, u8 secure, u32 region),
  196. TP_ARGS(buffer_op, dmabuf, size, kvaddr, buf_name, secure, region),
  197. TP_STRUCT__entry(
  198. __field(const char *, buffer_op)
  199. __field(void *, dmabuf)
  200. __field(u8, size)
  201. __field(void *, kvaddr)
  202. __field(const char *, buf_name)
  203. __field(u8, secure)
  204. __field(u32, region)
  205. ),
  206. TP_fast_assign(
  207. __entry->buffer_op = buffer_op;
  208. __entry->dmabuf = dmabuf;
  209. __entry->size = size;
  210. __entry->kvaddr = kvaddr;
  211. __entry->buf_name = buf_name;
  212. __entry->secure = secure;
  213. __entry->region = region;
  214. ),
  215. TP_printk(
  216. "%s: dmabuf %pK, size %d, kvaddr %pK, buffer_type %s, secure %d, region %d\n",
  217. __entry->buffer_op, __entry->dmabuf, __entry->size, __entry->kvaddr,
  218. __entry->buf_name, __entry->secure, __entry->region)
  219. );
  220. DEFINE_EVENT(msm_vidc_buffer_dma_ops, msm_vidc_dma_buffer,
  221. TP_PROTO(const char *buffer_op, void *dmabuf, u8 size, void *kvaddr,
  222. const char *buf_name, u8 secure, u32 region),
  223. TP_ARGS(buffer_op, dmabuf, size, kvaddr, buf_name, secure, region)
  224. );
  225. #endif
  226. /* This part must be outside protection */
  227. #include <trace/define_trace.h>