msm_vidc_events.h 7.9 KB

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