2 #define TRACE_SYSTEM scsi
4 #if !defined(_TRACE_SCSI_H) || defined(TRACE_HEADER_MULTI_READ)
12 #define scsi_opcode_name(opcode) { opcode, #opcode }
13 #define show_opcode_name(val) \
14 __print_symbolic(val, \
15 scsi_opcode_name(TEST_UNIT_READY), \
16 scsi_opcode_name(REZERO_UNIT), \
17 scsi_opcode_name(REQUEST_SENSE), \
18 scsi_opcode_name(FORMAT_UNIT), \
19 scsi_opcode_name(READ_BLOCK_LIMITS), \
20 scsi_opcode_name(REASSIGN_BLOCKS), \
21 scsi_opcode_name(INITIALIZE_ELEMENT_STATUS), \
22 scsi_opcode_name(READ_6), \
23 scsi_opcode_name(WRITE_6), \
24 scsi_opcode_name(SEEK_6), \
25 scsi_opcode_name(READ_REVERSE), \
26 scsi_opcode_name(WRITE_FILEMARKS), \
27 scsi_opcode_name(SPACE), \
28 scsi_opcode_name(INQUIRY), \
29 scsi_opcode_name(RECOVER_BUFFERED_DATA), \
30 scsi_opcode_name(MODE_SELECT), \
31 scsi_opcode_name(RESERVE), \
32 scsi_opcode_name(RELEASE), \
33 scsi_opcode_name(COPY), \
34 scsi_opcode_name(ERASE), \
35 scsi_opcode_name(MODE_SENSE), \
36 scsi_opcode_name(START_STOP), \
37 scsi_opcode_name(RECEIVE_DIAGNOSTIC), \
38 scsi_opcode_name(SEND_DIAGNOSTIC), \
39 scsi_opcode_name(ALLOW_MEDIUM_REMOVAL), \
40 scsi_opcode_name(SET_WINDOW), \
41 scsi_opcode_name(READ_CAPACITY), \
42 scsi_opcode_name(READ_10), \
43 scsi_opcode_name(WRITE_10), \
44 scsi_opcode_name(SEEK_10), \
45 scsi_opcode_name(POSITION_TO_ELEMENT), \
46 scsi_opcode_name(WRITE_VERIFY), \
47 scsi_opcode_name(VERIFY), \
48 scsi_opcode_name(SEARCH_HIGH), \
49 scsi_opcode_name(SEARCH_EQUAL), \
50 scsi_opcode_name(SEARCH_LOW), \
51 scsi_opcode_name(SET_LIMITS), \
52 scsi_opcode_name(PRE_FETCH), \
53 scsi_opcode_name(READ_POSITION), \
54 scsi_opcode_name(SYNCHRONIZE_CACHE), \
55 scsi_opcode_name(LOCK_UNLOCK_CACHE), \
56 scsi_opcode_name(READ_DEFECT_DATA), \
57 scsi_opcode_name(MEDIUM_SCAN), \
58 scsi_opcode_name(COMPARE), \
59 scsi_opcode_name(COPY_VERIFY), \
60 scsi_opcode_name(WRITE_BUFFER), \
61 scsi_opcode_name(READ_BUFFER), \
62 scsi_opcode_name(UPDATE_BLOCK), \
63 scsi_opcode_name(READ_LONG), \
64 scsi_opcode_name(WRITE_LONG), \
65 scsi_opcode_name(CHANGE_DEFINITION), \
66 scsi_opcode_name(WRITE_SAME), \
67 scsi_opcode_name(UNMAP), \
68 scsi_opcode_name(READ_TOC), \
69 scsi_opcode_name(LOG_SELECT), \
70 scsi_opcode_name(LOG_SENSE), \
71 scsi_opcode_name(XDWRITEREAD_10), \
72 scsi_opcode_name(MODE_SELECT_10), \
73 scsi_opcode_name(RESERVE_10), \
74 scsi_opcode_name(RELEASE_10), \
75 scsi_opcode_name(MODE_SENSE_10), \
76 scsi_opcode_name(PERSISTENT_RESERVE_IN), \
77 scsi_opcode_name(PERSISTENT_RESERVE_OUT), \
78 scsi_opcode_name(VARIABLE_LENGTH_CMD), \
79 scsi_opcode_name(REPORT_LUNS), \
80 scsi_opcode_name(MAINTENANCE_IN), \
81 scsi_opcode_name(MAINTENANCE_OUT), \
82 scsi_opcode_name(MOVE_MEDIUM), \
83 scsi_opcode_name(EXCHANGE_MEDIUM), \
84 scsi_opcode_name(READ_12), \
85 scsi_opcode_name(WRITE_12), \
86 scsi_opcode_name(WRITE_VERIFY_12), \
87 scsi_opcode_name(SEARCH_HIGH_12), \
88 scsi_opcode_name(SEARCH_EQUAL_12), \
89 scsi_opcode_name(SEARCH_LOW_12), \
90 scsi_opcode_name(READ_ELEMENT_STATUS), \
91 scsi_opcode_name(SEND_VOLUME_TAG), \
92 scsi_opcode_name(WRITE_LONG_2), \
93 scsi_opcode_name(READ_16), \
94 scsi_opcode_name(WRITE_16), \
95 scsi_opcode_name(VERIFY_16), \
96 scsi_opcode_name(WRITE_SAME_16), \
97 scsi_opcode_name(SERVICE_ACTION_IN), \
98 scsi_opcode_name(SAI_READ_CAPACITY_16), \
99 scsi_opcode_name(SAI_GET_LBA_STATUS), \
100 scsi_opcode_name(MI_REPORT_TARGET_PGS), \
101 scsi_opcode_name(MO_SET_TARGET_PGS), \
102 scsi_opcode_name(READ_32), \
103 scsi_opcode_name(WRITE_32), \
104 scsi_opcode_name(WRITE_SAME_32), \
105 scsi_opcode_name(ATA_16), \
106 scsi_opcode_name(ATA_12))
108 #define scsi_hostbyte_name(result) { result, #result }
109 #define show_hostbyte_name(val) \
110 __print_symbolic(val, \
111 scsi_hostbyte_name(DID_OK), \
112 scsi_hostbyte_name(DID_NO_CONNECT), \
113 scsi_hostbyte_name(DID_BUS_BUSY), \
114 scsi_hostbyte_name(DID_TIME_OUT), \
115 scsi_hostbyte_name(DID_BAD_TARGET), \
116 scsi_hostbyte_name(DID_ABORT), \
117 scsi_hostbyte_name(DID_PARITY), \
118 scsi_hostbyte_name(DID_ERROR), \
119 scsi_hostbyte_name(DID_RESET), \
120 scsi_hostbyte_name(DID_BAD_INTR), \
121 scsi_hostbyte_name(DID_PASSTHROUGH), \
122 scsi_hostbyte_name(DID_SOFT_ERROR), \
123 scsi_hostbyte_name(DID_IMM_RETRY), \
124 scsi_hostbyte_name(DID_REQUEUE), \
125 scsi_hostbyte_name(DID_TRANSPORT_DISRUPTED), \
126 scsi_hostbyte_name(DID_TRANSPORT_FAILFAST))
128 #define scsi_driverbyte_name(result) { result, #result }
129 #define show_driverbyte_name(val) \
130 __print_symbolic(val, \
131 scsi_driverbyte_name(DRIVER_OK), \
132 scsi_driverbyte_name(DRIVER_BUSY), \
133 scsi_driverbyte_name(DRIVER_SOFT), \
134 scsi_driverbyte_name(DRIVER_MEDIA), \
135 scsi_driverbyte_name(DRIVER_ERROR), \
136 scsi_driverbyte_name(DRIVER_INVALID), \
137 scsi_driverbyte_name(DRIVER_TIMEOUT), \
138 scsi_driverbyte_name(DRIVER_HARD), \
139 scsi_driverbyte_name(DRIVER_SENSE))
141 #define scsi_msgbyte_name(result) { result, #result }
142 #define show_msgbyte_name(val) \
143 __print_symbolic(val, \
144 scsi_msgbyte_name(COMMAND_COMPLETE), \
145 scsi_msgbyte_name(EXTENDED_MESSAGE), \
146 scsi_msgbyte_name(SAVE_POINTERS), \
147 scsi_msgbyte_name(RESTORE_POINTERS), \
148 scsi_msgbyte_name(DISCONNECT), \
149 scsi_msgbyte_name(INITIATOR_ERROR), \
150 scsi_msgbyte_name(ABORT_TASK_SET), \
151 scsi_msgbyte_name(MESSAGE_REJECT), \
152 scsi_msgbyte_name(NOP), \
153 scsi_msgbyte_name(MSG_PARITY_ERROR), \
154 scsi_msgbyte_name(LINKED_CMD_COMPLETE), \
155 scsi_msgbyte_name(LINKED_FLG_CMD_COMPLETE), \
156 scsi_msgbyte_name(TARGET_RESET), \
157 scsi_msgbyte_name(ABORT_TASK), \
158 scsi_msgbyte_name(CLEAR_TASK_SET), \
159 scsi_msgbyte_name(INITIATE_RECOVERY), \
160 scsi_msgbyte_name(RELEASE_RECOVERY), \
161 scsi_msgbyte_name(CLEAR_ACA), \
162 scsi_msgbyte_name(LOGICAL_UNIT_RESET), \
163 scsi_msgbyte_name(SIMPLE_QUEUE_TAG), \
164 scsi_msgbyte_name(HEAD_OF_QUEUE_TAG), \
165 scsi_msgbyte_name(ORDERED_QUEUE_TAG), \
166 scsi_msgbyte_name(IGNORE_WIDE_RESIDUE), \
167 scsi_msgbyte_name(ACA), \
168 scsi_msgbyte_name(QAS_REQUEST), \
169 scsi_msgbyte_name(BUS_DEVICE_RESET), \
170 scsi_msgbyte_name(ABORT))
172 #define scsi_statusbyte_name(result) { result, #result }
173 #define show_statusbyte_name(val) \
174 __print_symbolic(val, \
175 scsi_statusbyte_name(SAM_STAT_GOOD), \
176 scsi_statusbyte_name(SAM_STAT_CHECK_CONDITION), \
177 scsi_statusbyte_name(SAM_STAT_CONDITION_MET), \
178 scsi_statusbyte_name(SAM_STAT_BUSY), \
179 scsi_statusbyte_name(SAM_STAT_INTERMEDIATE), \
180 scsi_statusbyte_name(SAM_STAT_INTERMEDIATE_CONDITION_MET), \
181 scsi_statusbyte_name(SAM_STAT_RESERVATION_CONFLICT), \
182 scsi_statusbyte_name(SAM_STAT_COMMAND_TERMINATED), \
183 scsi_statusbyte_name(SAM_STAT_TASK_SET_FULL), \
184 scsi_statusbyte_name(SAM_STAT_ACA_ACTIVE), \
185 scsi_statusbyte_name(SAM_STAT_TASK_ABORTED))
187 #define scsi_prot_op_name(result) { result, #result }
188 #define show_prot_op_name(val) \
189 __print_symbolic(val, \
190 scsi_prot_op_name(SCSI_PROT_NORMAL), \
191 scsi_prot_op_name(SCSI_PROT_READ_INSERT), \
192 scsi_prot_op_name(SCSI_PROT_WRITE_STRIP), \
193 scsi_prot_op_name(SCSI_PROT_READ_STRIP), \
194 scsi_prot_op_name(SCSI_PROT_WRITE_INSERT), \
195 scsi_prot_op_name(SCSI_PROT_READ_PASS), \
196 scsi_prot_op_name(SCSI_PROT_WRITE_PASS))
199 #define __parse_cdb(cdb, len) scsi_trace_parse_cdb(p, cdb, len)
214 __field(
unsigned int, data_sglen )
215 __field(
unsigned int, prot_sglen )
216 __field(
unsigned char, prot_op )
227 __entry->data_sglen = scsi_sg_count(cmd);
228 __entry->prot_sglen = scsi_prot_sg_count(cmd);
229 __entry->prot_op = scsi_get_prot_op(cmd);
233 TP_printk(
"host_no=%u channel=%u id=%u lun=%u data_sgl=%u prot_sgl=%u" \
234 " prot_op=%s cmnd=(%s %s raw=%s)",
257 __field(
unsigned int, data_sglen )
258 __field(
unsigned int, prot_sglen )
259 __field(
unsigned char, prot_op )
271 __entry->data_sglen = scsi_sg_count(cmd);
272 __entry->prot_sglen = scsi_prot_sg_count(cmd);
273 __entry->prot_op = scsi_get_prot_op(cmd);
277 TP_printk(
"host_no=%u channel=%u id=%u lun=%u data_sgl=%u prot_sgl=%u" \
278 " prot_op=%s cmnd=(%s %s raw=%s) rtn=%d",
302 __field(
unsigned int, data_sglen )
303 __field(
unsigned int, prot_sglen )
304 __field(
unsigned char, prot_op )
316 __entry->data_sglen = scsi_sg_count(cmd);
317 __entry->prot_sglen = scsi_prot_sg_count(cmd);
318 __entry->prot_op = scsi_get_prot_op(cmd);
322 TP_printk(
"host_no=%u channel=%u id=%u lun=%u data_sgl=%u " \
323 "prot_sgl=%u prot_op=%s cmnd=(%s %s raw=%s) result=(driver=" \
324 "%s host=%s message=%s status=%s)",
337 DEFINE_EVENT(scsi_cmd_done_timeout_template, scsi_dispatch_cmd_done,
341 DEFINE_EVENT(scsi_cmd_done_timeout_template, scsi_dispatch_cmd_timeout,