^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) #undef TRACE_SYSTEM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) #define TRACE_SYSTEM libata
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) #if !defined(_TRACE_LIBATA_H) || defined(TRACE_HEADER_MULTI_READ)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) #define _TRACE_LIBATA_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) #include <linux/ata.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #include <linux/libata.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #include <linux/tracepoint.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #include <linux/trace_seq.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #define ata_opcode_name(opcode) { opcode, #opcode }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #define show_opcode_name(val) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) __print_symbolic(val, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) ata_opcode_name(ATA_CMD_DEV_RESET), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) ata_opcode_name(ATA_CMD_CHK_POWER), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) ata_opcode_name(ATA_CMD_STANDBY), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) ata_opcode_name(ATA_CMD_IDLE), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) ata_opcode_name(ATA_CMD_EDD), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) ata_opcode_name(ATA_CMD_DOWNLOAD_MICRO), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) ata_opcode_name(ATA_CMD_DOWNLOAD_MICRO_DMA), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) ata_opcode_name(ATA_CMD_NOP), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) ata_opcode_name(ATA_CMD_FLUSH), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) ata_opcode_name(ATA_CMD_FLUSH_EXT), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) ata_opcode_name(ATA_CMD_ID_ATA), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) ata_opcode_name(ATA_CMD_ID_ATAPI), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) ata_opcode_name(ATA_CMD_SERVICE), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) ata_opcode_name(ATA_CMD_READ), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) ata_opcode_name(ATA_CMD_READ_EXT), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) ata_opcode_name(ATA_CMD_READ_QUEUED), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) ata_opcode_name(ATA_CMD_READ_STREAM_EXT), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) ata_opcode_name(ATA_CMD_READ_STREAM_DMA_EXT), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) ata_opcode_name(ATA_CMD_WRITE), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) ata_opcode_name(ATA_CMD_WRITE_EXT), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) ata_opcode_name(ATA_CMD_WRITE_QUEUED), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) ata_opcode_name(ATA_CMD_WRITE_STREAM_EXT), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) ata_opcode_name(ATA_CMD_WRITE_STREAM_DMA_EXT), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) ata_opcode_name(ATA_CMD_WRITE_FUA_EXT), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) ata_opcode_name(ATA_CMD_WRITE_QUEUED_FUA_EXT), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) ata_opcode_name(ATA_CMD_FPDMA_READ), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) ata_opcode_name(ATA_CMD_FPDMA_WRITE), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) ata_opcode_name(ATA_CMD_NCQ_NON_DATA), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) ata_opcode_name(ATA_CMD_FPDMA_SEND), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) ata_opcode_name(ATA_CMD_FPDMA_RECV), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) ata_opcode_name(ATA_CMD_PIO_READ), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) ata_opcode_name(ATA_CMD_PIO_READ_EXT), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) ata_opcode_name(ATA_CMD_PIO_WRITE), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) ata_opcode_name(ATA_CMD_PIO_WRITE_EXT), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) ata_opcode_name(ATA_CMD_READ_MULTI), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) ata_opcode_name(ATA_CMD_READ_MULTI_EXT), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) ata_opcode_name(ATA_CMD_WRITE_MULTI), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) ata_opcode_name(ATA_CMD_WRITE_MULTI_EXT), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) ata_opcode_name(ATA_CMD_WRITE_MULTI_FUA_EXT), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) ata_opcode_name(ATA_CMD_SET_FEATURES), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) ata_opcode_name(ATA_CMD_SET_MULTI), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) ata_opcode_name(ATA_CMD_PACKET), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) ata_opcode_name(ATA_CMD_VERIFY), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) ata_opcode_name(ATA_CMD_VERIFY_EXT), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) ata_opcode_name(ATA_CMD_WRITE_UNCORR_EXT), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) ata_opcode_name(ATA_CMD_STANDBYNOW1), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) ata_opcode_name(ATA_CMD_IDLEIMMEDIATE), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) ata_opcode_name(ATA_CMD_SLEEP), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) ata_opcode_name(ATA_CMD_INIT_DEV_PARAMS), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) ata_opcode_name(ATA_CMD_READ_NATIVE_MAX), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) ata_opcode_name(ATA_CMD_READ_NATIVE_MAX_EXT), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) ata_opcode_name(ATA_CMD_SET_MAX), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) ata_opcode_name(ATA_CMD_SET_MAX_EXT), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) ata_opcode_name(ATA_CMD_READ_LOG_EXT), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) ata_opcode_name(ATA_CMD_WRITE_LOG_EXT), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) ata_opcode_name(ATA_CMD_READ_LOG_DMA_EXT), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) ata_opcode_name(ATA_CMD_WRITE_LOG_DMA_EXT), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) ata_opcode_name(ATA_CMD_TRUSTED_NONDATA), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) ata_opcode_name(ATA_CMD_TRUSTED_RCV), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) ata_opcode_name(ATA_CMD_TRUSTED_RCV_DMA), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) ata_opcode_name(ATA_CMD_TRUSTED_SND), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) ata_opcode_name(ATA_CMD_TRUSTED_SND_DMA), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) ata_opcode_name(ATA_CMD_PMP_READ), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) ata_opcode_name(ATA_CMD_PMP_READ_DMA), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) ata_opcode_name(ATA_CMD_PMP_WRITE), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) ata_opcode_name(ATA_CMD_PMP_WRITE_DMA), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) ata_opcode_name(ATA_CMD_CONF_OVERLAY), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) ata_opcode_name(ATA_CMD_SEC_SET_PASS), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) ata_opcode_name(ATA_CMD_SEC_UNLOCK), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) ata_opcode_name(ATA_CMD_SEC_ERASE_PREP), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) ata_opcode_name(ATA_CMD_SEC_ERASE_UNIT), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) ata_opcode_name(ATA_CMD_SEC_FREEZE_LOCK), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) ata_opcode_name(ATA_CMD_SEC_DISABLE_PASS), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) ata_opcode_name(ATA_CMD_CONFIG_STREAM), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) ata_opcode_name(ATA_CMD_SMART), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) ata_opcode_name(ATA_CMD_MEDIA_LOCK), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) ata_opcode_name(ATA_CMD_MEDIA_UNLOCK), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) ata_opcode_name(ATA_CMD_DSM), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) ata_opcode_name(ATA_CMD_CHK_MED_CRD_TYP), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) ata_opcode_name(ATA_CMD_CFA_REQ_EXT_ERR), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) ata_opcode_name(ATA_CMD_CFA_WRITE_NE), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) ata_opcode_name(ATA_CMD_CFA_TRANS_SECT), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) ata_opcode_name(ATA_CMD_CFA_ERASE), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) ata_opcode_name(ATA_CMD_CFA_WRITE_MULT_NE), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) ata_opcode_name(ATA_CMD_REQ_SENSE_DATA), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) ata_opcode_name(ATA_CMD_SANITIZE_DEVICE), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) ata_opcode_name(ATA_CMD_ZAC_MGMT_IN), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) ata_opcode_name(ATA_CMD_ZAC_MGMT_OUT), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) ata_opcode_name(ATA_CMD_RESTORE), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) ata_opcode_name(ATA_CMD_READ_LONG), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) ata_opcode_name(ATA_CMD_READ_LONG_ONCE), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) ata_opcode_name(ATA_CMD_WRITE_LONG), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) ata_opcode_name(ATA_CMD_WRITE_LONG_ONCE))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) #define ata_error_name(result) { result, #result }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) #define show_error_name(val) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) __print_symbolic(val, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) ata_error_name(ATA_ICRC), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) ata_error_name(ATA_UNC), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) ata_error_name(ATA_MC), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) ata_error_name(ATA_IDNF), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) ata_error_name(ATA_MCR), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) ata_error_name(ATA_ABORTED), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) ata_error_name(ATA_TRK0NF), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) ata_error_name(ATA_AMNF))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) #define ata_protocol_name(proto) { proto, #proto }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) #define show_protocol_name(val) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) __print_symbolic(val, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) ata_protocol_name(ATA_PROT_UNKNOWN), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) ata_protocol_name(ATA_PROT_NODATA), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) ata_protocol_name(ATA_PROT_PIO), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) ata_protocol_name(ATA_PROT_DMA), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) ata_protocol_name(ATA_PROT_NCQ), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) ata_protocol_name(ATA_PROT_NCQ_NODATA), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) ata_protocol_name(ATAPI_PROT_NODATA), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) ata_protocol_name(ATAPI_PROT_PIO), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) ata_protocol_name(ATAPI_PROT_DMA))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) const char *libata_trace_parse_status(struct trace_seq*, unsigned char);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) #define __parse_status(s) libata_trace_parse_status(p, s)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) const char *libata_trace_parse_eh_action(struct trace_seq *, unsigned int);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) #define __parse_eh_action(a) libata_trace_parse_eh_action(p, a)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) const char *libata_trace_parse_eh_err_mask(struct trace_seq *, unsigned int);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) #define __parse_eh_err_mask(m) libata_trace_parse_eh_err_mask(p, m)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) const char *libata_trace_parse_qc_flags(struct trace_seq *, unsigned int);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) #define __parse_qc_flags(f) libata_trace_parse_qc_flags(p, f)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) const char *libata_trace_parse_subcmd(struct trace_seq *, unsigned char,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) unsigned char, unsigned char);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) #define __parse_subcmd(c,f,h) libata_trace_parse_subcmd(p, c, f, h)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) TRACE_EVENT(ata_qc_issue,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) TP_PROTO(struct ata_queued_cmd *qc),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) TP_ARGS(qc),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) __field( unsigned int, ata_port )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) __field( unsigned int, ata_dev )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) __field( unsigned int, tag )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) __field( unsigned char, cmd )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) __field( unsigned char, dev )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) __field( unsigned char, lbal )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) __field( unsigned char, lbam )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) __field( unsigned char, lbah )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) __field( unsigned char, nsect )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) __field( unsigned char, feature )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) __field( unsigned char, hob_lbal )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) __field( unsigned char, hob_lbam )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) __field( unsigned char, hob_lbah )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) __field( unsigned char, hob_nsect )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) __field( unsigned char, hob_feature )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) __field( unsigned char, ctl )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) __field( unsigned char, proto )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) __field( unsigned long, flags )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) __entry->ata_port = qc->ap->print_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) __entry->ata_dev = qc->dev->link->pmp + qc->dev->devno;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) __entry->tag = qc->tag;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) __entry->proto = qc->tf.protocol;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) __entry->cmd = qc->tf.command;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) __entry->dev = qc->tf.device;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) __entry->lbal = qc->tf.lbal;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) __entry->lbam = qc->tf.lbam;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) __entry->lbah = qc->tf.lbah;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) __entry->hob_lbal = qc->tf.hob_lbal;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) __entry->hob_lbam = qc->tf.hob_lbam;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) __entry->hob_lbah = qc->tf.hob_lbah;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) __entry->feature = qc->tf.feature;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) __entry->hob_feature = qc->tf.hob_feature;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) __entry->nsect = qc->tf.nsect;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) __entry->hob_nsect = qc->tf.hob_nsect;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) TP_printk("ata_port=%u ata_dev=%u tag=%d proto=%s cmd=%s%s " \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) " tf=(%02x/%02x:%02x:%02x:%02x:%02x/%02x:%02x:%02x:%02x:%02x/%02x)",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) __entry->ata_port, __entry->ata_dev, __entry->tag,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) show_protocol_name(__entry->proto),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) show_opcode_name(__entry->cmd),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) __parse_subcmd(__entry->cmd, __entry->feature, __entry->hob_nsect),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) __entry->cmd, __entry->feature, __entry->nsect,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) __entry->lbal, __entry->lbam, __entry->lbah,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) __entry->hob_feature, __entry->hob_nsect,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) __entry->hob_lbal, __entry->hob_lbam, __entry->hob_lbah,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) __entry->dev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) DECLARE_EVENT_CLASS(ata_qc_complete_template,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) TP_PROTO(struct ata_queued_cmd *qc),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) TP_ARGS(qc),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) __field( unsigned int, ata_port )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) __field( unsigned int, ata_dev )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) __field( unsigned int, tag )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) __field( unsigned char, status )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) __field( unsigned char, dev )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) __field( unsigned char, lbal )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) __field( unsigned char, lbam )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) __field( unsigned char, lbah )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) __field( unsigned char, nsect )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) __field( unsigned char, error )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) __field( unsigned char, hob_lbal )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) __field( unsigned char, hob_lbam )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) __field( unsigned char, hob_lbah )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) __field( unsigned char, hob_nsect )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) __field( unsigned char, hob_feature )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) __field( unsigned char, ctl )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) __field( unsigned long, flags )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) __entry->ata_port = qc->ap->print_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) __entry->ata_dev = qc->dev->link->pmp + qc->dev->devno;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) __entry->tag = qc->tag;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) __entry->status = qc->result_tf.command;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) __entry->dev = qc->result_tf.device;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) __entry->lbal = qc->result_tf.lbal;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) __entry->lbam = qc->result_tf.lbam;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) __entry->lbah = qc->result_tf.lbah;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) __entry->hob_lbal = qc->result_tf.hob_lbal;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) __entry->hob_lbam = qc->result_tf.hob_lbam;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) __entry->hob_lbah = qc->result_tf.hob_lbah;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) __entry->error = qc->result_tf.feature;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) __entry->hob_feature = qc->result_tf.hob_feature;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) __entry->nsect = qc->result_tf.nsect;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) __entry->hob_nsect = qc->result_tf.hob_nsect;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) TP_printk("ata_port=%u ata_dev=%u tag=%d flags=%s status=%s " \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) " res=(%02x/%02x:%02x:%02x:%02x:%02x/%02x:%02x:%02x:%02x:%02x/%02x)",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) __entry->ata_port, __entry->ata_dev, __entry->tag,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) __parse_qc_flags(__entry->flags),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) __parse_status(__entry->status),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) __entry->status, __entry->error, __entry->nsect,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) __entry->lbal, __entry->lbam, __entry->lbah,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) __entry->hob_feature, __entry->hob_nsect,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) __entry->hob_lbal, __entry->hob_lbam, __entry->hob_lbah,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) __entry->dev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) DEFINE_EVENT(ata_qc_complete_template, ata_qc_complete_internal,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) TP_PROTO(struct ata_queued_cmd *qc),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) TP_ARGS(qc));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) DEFINE_EVENT(ata_qc_complete_template, ata_qc_complete_failed,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) TP_PROTO(struct ata_queued_cmd *qc),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) TP_ARGS(qc));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) DEFINE_EVENT(ata_qc_complete_template, ata_qc_complete_done,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) TP_PROTO(struct ata_queued_cmd *qc),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) TP_ARGS(qc));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) TRACE_EVENT(ata_eh_link_autopsy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) TP_PROTO(struct ata_device *dev, unsigned int eh_action, unsigned int eh_err_mask),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) TP_ARGS(dev, eh_action, eh_err_mask),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) __field( unsigned int, ata_port )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) __field( unsigned int, ata_dev )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) __field( unsigned int, eh_action )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) __field( unsigned int, eh_err_mask)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292) __entry->ata_port = dev->link->ap->print_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) __entry->ata_dev = dev->link->pmp + dev->devno;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) __entry->eh_action = eh_action;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295) __entry->eh_err_mask = eh_err_mask;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298) TP_printk("ata_port=%u ata_dev=%u eh_action=%s err_mask=%s",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) __entry->ata_port, __entry->ata_dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300) __parse_eh_action(__entry->eh_action),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301) __parse_eh_err_mask(__entry->eh_err_mask))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304) TRACE_EVENT(ata_eh_link_autopsy_qc,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) TP_PROTO(struct ata_queued_cmd *qc),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308) TP_ARGS(qc),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311) __field( unsigned int, ata_port )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312) __field( unsigned int, ata_dev )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313) __field( unsigned int, tag )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314) __field( unsigned int, qc_flags )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315) __field( unsigned int, eh_err_mask)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319) __entry->ata_port = qc->ap->print_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320) __entry->ata_dev = qc->dev->link->pmp + qc->dev->devno;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321) __entry->tag = qc->tag;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322) __entry->qc_flags = qc->flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323) __entry->eh_err_mask = qc->err_mask;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326) TP_printk("ata_port=%u ata_dev=%u tag=%d flags=%s err_mask=%s",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327) __entry->ata_port, __entry->ata_dev, __entry->tag,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328) __parse_qc_flags(__entry->qc_flags),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329) __parse_eh_err_mask(__entry->eh_err_mask))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332) #endif /* _TRACE_LIBATA_H */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 334) /* This part must be outside protection */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 335) #include <trace/define_trace.h>