fix: proc: decouple proc from VFS with "struct proc_ops" (v5.6)
[lttng-modules.git] / instrumentation / events / lttng-module / scsi.h
CommitLineData
9f36eaed 1/* SPDX-License-Identifier: GPL-2.0 */
b283666f
PW
2#undef TRACE_SYSTEM
3#define TRACE_SYSTEM scsi
4
3bc29f0a
MD
5#if !defined(LTTNG_TRACE_SCSI_H) || defined(TRACE_HEADER_MULTI_READ)
6#define LTTNG_TRACE_SCSI_H
b283666f 7
6ec43db8 8#include <probes/lttng-tracepoint-event.h>
b283666f
PW
9#include <scsi/scsi_cmnd.h>
10#include <scsi/scsi_host.h>
b283666f 11#include <linux/trace_seq.h>
7c68b363 12#include <linux/version.h>
b283666f
PW
13
14#ifndef _TRACE_SCSI_DEF
15#define _TRACE_SCSI_DEF
16
17#define scsi_opcode_name(opcode) { opcode, #opcode }
76cbfb7f 18
aadaf9f7
MJ
19#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0) \
20 || LTTNG_SLE_KERNEL_RANGE(4,4,9,36,0,0, 4,5,0,0,0,0))
3e860164
MJ
21
22#define show_opcode_name(val) \
23 __print_symbolic(val, \
24 scsi_opcode_name(TEST_UNIT_READY), \
25 scsi_opcode_name(REZERO_UNIT), \
26 scsi_opcode_name(REQUEST_SENSE), \
27 scsi_opcode_name(FORMAT_UNIT), \
28 scsi_opcode_name(READ_BLOCK_LIMITS), \
29 scsi_opcode_name(REASSIGN_BLOCKS), \
30 scsi_opcode_name(INITIALIZE_ELEMENT_STATUS), \
31 scsi_opcode_name(READ_6), \
32 scsi_opcode_name(WRITE_6), \
33 scsi_opcode_name(SEEK_6), \
34 scsi_opcode_name(READ_REVERSE), \
35 scsi_opcode_name(WRITE_FILEMARKS), \
36 scsi_opcode_name(SPACE), \
37 scsi_opcode_name(INQUIRY), \
38 scsi_opcode_name(RECOVER_BUFFERED_DATA), \
39 scsi_opcode_name(MODE_SELECT), \
40 scsi_opcode_name(RESERVE), \
41 scsi_opcode_name(RELEASE), \
42 scsi_opcode_name(COPY), \
43 scsi_opcode_name(ERASE), \
44 scsi_opcode_name(MODE_SENSE), \
45 scsi_opcode_name(START_STOP), \
46 scsi_opcode_name(RECEIVE_DIAGNOSTIC), \
47 scsi_opcode_name(SEND_DIAGNOSTIC), \
48 scsi_opcode_name(ALLOW_MEDIUM_REMOVAL), \
49 scsi_opcode_name(SET_WINDOW), \
50 scsi_opcode_name(READ_CAPACITY), \
51 scsi_opcode_name(READ_10), \
52 scsi_opcode_name(WRITE_10), \
53 scsi_opcode_name(SEEK_10), \
54 scsi_opcode_name(POSITION_TO_ELEMENT), \
55 scsi_opcode_name(WRITE_VERIFY), \
56 scsi_opcode_name(VERIFY), \
57 scsi_opcode_name(SEARCH_HIGH), \
58 scsi_opcode_name(SEARCH_EQUAL), \
59 scsi_opcode_name(SEARCH_LOW), \
60 scsi_opcode_name(SET_LIMITS), \
61 scsi_opcode_name(PRE_FETCH), \
62 scsi_opcode_name(READ_POSITION), \
63 scsi_opcode_name(SYNCHRONIZE_CACHE), \
64 scsi_opcode_name(LOCK_UNLOCK_CACHE), \
65 scsi_opcode_name(READ_DEFECT_DATA), \
66 scsi_opcode_name(MEDIUM_SCAN), \
67 scsi_opcode_name(COMPARE), \
68 scsi_opcode_name(COPY_VERIFY), \
69 scsi_opcode_name(WRITE_BUFFER), \
70 scsi_opcode_name(READ_BUFFER), \
71 scsi_opcode_name(UPDATE_BLOCK), \
72 scsi_opcode_name(READ_LONG), \
73 scsi_opcode_name(WRITE_LONG), \
74 scsi_opcode_name(CHANGE_DEFINITION), \
75 scsi_opcode_name(WRITE_SAME), \
76 scsi_opcode_name(UNMAP), \
77 scsi_opcode_name(READ_TOC), \
78 scsi_opcode_name(LOG_SELECT), \
79 scsi_opcode_name(LOG_SENSE), \
80 scsi_opcode_name(XDWRITEREAD_10), \
81 scsi_opcode_name(MODE_SELECT_10), \
82 scsi_opcode_name(RESERVE_10), \
83 scsi_opcode_name(RELEASE_10), \
84 scsi_opcode_name(MODE_SENSE_10), \
85 scsi_opcode_name(PERSISTENT_RESERVE_IN), \
86 scsi_opcode_name(PERSISTENT_RESERVE_OUT), \
87 scsi_opcode_name(VARIABLE_LENGTH_CMD), \
88 scsi_opcode_name(REPORT_LUNS), \
89 scsi_opcode_name(MAINTENANCE_IN), \
90 scsi_opcode_name(MAINTENANCE_OUT), \
91 scsi_opcode_name(MOVE_MEDIUM), \
92 scsi_opcode_name(EXCHANGE_MEDIUM), \
93 scsi_opcode_name(READ_12), \
94 scsi_opcode_name(WRITE_12), \
95 scsi_opcode_name(WRITE_VERIFY_12), \
96 scsi_opcode_name(SEARCH_HIGH_12), \
97 scsi_opcode_name(SEARCH_EQUAL_12), \
98 scsi_opcode_name(SEARCH_LOW_12), \
99 scsi_opcode_name(READ_ELEMENT_STATUS), \
100 scsi_opcode_name(SEND_VOLUME_TAG), \
101 scsi_opcode_name(WRITE_LONG_2), \
102 scsi_opcode_name(READ_16), \
103 scsi_opcode_name(WRITE_16), \
104 scsi_opcode_name(VERIFY_16), \
105 scsi_opcode_name(WRITE_SAME_16), \
106 scsi_opcode_name(ZBC_OUT), \
107 scsi_opcode_name(ZBC_IN), \
108 scsi_opcode_name(SERVICE_ACTION_IN_16), \
109 scsi_opcode_name(READ_32), \
110 scsi_opcode_name(WRITE_32), \
111 scsi_opcode_name(WRITE_SAME_32), \
112 scsi_opcode_name(ATA_16), \
113 scsi_opcode_name(ATA_12))
114
115#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) \
c94ac1ac 116 || LTTNG_RHEL_KERNEL_RANGE(3,10,0,327,0,0, 3,11,0,0,0,0))
76cbfb7f
MD
117
118#define show_opcode_name(val) \
119 __print_symbolic(val, \
120 scsi_opcode_name(TEST_UNIT_READY), \
121 scsi_opcode_name(REZERO_UNIT), \
122 scsi_opcode_name(REQUEST_SENSE), \
123 scsi_opcode_name(FORMAT_UNIT), \
124 scsi_opcode_name(READ_BLOCK_LIMITS), \
125 scsi_opcode_name(REASSIGN_BLOCKS), \
126 scsi_opcode_name(INITIALIZE_ELEMENT_STATUS), \
127 scsi_opcode_name(READ_6), \
128 scsi_opcode_name(WRITE_6), \
129 scsi_opcode_name(SEEK_6), \
130 scsi_opcode_name(READ_REVERSE), \
131 scsi_opcode_name(WRITE_FILEMARKS), \
132 scsi_opcode_name(SPACE), \
133 scsi_opcode_name(INQUIRY), \
134 scsi_opcode_name(RECOVER_BUFFERED_DATA), \
135 scsi_opcode_name(MODE_SELECT), \
136 scsi_opcode_name(RESERVE), \
137 scsi_opcode_name(RELEASE), \
138 scsi_opcode_name(COPY), \
139 scsi_opcode_name(ERASE), \
140 scsi_opcode_name(MODE_SENSE), \
141 scsi_opcode_name(START_STOP), \
142 scsi_opcode_name(RECEIVE_DIAGNOSTIC), \
143 scsi_opcode_name(SEND_DIAGNOSTIC), \
144 scsi_opcode_name(ALLOW_MEDIUM_REMOVAL), \
145 scsi_opcode_name(SET_WINDOW), \
146 scsi_opcode_name(READ_CAPACITY), \
147 scsi_opcode_name(READ_10), \
148 scsi_opcode_name(WRITE_10), \
149 scsi_opcode_name(SEEK_10), \
150 scsi_opcode_name(POSITION_TO_ELEMENT), \
151 scsi_opcode_name(WRITE_VERIFY), \
152 scsi_opcode_name(VERIFY), \
153 scsi_opcode_name(SEARCH_HIGH), \
154 scsi_opcode_name(SEARCH_EQUAL), \
155 scsi_opcode_name(SEARCH_LOW), \
156 scsi_opcode_name(SET_LIMITS), \
157 scsi_opcode_name(PRE_FETCH), \
158 scsi_opcode_name(READ_POSITION), \
159 scsi_opcode_name(SYNCHRONIZE_CACHE), \
160 scsi_opcode_name(LOCK_UNLOCK_CACHE), \
161 scsi_opcode_name(READ_DEFECT_DATA), \
162 scsi_opcode_name(MEDIUM_SCAN), \
163 scsi_opcode_name(COMPARE), \
164 scsi_opcode_name(COPY_VERIFY), \
165 scsi_opcode_name(WRITE_BUFFER), \
166 scsi_opcode_name(READ_BUFFER), \
167 scsi_opcode_name(UPDATE_BLOCK), \
168 scsi_opcode_name(READ_LONG), \
169 scsi_opcode_name(WRITE_LONG), \
170 scsi_opcode_name(CHANGE_DEFINITION), \
171 scsi_opcode_name(WRITE_SAME), \
172 scsi_opcode_name(UNMAP), \
173 scsi_opcode_name(READ_TOC), \
174 scsi_opcode_name(LOG_SELECT), \
175 scsi_opcode_name(LOG_SENSE), \
176 scsi_opcode_name(XDWRITEREAD_10), \
177 scsi_opcode_name(MODE_SELECT_10), \
178 scsi_opcode_name(RESERVE_10), \
179 scsi_opcode_name(RELEASE_10), \
180 scsi_opcode_name(MODE_SENSE_10), \
181 scsi_opcode_name(PERSISTENT_RESERVE_IN), \
182 scsi_opcode_name(PERSISTENT_RESERVE_OUT), \
183 scsi_opcode_name(VARIABLE_LENGTH_CMD), \
184 scsi_opcode_name(REPORT_LUNS), \
185 scsi_opcode_name(MAINTENANCE_IN), \
186 scsi_opcode_name(MAINTENANCE_OUT), \
187 scsi_opcode_name(MOVE_MEDIUM), \
188 scsi_opcode_name(EXCHANGE_MEDIUM), \
189 scsi_opcode_name(READ_12), \
190 scsi_opcode_name(WRITE_12), \
191 scsi_opcode_name(WRITE_VERIFY_12), \
192 scsi_opcode_name(SEARCH_HIGH_12), \
193 scsi_opcode_name(SEARCH_EQUAL_12), \
194 scsi_opcode_name(SEARCH_LOW_12), \
195 scsi_opcode_name(READ_ELEMENT_STATUS), \
196 scsi_opcode_name(SEND_VOLUME_TAG), \
197 scsi_opcode_name(WRITE_LONG_2), \
198 scsi_opcode_name(READ_16), \
199 scsi_opcode_name(WRITE_16), \
200 scsi_opcode_name(VERIFY_16), \
201 scsi_opcode_name(WRITE_SAME_16), \
202 scsi_opcode_name(SERVICE_ACTION_IN_16), \
203 scsi_opcode_name(SAI_READ_CAPACITY_16), \
204 scsi_opcode_name(SAI_GET_LBA_STATUS), \
205 scsi_opcode_name(MI_REPORT_TARGET_PGS), \
206 scsi_opcode_name(MO_SET_TARGET_PGS), \
207 scsi_opcode_name(READ_32), \
208 scsi_opcode_name(WRITE_32), \
209 scsi_opcode_name(WRITE_SAME_32), \
210 scsi_opcode_name(ATA_16), \
211 scsi_opcode_name(ATA_12))
212
213#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0)) */
214
b283666f
PW
215#define show_opcode_name(val) \
216 __print_symbolic(val, \
217 scsi_opcode_name(TEST_UNIT_READY), \
218 scsi_opcode_name(REZERO_UNIT), \
219 scsi_opcode_name(REQUEST_SENSE), \
220 scsi_opcode_name(FORMAT_UNIT), \
221 scsi_opcode_name(READ_BLOCK_LIMITS), \
222 scsi_opcode_name(REASSIGN_BLOCKS), \
223 scsi_opcode_name(INITIALIZE_ELEMENT_STATUS), \
224 scsi_opcode_name(READ_6), \
225 scsi_opcode_name(WRITE_6), \
226 scsi_opcode_name(SEEK_6), \
227 scsi_opcode_name(READ_REVERSE), \
228 scsi_opcode_name(WRITE_FILEMARKS), \
229 scsi_opcode_name(SPACE), \
230 scsi_opcode_name(INQUIRY), \
231 scsi_opcode_name(RECOVER_BUFFERED_DATA), \
232 scsi_opcode_name(MODE_SELECT), \
233 scsi_opcode_name(RESERVE), \
234 scsi_opcode_name(RELEASE), \
235 scsi_opcode_name(COPY), \
236 scsi_opcode_name(ERASE), \
237 scsi_opcode_name(MODE_SENSE), \
238 scsi_opcode_name(START_STOP), \
239 scsi_opcode_name(RECEIVE_DIAGNOSTIC), \
240 scsi_opcode_name(SEND_DIAGNOSTIC), \
241 scsi_opcode_name(ALLOW_MEDIUM_REMOVAL), \
242 scsi_opcode_name(SET_WINDOW), \
243 scsi_opcode_name(READ_CAPACITY), \
244 scsi_opcode_name(READ_10), \
245 scsi_opcode_name(WRITE_10), \
246 scsi_opcode_name(SEEK_10), \
247 scsi_opcode_name(POSITION_TO_ELEMENT), \
248 scsi_opcode_name(WRITE_VERIFY), \
249 scsi_opcode_name(VERIFY), \
250 scsi_opcode_name(SEARCH_HIGH), \
251 scsi_opcode_name(SEARCH_EQUAL), \
252 scsi_opcode_name(SEARCH_LOW), \
253 scsi_opcode_name(SET_LIMITS), \
254 scsi_opcode_name(PRE_FETCH), \
255 scsi_opcode_name(READ_POSITION), \
256 scsi_opcode_name(SYNCHRONIZE_CACHE), \
257 scsi_opcode_name(LOCK_UNLOCK_CACHE), \
258 scsi_opcode_name(READ_DEFECT_DATA), \
259 scsi_opcode_name(MEDIUM_SCAN), \
260 scsi_opcode_name(COMPARE), \
261 scsi_opcode_name(COPY_VERIFY), \
262 scsi_opcode_name(WRITE_BUFFER), \
263 scsi_opcode_name(READ_BUFFER), \
264 scsi_opcode_name(UPDATE_BLOCK), \
265 scsi_opcode_name(READ_LONG), \
266 scsi_opcode_name(WRITE_LONG), \
267 scsi_opcode_name(CHANGE_DEFINITION), \
268 scsi_opcode_name(WRITE_SAME), \
269 scsi_opcode_name(UNMAP), \
270 scsi_opcode_name(READ_TOC), \
271 scsi_opcode_name(LOG_SELECT), \
272 scsi_opcode_name(LOG_SENSE), \
273 scsi_opcode_name(XDWRITEREAD_10), \
274 scsi_opcode_name(MODE_SELECT_10), \
275 scsi_opcode_name(RESERVE_10), \
276 scsi_opcode_name(RELEASE_10), \
277 scsi_opcode_name(MODE_SENSE_10), \
278 scsi_opcode_name(PERSISTENT_RESERVE_IN), \
279 scsi_opcode_name(PERSISTENT_RESERVE_OUT), \
280 scsi_opcode_name(VARIABLE_LENGTH_CMD), \
281 scsi_opcode_name(REPORT_LUNS), \
282 scsi_opcode_name(MAINTENANCE_IN), \
283 scsi_opcode_name(MAINTENANCE_OUT), \
284 scsi_opcode_name(MOVE_MEDIUM), \
285 scsi_opcode_name(EXCHANGE_MEDIUM), \
286 scsi_opcode_name(READ_12), \
287 scsi_opcode_name(WRITE_12), \
288 scsi_opcode_name(WRITE_VERIFY_12), \
289 scsi_opcode_name(SEARCH_HIGH_12), \
290 scsi_opcode_name(SEARCH_EQUAL_12), \
291 scsi_opcode_name(SEARCH_LOW_12), \
292 scsi_opcode_name(READ_ELEMENT_STATUS), \
293 scsi_opcode_name(SEND_VOLUME_TAG), \
294 scsi_opcode_name(WRITE_LONG_2), \
295 scsi_opcode_name(READ_16), \
296 scsi_opcode_name(WRITE_16), \
297 scsi_opcode_name(VERIFY_16), \
298 scsi_opcode_name(WRITE_SAME_16), \
299 scsi_opcode_name(SERVICE_ACTION_IN), \
300 scsi_opcode_name(SAI_READ_CAPACITY_16), \
301 scsi_opcode_name(SAI_GET_LBA_STATUS), \
302 scsi_opcode_name(MI_REPORT_TARGET_PGS), \
303 scsi_opcode_name(MO_SET_TARGET_PGS), \
304 scsi_opcode_name(READ_32), \
305 scsi_opcode_name(WRITE_32), \
306 scsi_opcode_name(WRITE_SAME_32), \
307 scsi_opcode_name(ATA_16), \
308 scsi_opcode_name(ATA_12))
309
76cbfb7f
MD
310#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0)) */
311
b283666f
PW
312#define scsi_hostbyte_name(result) { result, #result }
313#define show_hostbyte_name(val) \
314 __print_symbolic(val, \
315 scsi_hostbyte_name(DID_OK), \
316 scsi_hostbyte_name(DID_NO_CONNECT), \
317 scsi_hostbyte_name(DID_BUS_BUSY), \
318 scsi_hostbyte_name(DID_TIME_OUT), \
319 scsi_hostbyte_name(DID_BAD_TARGET), \
320 scsi_hostbyte_name(DID_ABORT), \
321 scsi_hostbyte_name(DID_PARITY), \
322 scsi_hostbyte_name(DID_ERROR), \
323 scsi_hostbyte_name(DID_RESET), \
324 scsi_hostbyte_name(DID_BAD_INTR), \
325 scsi_hostbyte_name(DID_PASSTHROUGH), \
326 scsi_hostbyte_name(DID_SOFT_ERROR), \
327 scsi_hostbyte_name(DID_IMM_RETRY), \
328 scsi_hostbyte_name(DID_REQUEUE), \
329 scsi_hostbyte_name(DID_TRANSPORT_DISRUPTED), \
330 scsi_hostbyte_name(DID_TRANSPORT_FAILFAST))
331
332#define scsi_driverbyte_name(result) { result, #result }
333#define show_driverbyte_name(val) \
334 __print_symbolic(val, \
335 scsi_driverbyte_name(DRIVER_OK), \
336 scsi_driverbyte_name(DRIVER_BUSY), \
337 scsi_driverbyte_name(DRIVER_SOFT), \
338 scsi_driverbyte_name(DRIVER_MEDIA), \
339 scsi_driverbyte_name(DRIVER_ERROR), \
340 scsi_driverbyte_name(DRIVER_INVALID), \
341 scsi_driverbyte_name(DRIVER_TIMEOUT), \
342 scsi_driverbyte_name(DRIVER_HARD), \
343 scsi_driverbyte_name(DRIVER_SENSE))
344
345#define scsi_msgbyte_name(result) { result, #result }
346#define show_msgbyte_name(val) \
347 __print_symbolic(val, \
348 scsi_msgbyte_name(COMMAND_COMPLETE), \
349 scsi_msgbyte_name(EXTENDED_MESSAGE), \
350 scsi_msgbyte_name(SAVE_POINTERS), \
351 scsi_msgbyte_name(RESTORE_POINTERS), \
352 scsi_msgbyte_name(DISCONNECT), \
353 scsi_msgbyte_name(INITIATOR_ERROR), \
354 scsi_msgbyte_name(ABORT_TASK_SET), \
355 scsi_msgbyte_name(MESSAGE_REJECT), \
356 scsi_msgbyte_name(NOP), \
357 scsi_msgbyte_name(MSG_PARITY_ERROR), \
358 scsi_msgbyte_name(LINKED_CMD_COMPLETE), \
359 scsi_msgbyte_name(LINKED_FLG_CMD_COMPLETE), \
360 scsi_msgbyte_name(TARGET_RESET), \
361 scsi_msgbyte_name(ABORT_TASK), \
362 scsi_msgbyte_name(CLEAR_TASK_SET), \
363 scsi_msgbyte_name(INITIATE_RECOVERY), \
364 scsi_msgbyte_name(RELEASE_RECOVERY), \
365 scsi_msgbyte_name(CLEAR_ACA), \
366 scsi_msgbyte_name(LOGICAL_UNIT_RESET), \
367 scsi_msgbyte_name(SIMPLE_QUEUE_TAG), \
368 scsi_msgbyte_name(HEAD_OF_QUEUE_TAG), \
369 scsi_msgbyte_name(ORDERED_QUEUE_TAG), \
370 scsi_msgbyte_name(IGNORE_WIDE_RESIDUE), \
371 scsi_msgbyte_name(ACA), \
372 scsi_msgbyte_name(QAS_REQUEST), \
373 scsi_msgbyte_name(BUS_DEVICE_RESET), \
374 scsi_msgbyte_name(ABORT))
375
376#define scsi_statusbyte_name(result) { result, #result }
377#define show_statusbyte_name(val) \
378 __print_symbolic(val, \
379 scsi_statusbyte_name(SAM_STAT_GOOD), \
380 scsi_statusbyte_name(SAM_STAT_CHECK_CONDITION), \
381 scsi_statusbyte_name(SAM_STAT_CONDITION_MET), \
382 scsi_statusbyte_name(SAM_STAT_BUSY), \
383 scsi_statusbyte_name(SAM_STAT_INTERMEDIATE), \
384 scsi_statusbyte_name(SAM_STAT_INTERMEDIATE_CONDITION_MET), \
385 scsi_statusbyte_name(SAM_STAT_RESERVATION_CONFLICT), \
386 scsi_statusbyte_name(SAM_STAT_COMMAND_TERMINATED), \
387 scsi_statusbyte_name(SAM_STAT_TASK_SET_FULL), \
388 scsi_statusbyte_name(SAM_STAT_ACA_ACTIVE), \
389 scsi_statusbyte_name(SAM_STAT_TASK_ABORTED))
390
391#define scsi_prot_op_name(result) { result, #result }
392#define show_prot_op_name(val) \
393 __print_symbolic(val, \
394 scsi_prot_op_name(SCSI_PROT_NORMAL), \
395 scsi_prot_op_name(SCSI_PROT_READ_INSERT), \
396 scsi_prot_op_name(SCSI_PROT_WRITE_STRIP), \
397 scsi_prot_op_name(SCSI_PROT_READ_STRIP), \
398 scsi_prot_op_name(SCSI_PROT_WRITE_INSERT), \
399 scsi_prot_op_name(SCSI_PROT_READ_PASS), \
400 scsi_prot_op_name(SCSI_PROT_WRITE_PASS))
401
402const char *scsi_trace_parse_cdb(struct trace_seq*, unsigned char*, int);
403#define __parse_cdb(cdb, len) scsi_trace_parse_cdb(p, cdb, len)
404#endif
405
3bc29f0a 406LTTNG_TRACEPOINT_EVENT(scsi_dispatch_cmd_start,
b283666f
PW
407
408 TP_PROTO(struct scsi_cmnd *cmd),
409
410 TP_ARGS(cmd),
411
f127e61e
MD
412 TP_FIELDS(
413 ctf_integer(unsigned int, host_no, cmd->device->host->host_no)
414 ctf_integer(unsigned int, channel, cmd->device->channel)
415 ctf_integer(unsigned int, id, cmd->device->id)
416 ctf_integer(unsigned int, lun, cmd->device->lun)
417 ctf_integer(unsigned int, opcode, cmd->cmnd[0])
418 ctf_integer(unsigned int, cmd_len, cmd->cmd_len)
419 ctf_integer(unsigned int, data_sglen, scsi_sg_count(cmd))
420 ctf_integer(unsigned int, prot_sglen, scsi_prot_sg_count(cmd))
f127e61e 421 ctf_integer(unsigned char, prot_op, scsi_get_prot_op(cmd))
f127e61e
MD
422 ctf_sequence_hex(unsigned char, cmnd, cmd->cmnd, u32, cmd->cmd_len)
423 )
b283666f
PW
424)
425
3bc29f0a 426LTTNG_TRACEPOINT_EVENT(scsi_dispatch_cmd_error,
b283666f
PW
427
428 TP_PROTO(struct scsi_cmnd *cmd, int rtn),
429
430 TP_ARGS(cmd, rtn),
431
f127e61e
MD
432 TP_FIELDS(
433 ctf_integer(unsigned int, host_no, cmd->device->host->host_no)
434 ctf_integer(unsigned int, channel, cmd->device->channel)
435 ctf_integer(unsigned int, id, cmd->device->id)
436 ctf_integer(unsigned int, lun, cmd->device->lun)
437 ctf_integer(int, rtn, rtn)
438 ctf_integer(unsigned int, opcode, cmd->cmnd[0])
439 ctf_integer(unsigned int, cmd_len, cmd->cmd_len)
440 ctf_integer(unsigned int, data_sglen, scsi_sg_count(cmd))
441 ctf_integer(unsigned int, prot_sglen, scsi_prot_sg_count(cmd))
f127e61e 442 ctf_integer(unsigned char, prot_op, scsi_get_prot_op(cmd))
f127e61e
MD
443 ctf_sequence_hex(unsigned char, cmnd, cmd->cmnd, u32, cmd->cmd_len)
444 )
b283666f
PW
445)
446
3bc29f0a 447LTTNG_TRACEPOINT_EVENT_CLASS(scsi_cmd_done_timeout_template,
b283666f
PW
448
449 TP_PROTO(struct scsi_cmnd *cmd),
450
451 TP_ARGS(cmd),
452
f127e61e
MD
453 TP_FIELDS(
454 ctf_integer(unsigned int, host_no, cmd->device->host->host_no)
455 ctf_integer(unsigned int, channel, cmd->device->channel)
456 ctf_integer(unsigned int, id, cmd->device->id)
457 ctf_integer(unsigned int, lun, cmd->device->lun)
458 ctf_integer(int, result, cmd->result)
459 ctf_integer(unsigned int, opcode, cmd->cmnd[0])
460 ctf_integer(unsigned int, cmd_len, cmd->cmd_len)
461 ctf_integer(unsigned int, data_sglen, scsi_sg_count(cmd))
462 ctf_integer(unsigned int, prot_sglen, scsi_prot_sg_count(cmd))
f127e61e 463 ctf_integer(unsigned char, prot_op, scsi_get_prot_op(cmd))
f127e61e
MD
464 ctf_sequence_hex(unsigned char, cmnd, cmd->cmnd, u32, cmd->cmd_len)
465 )
b283666f
PW
466)
467
3bc29f0a 468LTTNG_TRACEPOINT_EVENT_INSTANCE(scsi_cmd_done_timeout_template, scsi_dispatch_cmd_done,
b283666f
PW
469 TP_PROTO(struct scsi_cmnd *cmd),
470 TP_ARGS(cmd))
471
3bc29f0a 472LTTNG_TRACEPOINT_EVENT_INSTANCE(scsi_cmd_done_timeout_template, scsi_dispatch_cmd_timeout,
b283666f
PW
473 TP_PROTO(struct scsi_cmnd *cmd),
474 TP_ARGS(cmd))
475
3bc29f0a 476LTTNG_TRACEPOINT_EVENT(scsi_eh_wakeup,
b283666f
PW
477
478 TP_PROTO(struct Scsi_Host *shost),
479
480 TP_ARGS(shost),
481
f127e61e
MD
482 TP_FIELDS(
483 ctf_integer(unsigned int, host_no, shost->host_no)
484 )
b283666f
PW
485)
486
3bc29f0a 487#endif /* LTTNG_TRACE_SCSI_H */
b283666f
PW
488
489/* This part must be outside protection */
6ec43db8 490#include <probes/define_trace.h>
This page took 0.054914 seconds and 4 git commands to generate.