qcom_glink_trace.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #undef TRACE_SYSTEM
  3. #define TRACE_SYSTEM qcom_glink
  4. #if !defined(__QCOM_GLINK_TRACE_H__) || defined(TRACE_HEADER_MULTI_READ)
  5. #define __QCOM_GLINK_TRACE_H__
  6. #include <linux/tracepoint.h>
  7. #include "qcom_glink_native.h"
  8. TRACE_EVENT(qcom_glink_cmd_version,
  9. TP_PROTO(const char *remote, unsigned int version, unsigned int features, bool tx),
  10. TP_ARGS(remote, version, features, tx),
  11. TP_STRUCT__entry(
  12. __string(remote, remote)
  13. __field(u32, version)
  14. __field(u32, features)
  15. __field(bool, tx)
  16. ),
  17. TP_fast_assign(
  18. __assign_str(remote);
  19. __entry->version = version;
  20. __entry->features = features;
  21. __entry->tx = tx;
  22. ),
  23. TP_printk("%s remote: %s version: %u features: %#x",
  24. __entry->tx ? "tx" : "rx",
  25. __get_str(remote),
  26. __entry->version,
  27. __entry->features
  28. )
  29. );
  30. #define trace_qcom_glink_cmd_version_tx(...) trace_qcom_glink_cmd_version(__VA_ARGS__, true)
  31. #define trace_qcom_glink_cmd_version_rx(...) trace_qcom_glink_cmd_version(__VA_ARGS__, false)
  32. TRACE_EVENT(qcom_glink_cmd_version_ack,
  33. TP_PROTO(const char *remote, unsigned int version, unsigned int features, bool tx),
  34. TP_ARGS(remote, version, features, tx),
  35. TP_STRUCT__entry(
  36. __string(remote, remote)
  37. __field(u32, version)
  38. __field(u32, features)
  39. __field(bool, tx)
  40. ),
  41. TP_fast_assign(
  42. __assign_str(remote);
  43. __entry->version = version;
  44. __entry->features = features;
  45. __entry->tx = tx;
  46. ),
  47. TP_printk("%s remote: %s version: %u features: %#x",
  48. __entry->tx ? "tx" : "rx",
  49. __get_str(remote),
  50. __entry->version,
  51. __entry->features
  52. )
  53. );
  54. #define trace_qcom_glink_cmd_version_ack_tx(...) trace_qcom_glink_cmd_version_ack(__VA_ARGS__, true)
  55. #define trace_qcom_glink_cmd_version_ack_rx(...) trace_qcom_glink_cmd_version_ack(__VA_ARGS__, false)
  56. TRACE_EVENT(qcom_glink_cmd_open,
  57. TP_PROTO(const char *remote, const char *channel, u16 lcid, u16 rcid, bool tx),
  58. TP_ARGS(remote, channel, lcid, rcid, tx),
  59. TP_STRUCT__entry(
  60. __string(remote, remote)
  61. __string(channel, channel)
  62. __field(u16, lcid)
  63. __field(u16, rcid)
  64. __field(bool, tx)
  65. ),
  66. TP_fast_assign(
  67. __assign_str(remote);
  68. __assign_str(channel);
  69. __entry->lcid = lcid;
  70. __entry->rcid = rcid;
  71. __entry->tx = tx;
  72. ),
  73. TP_printk("%s remote: %s channel: %s[%u/%u]",
  74. __entry->tx ? "tx" : "rx",
  75. __get_str(remote),
  76. __get_str(channel),
  77. __entry->lcid,
  78. __entry->rcid
  79. )
  80. );
  81. #define trace_qcom_glink_cmd_open_tx(...) trace_qcom_glink_cmd_open(__VA_ARGS__, true)
  82. #define trace_qcom_glink_cmd_open_rx(...) trace_qcom_glink_cmd_open(__VA_ARGS__, false)
  83. TRACE_EVENT(qcom_glink_cmd_close,
  84. TP_PROTO(const char *remote, const char *channel, u16 lcid, u16 rcid, bool tx),
  85. TP_ARGS(remote, channel, lcid, rcid, tx),
  86. TP_STRUCT__entry(
  87. __string(remote, remote)
  88. __string(channel, channel)
  89. __field(u16, lcid)
  90. __field(u16, rcid)
  91. __field(bool, tx)
  92. ),
  93. TP_fast_assign(
  94. __assign_str(remote);
  95. __assign_str(channel);
  96. __entry->lcid = lcid;
  97. __entry->rcid = rcid;
  98. __entry->tx = tx;
  99. ),
  100. TP_printk("%s remote: %s channel: %s[%u/%u]",
  101. __entry->tx ? "tx" : "rx",
  102. __get_str(remote),
  103. __get_str(channel),
  104. __entry->lcid,
  105. __entry->rcid
  106. )
  107. );
  108. #define trace_qcom_glink_cmd_close_tx(...) trace_qcom_glink_cmd_close(__VA_ARGS__, true)
  109. #define trace_qcom_glink_cmd_close_rx(...) trace_qcom_glink_cmd_close(__VA_ARGS__, false)
  110. TRACE_EVENT(qcom_glink_cmd_open_ack,
  111. TP_PROTO(const char *remote, const char *channel, u16 lcid, u16 rcid, bool tx),
  112. TP_ARGS(remote, channel, lcid, rcid, tx),
  113. TP_STRUCT__entry(
  114. __string(remote, remote)
  115. __string(channel, channel)
  116. __field(u16, lcid)
  117. __field(u16, rcid)
  118. __field(bool, tx)
  119. ),
  120. TP_fast_assign(
  121. __assign_str(remote);
  122. __assign_str(channel);
  123. __entry->lcid = lcid;
  124. __entry->rcid = rcid;
  125. __entry->tx = tx;
  126. ),
  127. TP_printk("%s remote: %s channel: %s[%u/%u]",
  128. __entry->tx ? "tx" : "rx",
  129. __get_str(remote),
  130. __get_str(channel),
  131. __entry->lcid,
  132. __entry->rcid
  133. )
  134. );
  135. #define trace_qcom_glink_cmd_open_ack_tx(...) trace_qcom_glink_cmd_open_ack(__VA_ARGS__, true)
  136. #define trace_qcom_glink_cmd_open_ack_rx(...) trace_qcom_glink_cmd_open_ack(__VA_ARGS__, false)
  137. TRACE_EVENT(qcom_glink_cmd_intent,
  138. TP_PROTO(const char *remote, const char *channel, u16 lcid, u16 rcid, size_t count, size_t size, u32 liid, bool tx),
  139. TP_ARGS(remote, channel, lcid, rcid, count, size, liid, tx),
  140. TP_STRUCT__entry(
  141. __string(remote, remote)
  142. __string(channel, channel)
  143. __field(u16, lcid)
  144. __field(u16, rcid)
  145. __field(u32, count)
  146. __field(u32, size)
  147. __field(u32, liid)
  148. __field(bool, tx)
  149. ),
  150. TP_fast_assign(
  151. __assign_str(remote);
  152. __assign_str(channel);
  153. __entry->lcid = lcid;
  154. __entry->rcid = rcid;
  155. __entry->count = count;
  156. __entry->size = size;
  157. __entry->liid = liid;
  158. __entry->tx = tx;
  159. ),
  160. TP_printk("%s remote: %s channel: %s[%u/%u] count: %d [size: %d liid: %d]",
  161. __entry->tx ? "tx" : "rx",
  162. __get_str(remote),
  163. __get_str(channel),
  164. __entry->lcid,
  165. __entry->rcid,
  166. __entry->count,
  167. __entry->size,
  168. __entry->liid
  169. )
  170. );
  171. #define trace_qcom_glink_cmd_intent_tx(...) trace_qcom_glink_cmd_intent(__VA_ARGS__, true)
  172. #define trace_qcom_glink_cmd_intent_rx(...) trace_qcom_glink_cmd_intent(__VA_ARGS__, false)
  173. TRACE_EVENT(qcom_glink_cmd_rx_done,
  174. TP_PROTO(const char *remote, const char *channel, u16 lcid, u16 rcid, u32 iid, bool reuse, bool tx),
  175. TP_ARGS(remote, channel, lcid, rcid, iid, reuse, tx),
  176. TP_STRUCT__entry(
  177. __string(remote, remote)
  178. __string(channel, channel)
  179. __field(u16, lcid)
  180. __field(u16, rcid)
  181. __field(u32, iid)
  182. __field(bool, reuse)
  183. __field(bool, tx)
  184. ),
  185. TP_fast_assign(
  186. __assign_str(remote);
  187. __assign_str(channel);
  188. __entry->lcid = lcid;
  189. __entry->rcid = rcid;
  190. __entry->iid = iid;
  191. __entry->reuse = reuse;
  192. __entry->tx = tx;
  193. ),
  194. TP_printk("%s remote: %s channel: %s[%u/%u] iid: %d reuse: %d",
  195. __entry->tx ? "tx" : "rx",
  196. __get_str(remote),
  197. __get_str(channel),
  198. __entry->lcid,
  199. __entry->rcid,
  200. __entry->iid,
  201. __entry->reuse
  202. )
  203. );
  204. #define trace_qcom_glink_cmd_rx_done_tx(...) trace_qcom_glink_cmd_rx_done(__VA_ARGS__, true)
  205. #define trace_qcom_glink_cmd_rx_done_rx(...) trace_qcom_glink_cmd_rx_done(__VA_ARGS__, false)
  206. TRACE_EVENT(qcom_glink_cmd_rx_intent_req,
  207. TP_PROTO(const char *remote, const char *channel, u16 lcid, u16 rcid, size_t size, bool tx),
  208. TP_ARGS(remote, channel, lcid, rcid, size, tx),
  209. TP_STRUCT__entry(
  210. __string(remote, remote)
  211. __string(channel, channel)
  212. __field(u16, lcid)
  213. __field(u16, rcid)
  214. __field(u32, size)
  215. __field(bool, tx)
  216. ),
  217. TP_fast_assign(
  218. __assign_str(remote);
  219. __assign_str(channel);
  220. __entry->lcid = lcid;
  221. __entry->rcid = rcid;
  222. __entry->size = size;
  223. __entry->tx = tx;
  224. ),
  225. TP_printk("%s remote: %s channel: %s[%u/%u] size: %d",
  226. __entry->tx ? "tx" : "rx",
  227. __get_str(remote),
  228. __get_str(channel),
  229. __entry->lcid,
  230. __entry->rcid,
  231. __entry->size
  232. )
  233. );
  234. #define trace_qcom_glink_cmd_rx_intent_req_tx(...) trace_qcom_glink_cmd_rx_intent_req(__VA_ARGS__, true)
  235. #define trace_qcom_glink_cmd_rx_intent_req_rx(...) trace_qcom_glink_cmd_rx_intent_req(__VA_ARGS__, false)
  236. TRACE_EVENT(qcom_glink_cmd_rx_intent_req_ack,
  237. TP_PROTO(const char *remote, const char *channel, u16 lcid, u16 rcid, bool granted, bool tx),
  238. TP_ARGS(remote, channel, lcid, rcid, granted, tx),
  239. TP_STRUCT__entry(
  240. __string(remote, remote)
  241. __string(channel, channel)
  242. __field(u16, lcid)
  243. __field(u16, rcid)
  244. __field(bool, granted)
  245. __field(bool, tx)
  246. ),
  247. TP_fast_assign(
  248. __assign_str(remote);
  249. __assign_str(channel);
  250. __entry->lcid = lcid;
  251. __entry->rcid = rcid;
  252. __entry->granted = granted;
  253. __entry->tx = tx;
  254. ),
  255. TP_printk("%s remote: %s channel: %s[%u/%u] granted: %d",
  256. __entry->tx ? "tx" : "rx",
  257. __get_str(remote),
  258. __get_str(channel),
  259. __entry->lcid,
  260. __entry->rcid,
  261. __entry->granted
  262. )
  263. );
  264. #define trace_qcom_glink_cmd_rx_intent_req_ack_tx(...) trace_qcom_glink_cmd_rx_intent_req_ack(__VA_ARGS__, true)
  265. #define trace_qcom_glink_cmd_rx_intent_req_ack_rx(...) trace_qcom_glink_cmd_rx_intent_req_ack(__VA_ARGS__, false)
  266. TRACE_EVENT(qcom_glink_cmd_tx_data,
  267. TP_PROTO(const char *remote, const char *channel, u16 lcid, u16 rcid, u32 iid, u32 chunk_size, u32 left_size, bool cont, bool tx),
  268. TP_ARGS(remote, channel, lcid, rcid, iid, chunk_size, left_size, cont, tx),
  269. TP_STRUCT__entry(
  270. __string(remote, remote)
  271. __string(channel, channel)
  272. __field(u16, lcid)
  273. __field(u16, rcid)
  274. __field(u32, iid)
  275. __field(u32, chunk_size)
  276. __field(u32, left_size)
  277. __field(bool, cont)
  278. __field(bool, tx)
  279. ),
  280. TP_fast_assign(
  281. __assign_str(remote);
  282. __assign_str(channel);
  283. __entry->lcid = lcid;
  284. __entry->rcid = rcid;
  285. __entry->iid = iid;
  286. __entry->chunk_size = chunk_size;
  287. __entry->left_size = left_size;
  288. __entry->cont = cont;
  289. __entry->tx = tx;
  290. ),
  291. TP_printk("%s remote: %s channel: %s[%u/%u] iid: %d chunk_size: %d left_size: %d cont: %d",
  292. __entry->tx ? "tx" : "rx",
  293. __get_str(remote),
  294. __get_str(channel),
  295. __entry->lcid,
  296. __entry->rcid,
  297. __entry->iid,
  298. __entry->chunk_size,
  299. __entry->left_size,
  300. __entry->cont
  301. )
  302. );
  303. #define trace_qcom_glink_cmd_tx_data_tx(...) trace_qcom_glink_cmd_tx_data(__VA_ARGS__, true)
  304. #define trace_qcom_glink_cmd_tx_data_rx(...) trace_qcom_glink_cmd_tx_data(__VA_ARGS__, false)
  305. TRACE_EVENT(qcom_glink_cmd_close_ack,
  306. TP_PROTO(const char *remote, const char *channel, u16 lcid, u16 rcid, bool tx),
  307. TP_ARGS(remote, channel, lcid, rcid, tx),
  308. TP_STRUCT__entry(
  309. __string(remote, remote)
  310. __string(channel, channel)
  311. __field(u16, lcid)
  312. __field(u16, rcid)
  313. __field(bool, tx)
  314. ),
  315. TP_fast_assign(
  316. __assign_str(remote);
  317. __assign_str(channel);
  318. __entry->lcid = lcid;
  319. __entry->rcid = rcid;
  320. __entry->tx = tx;
  321. ),
  322. TP_printk("%s remote: %s channel: %s[%u/%u]",
  323. __entry->tx ? "tx" : "rx",
  324. __get_str(remote),
  325. __get_str(channel),
  326. __entry->lcid,
  327. __entry->rcid
  328. )
  329. );
  330. #define trace_qcom_glink_cmd_close_ack_tx(...) trace_qcom_glink_cmd_close_ack(__VA_ARGS__, true)
  331. #define trace_qcom_glink_cmd_close_ack_rx(...) trace_qcom_glink_cmd_close_ack(__VA_ARGS__, false)
  332. TRACE_EVENT(qcom_glink_cmd_read_notif,
  333. TP_PROTO(const char *remote, bool tx),
  334. TP_ARGS(remote, tx),
  335. TP_STRUCT__entry(
  336. __string(remote, remote)
  337. __field(bool, tx)
  338. ),
  339. TP_fast_assign(
  340. __assign_str(remote);
  341. __entry->tx = tx;
  342. ),
  343. TP_printk("%s remote: %s",
  344. __entry->tx ? "tx" : "rx",
  345. __get_str(remote)
  346. )
  347. );
  348. #define trace_qcom_glink_cmd_read_notif_tx(...) trace_qcom_glink_cmd_read_notif(__VA_ARGS__, true)
  349. #define trace_qcom_glink_cmd_read_notif_rx(...) trace_qcom_glink_cmd_read_notif(__VA_ARGS__, false)
  350. TRACE_EVENT(qcom_glink_cmd_signal,
  351. TP_PROTO(const char *remote, const char *channel, u16 lcid, u16 rcid, unsigned int signals, bool tx),
  352. TP_ARGS(remote, channel, lcid, rcid, signals, tx),
  353. TP_STRUCT__entry(
  354. __string(remote, remote)
  355. __string(channel, channel)
  356. __field(u16, lcid)
  357. __field(u16, rcid)
  358. __field(u32, signals)
  359. __field(bool, tx)
  360. ),
  361. TP_fast_assign(
  362. __assign_str(remote);
  363. __assign_str(channel);
  364. __entry->lcid = lcid;
  365. __entry->rcid = rcid;
  366. __entry->signals = signals;
  367. __entry->tx = tx;
  368. ),
  369. TP_printk("%s remote: %s channel: %s[%u/%u] signals: %#x",
  370. __entry->tx ? "tx" : "rx",
  371. __get_str(remote),
  372. __get_str(channel),
  373. __entry->lcid,
  374. __entry->rcid,
  375. __entry->signals
  376. )
  377. );
  378. #define trace_qcom_glink_cmd_signal_tx(...) trace_qcom_glink_cmd_signal(__VA_ARGS__, true)
  379. #define trace_qcom_glink_cmd_signal_rx(...) trace_qcom_glink_cmd_signal(__VA_ARGS__, false)
  380. #endif
  381. #undef TRACE_INCLUDE_PATH
  382. #define TRACE_INCLUDE_PATH .
  383. #undef TRACE_INCLUDE_FILE
  384. #define TRACE_INCLUDE_FILE qcom_glink_trace
  385. #include <trace/define_trace.h>