mmc.h 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #undef TRACE_SYSTEM
  3. #define TRACE_SYSTEM mmc
  4. #if !defined(_TRACE_MMC_H) || defined(TRACE_HEADER_MULTI_READ)
  5. #define _TRACE_MMC_H
  6. #include <linux/blkdev.h>
  7. #include <linux/mmc/core.h>
  8. #include <linux/mmc/host.h>
  9. #include <linux/tracepoint.h>
  10. TRACE_EVENT(mmc_request_start,
  11. TP_PROTO(struct mmc_host *host, struct mmc_request *mrq),
  12. TP_ARGS(host, mrq),
  13. TP_STRUCT__entry(
  14. __field(u32, cmd_opcode)
  15. __field(u32, cmd_arg)
  16. __field(unsigned int, cmd_flags)
  17. __field(unsigned int, cmd_retries)
  18. __field(u32, stop_opcode)
  19. __field(u32, stop_arg)
  20. __field(unsigned int, stop_flags)
  21. __field(unsigned int, stop_retries)
  22. __field(u32, sbc_opcode)
  23. __field(u32, sbc_arg)
  24. __field(unsigned int, sbc_flags)
  25. __field(unsigned int, sbc_retries)
  26. __field(unsigned int, blocks)
  27. __field(unsigned int, blk_addr)
  28. __field(unsigned int, blksz)
  29. __field(unsigned int, data_flags)
  30. __field(int, tag)
  31. __field(unsigned int, can_retune)
  32. __field(unsigned int, doing_retune)
  33. __field(unsigned int, retune_now)
  34. __field(int, need_retune)
  35. __field(int, hold_retune)
  36. __field(unsigned int, retune_period)
  37. __field(struct mmc_request *, mrq)
  38. __string(name, mmc_hostname(host))
  39. ),
  40. TP_fast_assign(
  41. __entry->cmd_opcode = mrq->cmd ? mrq->cmd->opcode : 0;
  42. __entry->cmd_arg = mrq->cmd ? mrq->cmd->arg : 0;
  43. __entry->cmd_flags = mrq->cmd ? mrq->cmd->flags : 0;
  44. __entry->cmd_retries = mrq->cmd ? mrq->cmd->retries : 0;
  45. __entry->stop_opcode = mrq->stop ? mrq->stop->opcode : 0;
  46. __entry->stop_arg = mrq->stop ? mrq->stop->arg : 0;
  47. __entry->stop_flags = mrq->stop ? mrq->stop->flags : 0;
  48. __entry->stop_retries = mrq->stop ? mrq->stop->retries : 0;
  49. __entry->sbc_opcode = mrq->sbc ? mrq->sbc->opcode : 0;
  50. __entry->sbc_arg = mrq->sbc ? mrq->sbc->arg : 0;
  51. __entry->sbc_flags = mrq->sbc ? mrq->sbc->flags : 0;
  52. __entry->sbc_retries = mrq->sbc ? mrq->sbc->retries : 0;
  53. __entry->blksz = mrq->data ? mrq->data->blksz : 0;
  54. __entry->blocks = mrq->data ? mrq->data->blocks : 0;
  55. __entry->blk_addr = mrq->data ? mrq->data->blk_addr : 0;
  56. __entry->data_flags = mrq->data ? mrq->data->flags : 0;
  57. __entry->tag = mrq->tag;
  58. __entry->can_retune = host->can_retune;
  59. __entry->doing_retune = host->doing_retune;
  60. __entry->retune_now = host->retune_now;
  61. __entry->need_retune = host->need_retune;
  62. __entry->hold_retune = host->hold_retune;
  63. __entry->retune_period = host->retune_period;
  64. __assign_str(name, mmc_hostname(host));
  65. __entry->mrq = mrq;
  66. ),
  67. TP_printk("%s: start struct mmc_request[%p]: "
  68. "cmd_opcode=%u cmd_arg=0x%x cmd_flags=0x%x cmd_retries=%u "
  69. "stop_opcode=%u stop_arg=0x%x stop_flags=0x%x stop_retries=%u "
  70. "sbc_opcode=%u sbc_arg=0x%x sbc_flags=0x%x sbc_retires=%u "
  71. "blocks=%u block_size=%u blk_addr=%u data_flags=0x%x "
  72. "tag=%d can_retune=%u doing_retune=%u retune_now=%u "
  73. "need_retune=%d hold_retune=%d retune_period=%u",
  74. __get_str(name), __entry->mrq,
  75. __entry->cmd_opcode, __entry->cmd_arg,
  76. __entry->cmd_flags, __entry->cmd_retries,
  77. __entry->stop_opcode, __entry->stop_arg,
  78. __entry->stop_flags, __entry->stop_retries,
  79. __entry->sbc_opcode, __entry->sbc_arg,
  80. __entry->sbc_flags, __entry->sbc_retries,
  81. __entry->blocks, __entry->blksz,
  82. __entry->blk_addr, __entry->data_flags, __entry->tag,
  83. __entry->can_retune, __entry->doing_retune,
  84. __entry->retune_now, __entry->need_retune,
  85. __entry->hold_retune, __entry->retune_period)
  86. );
  87. TRACE_EVENT(mmc_request_done,
  88. TP_PROTO(struct mmc_host *host, struct mmc_request *mrq),
  89. TP_ARGS(host, mrq),
  90. TP_STRUCT__entry(
  91. __field(u32, cmd_opcode)
  92. __field(int, cmd_err)
  93. __array(u32, cmd_resp, 4)
  94. __field(unsigned int, cmd_retries)
  95. __field(u32, stop_opcode)
  96. __field(int, stop_err)
  97. __array(u32, stop_resp, 4)
  98. __field(unsigned int, stop_retries)
  99. __field(u32, sbc_opcode)
  100. __field(int, sbc_err)
  101. __array(u32, sbc_resp, 4)
  102. __field(unsigned int, sbc_retries)
  103. __field(unsigned int, bytes_xfered)
  104. __field(int, data_err)
  105. __field(int, tag)
  106. __field(unsigned int, can_retune)
  107. __field(unsigned int, doing_retune)
  108. __field(unsigned int, retune_now)
  109. __field(int, need_retune)
  110. __field(int, hold_retune)
  111. __field(unsigned int, retune_period)
  112. __field(struct mmc_request *, mrq)
  113. __string(name, mmc_hostname(host))
  114. ),
  115. TP_fast_assign(
  116. __entry->cmd_opcode = mrq->cmd ? mrq->cmd->opcode : 0;
  117. __entry->cmd_err = mrq->cmd ? mrq->cmd->error : 0;
  118. __entry->cmd_resp[0] = mrq->cmd ? mrq->cmd->resp[0] : 0;
  119. __entry->cmd_resp[1] = mrq->cmd ? mrq->cmd->resp[1] : 0;
  120. __entry->cmd_resp[2] = mrq->cmd ? mrq->cmd->resp[2] : 0;
  121. __entry->cmd_resp[3] = mrq->cmd ? mrq->cmd->resp[3] : 0;
  122. __entry->cmd_retries = mrq->cmd ? mrq->cmd->retries : 0;
  123. __entry->stop_opcode = mrq->stop ? mrq->stop->opcode : 0;
  124. __entry->stop_err = mrq->stop ? mrq->stop->error : 0;
  125. __entry->stop_resp[0] = mrq->stop ? mrq->stop->resp[0] : 0;
  126. __entry->stop_resp[1] = mrq->stop ? mrq->stop->resp[1] : 0;
  127. __entry->stop_resp[2] = mrq->stop ? mrq->stop->resp[2] : 0;
  128. __entry->stop_resp[3] = mrq->stop ? mrq->stop->resp[3] : 0;
  129. __entry->stop_retries = mrq->stop ? mrq->stop->retries : 0;
  130. __entry->sbc_opcode = mrq->sbc ? mrq->sbc->opcode : 0;
  131. __entry->sbc_err = mrq->sbc ? mrq->sbc->error : 0;
  132. __entry->sbc_resp[0] = mrq->sbc ? mrq->sbc->resp[0] : 0;
  133. __entry->sbc_resp[1] = mrq->sbc ? mrq->sbc->resp[1] : 0;
  134. __entry->sbc_resp[2] = mrq->sbc ? mrq->sbc->resp[2] : 0;
  135. __entry->sbc_resp[3] = mrq->sbc ? mrq->sbc->resp[3] : 0;
  136. __entry->sbc_retries = mrq->sbc ? mrq->sbc->retries : 0;
  137. __entry->bytes_xfered = mrq->data ? mrq->data->bytes_xfered : 0;
  138. __entry->data_err = mrq->data ? mrq->data->error : 0;
  139. __entry->tag = mrq->tag;
  140. __entry->can_retune = host->can_retune;
  141. __entry->doing_retune = host->doing_retune;
  142. __entry->retune_now = host->retune_now;
  143. __entry->need_retune = host->need_retune;
  144. __entry->hold_retune = host->hold_retune;
  145. __entry->retune_period = host->retune_period;
  146. __assign_str(name, mmc_hostname(host));
  147. __entry->mrq = mrq;
  148. ),
  149. TP_printk("%s: end struct mmc_request[%p]: "
  150. "cmd_opcode=%u cmd_err=%d cmd_resp=0x%x 0x%x 0x%x 0x%x "
  151. "cmd_retries=%u stop_opcode=%u stop_err=%d "
  152. "stop_resp=0x%x 0x%x 0x%x 0x%x stop_retries=%u "
  153. "sbc_opcode=%u sbc_err=%d sbc_resp=0x%x 0x%x 0x%x 0x%x "
  154. "sbc_retries=%u bytes_xfered=%u data_err=%d tag=%d "
  155. "can_retune=%u doing_retune=%u retune_now=%u need_retune=%d "
  156. "hold_retune=%d retune_period=%u",
  157. __get_str(name), __entry->mrq,
  158. __entry->cmd_opcode, __entry->cmd_err,
  159. __entry->cmd_resp[0], __entry->cmd_resp[1],
  160. __entry->cmd_resp[2], __entry->cmd_resp[3],
  161. __entry->cmd_retries,
  162. __entry->stop_opcode, __entry->stop_err,
  163. __entry->stop_resp[0], __entry->stop_resp[1],
  164. __entry->stop_resp[2], __entry->stop_resp[3],
  165. __entry->stop_retries,
  166. __entry->sbc_opcode, __entry->sbc_err,
  167. __entry->sbc_resp[0], __entry->sbc_resp[1],
  168. __entry->sbc_resp[2], __entry->sbc_resp[3],
  169. __entry->sbc_retries,
  170. __entry->bytes_xfered, __entry->data_err, __entry->tag,
  171. __entry->can_retune, __entry->doing_retune,
  172. __entry->retune_now, __entry->need_retune,
  173. __entry->hold_retune, __entry->retune_period)
  174. );
  175. #endif /* _TRACE_MMC_H */
  176. /* This part must be outside protection */
  177. #include <trace/define_trace.h>