hswadsp.h 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384
  1. #undef TRACE_SYSTEM
  2. #define TRACE_SYSTEM hswadsp
  3. #if !defined(_TRACE_HSWADSP_H) || defined(TRACE_HEADER_MULTI_READ)
  4. #define _TRACE_HSWADSP_H
  5. #include <linux/types.h>
  6. #include <linux/ktime.h>
  7. #include <linux/tracepoint.h>
  8. struct sst_hsw;
  9. struct sst_hsw_stream;
  10. struct sst_hsw_ipc_stream_free_req;
  11. struct sst_hsw_ipc_volume_req;
  12. struct sst_hsw_ipc_stream_alloc_req;
  13. struct sst_hsw_audio_data_format_ipc;
  14. struct sst_hsw_ipc_stream_info_reply;
  15. struct sst_hsw_ipc_device_config_req;
  16. DECLARE_EVENT_CLASS(sst_irq,
  17. TP_PROTO(uint32_t status, uint32_t mask),
  18. TP_ARGS(status, mask),
  19. TP_STRUCT__entry(
  20. __field( unsigned int, status )
  21. __field( unsigned int, mask )
  22. ),
  23. TP_fast_assign(
  24. __entry->status = status;
  25. __entry->mask = mask;
  26. ),
  27. TP_printk("status 0x%8.8x mask 0x%8.8x",
  28. (unsigned int)__entry->status, (unsigned int)__entry->mask)
  29. );
  30. DEFINE_EVENT(sst_irq, sst_irq_busy,
  31. TP_PROTO(unsigned int status, unsigned int mask),
  32. TP_ARGS(status, mask)
  33. );
  34. DEFINE_EVENT(sst_irq, sst_irq_done,
  35. TP_PROTO(unsigned int status, unsigned int mask),
  36. TP_ARGS(status, mask)
  37. );
  38. DECLARE_EVENT_CLASS(ipc,
  39. TP_PROTO(const char *name, int val),
  40. TP_ARGS(name, val),
  41. TP_STRUCT__entry(
  42. __string( name, name )
  43. __field( unsigned int, val )
  44. ),
  45. TP_fast_assign(
  46. __assign_str(name, name);
  47. __entry->val = val;
  48. ),
  49. TP_printk("%s 0x%8.8x", __get_str(name), (unsigned int)__entry->val)
  50. );
  51. DEFINE_EVENT(ipc, ipc_request,
  52. TP_PROTO(const char *name, int val),
  53. TP_ARGS(name, val)
  54. );
  55. DEFINE_EVENT(ipc, ipc_reply,
  56. TP_PROTO(const char *name, int val),
  57. TP_ARGS(name, val)
  58. );
  59. DEFINE_EVENT(ipc, ipc_pending_reply,
  60. TP_PROTO(const char *name, int val),
  61. TP_ARGS(name, val)
  62. );
  63. DEFINE_EVENT(ipc, ipc_notification,
  64. TP_PROTO(const char *name, int val),
  65. TP_ARGS(name, val)
  66. );
  67. DEFINE_EVENT(ipc, ipc_error,
  68. TP_PROTO(const char *name, int val),
  69. TP_ARGS(name, val)
  70. );
  71. DECLARE_EVENT_CLASS(stream_position,
  72. TP_PROTO(unsigned int id, unsigned int pos),
  73. TP_ARGS(id, pos),
  74. TP_STRUCT__entry(
  75. __field( unsigned int, id )
  76. __field( unsigned int, pos )
  77. ),
  78. TP_fast_assign(
  79. __entry->id = id;
  80. __entry->pos = pos;
  81. ),
  82. TP_printk("id %d position 0x%x",
  83. (unsigned int)__entry->id, (unsigned int)__entry->pos)
  84. );
  85. DEFINE_EVENT(stream_position, stream_read_position,
  86. TP_PROTO(unsigned int id, unsigned int pos),
  87. TP_ARGS(id, pos)
  88. );
  89. DEFINE_EVENT(stream_position, stream_write_position,
  90. TP_PROTO(unsigned int id, unsigned int pos),
  91. TP_ARGS(id, pos)
  92. );
  93. TRACE_EVENT(hsw_stream_buffer,
  94. TP_PROTO(struct sst_hsw_stream *stream),
  95. TP_ARGS(stream),
  96. TP_STRUCT__entry(
  97. __field( int, id )
  98. __field( int, pt_addr )
  99. __field( int, num_pages )
  100. __field( int, ring_size )
  101. __field( int, ring_offset )
  102. __field( int, first_pfn )
  103. ),
  104. TP_fast_assign(
  105. __entry->id = stream->host_id;
  106. __entry->pt_addr = stream->request.ringinfo.ring_pt_address;
  107. __entry->num_pages = stream->request.ringinfo.num_pages;
  108. __entry->ring_size = stream->request.ringinfo.ring_size;
  109. __entry->ring_offset = stream->request.ringinfo.ring_offset;
  110. __entry->first_pfn = stream->request.ringinfo.ring_first_pfn;
  111. ),
  112. TP_printk("stream %d ring addr 0x%x pages %d size 0x%x offset 0x%x PFN 0x%x",
  113. (int) __entry->id, (int)__entry->pt_addr,
  114. (int)__entry->num_pages, (int)__entry->ring_size,
  115. (int)__entry->ring_offset, (int)__entry->first_pfn)
  116. );
  117. TRACE_EVENT(hsw_stream_alloc_reply,
  118. TP_PROTO(struct sst_hsw_stream *stream),
  119. TP_ARGS(stream),
  120. TP_STRUCT__entry(
  121. __field( int, id )
  122. __field( int, stream_id )
  123. __field( int, mixer_id )
  124. __field( int, peak0 )
  125. __field( int, peak1 )
  126. __field( int, vol0 )
  127. __field( int, vol1 )
  128. ),
  129. TP_fast_assign(
  130. __entry->id = stream->host_id;
  131. __entry->stream_id = stream->reply.stream_hw_id;
  132. __entry->mixer_id = stream->reply.mixer_hw_id;
  133. __entry->peak0 = stream->reply.peak_meter_register_address[0];
  134. __entry->peak1 = stream->reply.peak_meter_register_address[1];
  135. __entry->vol0 = stream->reply.volume_register_address[0];
  136. __entry->vol1 = stream->reply.volume_register_address[1];
  137. ),
  138. TP_printk("stream %d hw id %d mixer %d peak 0x%x:0x%x vol 0x%x,0x%x",
  139. (int) __entry->id, (int) __entry->stream_id, (int)__entry->mixer_id,
  140. (int)__entry->peak0, (int)__entry->peak1,
  141. (int)__entry->vol0, (int)__entry->vol1)
  142. );
  143. TRACE_EVENT(hsw_mixer_info_reply,
  144. TP_PROTO(struct sst_hsw_ipc_stream_info_reply *reply),
  145. TP_ARGS(reply),
  146. TP_STRUCT__entry(
  147. __field( int, mixer_id )
  148. __field( int, peak0 )
  149. __field( int, peak1 )
  150. __field( int, vol0 )
  151. __field( int, vol1 )
  152. ),
  153. TP_fast_assign(
  154. __entry->mixer_id = reply->mixer_hw_id;
  155. __entry->peak0 = reply->peak_meter_register_address[0];
  156. __entry->peak1 = reply->peak_meter_register_address[1];
  157. __entry->vol0 = reply->volume_register_address[0];
  158. __entry->vol1 = reply->volume_register_address[1];
  159. ),
  160. TP_printk("mixer id %d peak 0x%x:0x%x vol 0x%x,0x%x",
  161. (int)__entry->mixer_id,
  162. (int)__entry->peak0, (int)__entry->peak1,
  163. (int)__entry->vol0, (int)__entry->vol1)
  164. );
  165. TRACE_EVENT(hsw_stream_data_format,
  166. TP_PROTO(struct sst_hsw_stream *stream,
  167. struct sst_hsw_audio_data_format_ipc *req),
  168. TP_ARGS(stream, req),
  169. TP_STRUCT__entry(
  170. __field( uint32_t, id )
  171. __field( uint32_t, frequency )
  172. __field( uint32_t, bitdepth )
  173. __field( uint32_t, map )
  174. __field( uint32_t, config )
  175. __field( uint32_t, style )
  176. __field( uint8_t, ch_num )
  177. __field( uint8_t, valid_bit )
  178. ),
  179. TP_fast_assign(
  180. __entry->id = stream->host_id;
  181. __entry->frequency = req->frequency;
  182. __entry->bitdepth = req->bitdepth;
  183. __entry->map = req->map;
  184. __entry->config = req->config;
  185. __entry->style = req->style;
  186. __entry->ch_num = req->ch_num;
  187. __entry->valid_bit = req->valid_bit;
  188. ),
  189. TP_printk("stream %d freq %d depth %d map 0x%x config 0x%x style 0x%x ch %d bits %d",
  190. (int) __entry->id, (uint32_t)__entry->frequency,
  191. (uint32_t)__entry->bitdepth, (uint32_t)__entry->map,
  192. (uint32_t)__entry->config, (uint32_t)__entry->style,
  193. (uint8_t)__entry->ch_num, (uint8_t)__entry->valid_bit)
  194. );
  195. TRACE_EVENT(hsw_stream_alloc_request,
  196. TP_PROTO(struct sst_hsw_stream *stream,
  197. struct sst_hsw_ipc_stream_alloc_req *req),
  198. TP_ARGS(stream, req),
  199. TP_STRUCT__entry(
  200. __field( uint32_t, id )
  201. __field( uint8_t, path_id )
  202. __field( uint8_t, stream_type )
  203. __field( uint8_t, format_id )
  204. ),
  205. TP_fast_assign(
  206. __entry->id = stream->host_id;
  207. __entry->path_id = req->path_id;
  208. __entry->stream_type = req->stream_type;
  209. __entry->format_id = req->format_id;
  210. ),
  211. TP_printk("stream %d path %d type %d format %d",
  212. (int) __entry->id, (uint8_t)__entry->path_id,
  213. (uint8_t)__entry->stream_type, (uint8_t)__entry->format_id)
  214. );
  215. TRACE_EVENT(hsw_stream_free_req,
  216. TP_PROTO(struct sst_hsw_stream *stream,
  217. struct sst_hsw_ipc_stream_free_req *req),
  218. TP_ARGS(stream, req),
  219. TP_STRUCT__entry(
  220. __field( int, id )
  221. __field( int, stream_id )
  222. ),
  223. TP_fast_assign(
  224. __entry->id = stream->host_id;
  225. __entry->stream_id = req->stream_id;
  226. ),
  227. TP_printk("stream %d hw id %d",
  228. (int) __entry->id, (int) __entry->stream_id)
  229. );
  230. TRACE_EVENT(hsw_volume_req,
  231. TP_PROTO(struct sst_hsw_stream *stream,
  232. struct sst_hsw_ipc_volume_req *req),
  233. TP_ARGS(stream, req),
  234. TP_STRUCT__entry(
  235. __field( int, id )
  236. __field( uint32_t, channel )
  237. __field( uint32_t, target_volume )
  238. __field( uint64_t, curve_duration )
  239. __field( uint32_t, curve_type )
  240. ),
  241. TP_fast_assign(
  242. __entry->id = stream->host_id;
  243. __entry->channel = req->channel;
  244. __entry->target_volume = req->target_volume;
  245. __entry->curve_duration = req->curve_duration;
  246. __entry->curve_type = req->curve_type;
  247. ),
  248. TP_printk("stream %d chan 0x%x vol %d duration %llu type %d",
  249. (int) __entry->id, (uint32_t) __entry->channel,
  250. (uint32_t)__entry->target_volume,
  251. (uint64_t)__entry->curve_duration,
  252. (uint32_t)__entry->curve_type)
  253. );
  254. TRACE_EVENT(hsw_device_config_req,
  255. TP_PROTO(struct sst_hsw_ipc_device_config_req *req),
  256. TP_ARGS(req),
  257. TP_STRUCT__entry(
  258. __field( uint32_t, ssp )
  259. __field( uint32_t, clock_freq )
  260. __field( uint32_t, mode )
  261. __field( uint16_t, clock_divider )
  262. ),
  263. TP_fast_assign(
  264. __entry->ssp = req->ssp_interface;
  265. __entry->clock_freq = req->clock_frequency;
  266. __entry->mode = req->mode;
  267. __entry->clock_divider = req->clock_divider;
  268. ),
  269. TP_printk("SSP %d Freq %d mode %d div %d",
  270. (uint32_t)__entry->ssp,
  271. (uint32_t)__entry->clock_freq, (uint32_t)__entry->mode,
  272. (uint32_t)__entry->clock_divider)
  273. );
  274. #endif /* _TRACE_HSWADSP_H */
  275. /* This part must be outside protection */
  276. #include <trace/define_trace.h>