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