diff options
| author | Martin K. Petersen <martin.petersen@oracle.com> | 2011-03-08 02:03:59 -0500 |
|---|---|---|
| committer | James Bottomley <James.Bottomley@suse.de> | 2011-03-14 19:36:02 -0400 |
| commit | 72f7d322fd60ce1a0579136dec7b26b0801ded4b (patch) | |
| tree | a1b6bbe30bcff290018ec9618128e4f82012dd29 /include/trace | |
| parent | 9143a9612277abc6e4ddced2bc54a120734834c6 (diff) | |
[SCSI] Include protection operation in SCSI command trace
When debugging DIF/DIX it is very helpful to be able to see which DIX
operation is associated with the scsi_cmnd. Include the protection op in
the SCSI command trace.
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'include/trace')
| -rw-r--r-- | include/trace/events/scsi.h | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/include/trace/events/scsi.h b/include/trace/events/scsi.h index 25fbefdf2f2e..db6c93510f74 100644 --- a/include/trace/events/scsi.h +++ b/include/trace/events/scsi.h | |||
| @@ -184,6 +184,17 @@ | |||
| 184 | scsi_statusbyte_name(SAM_STAT_ACA_ACTIVE), \ | 184 | scsi_statusbyte_name(SAM_STAT_ACA_ACTIVE), \ |
| 185 | scsi_statusbyte_name(SAM_STAT_TASK_ABORTED)) | 185 | scsi_statusbyte_name(SAM_STAT_TASK_ABORTED)) |
| 186 | 186 | ||
| 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)) | ||
| 197 | |||
| 187 | const char *scsi_trace_parse_cdb(struct trace_seq*, unsigned char*, int); | 198 | const char *scsi_trace_parse_cdb(struct trace_seq*, unsigned char*, int); |
| 188 | #define __parse_cdb(cdb, len) scsi_trace_parse_cdb(p, cdb, len) | 199 | #define __parse_cdb(cdb, len) scsi_trace_parse_cdb(p, cdb, len) |
| 189 | 200 | ||
| @@ -202,6 +213,7 @@ TRACE_EVENT(scsi_dispatch_cmd_start, | |||
| 202 | __field( unsigned int, cmd_len ) | 213 | __field( unsigned int, cmd_len ) |
| 203 | __field( unsigned int, data_sglen ) | 214 | __field( unsigned int, data_sglen ) |
| 204 | __field( unsigned int, prot_sglen ) | 215 | __field( unsigned int, prot_sglen ) |
| 216 | __field( unsigned char, prot_op ) | ||
| 205 | __dynamic_array(unsigned char, cmnd, cmd->cmd_len) | 217 | __dynamic_array(unsigned char, cmnd, cmd->cmd_len) |
| 206 | ), | 218 | ), |
| 207 | 219 | ||
| @@ -214,13 +226,15 @@ TRACE_EVENT(scsi_dispatch_cmd_start, | |||
| 214 | __entry->cmd_len = cmd->cmd_len; | 226 | __entry->cmd_len = cmd->cmd_len; |
| 215 | __entry->data_sglen = scsi_sg_count(cmd); | 227 | __entry->data_sglen = scsi_sg_count(cmd); |
| 216 | __entry->prot_sglen = scsi_prot_sg_count(cmd); | 228 | __entry->prot_sglen = scsi_prot_sg_count(cmd); |
| 229 | __entry->prot_op = scsi_get_prot_op(cmd); | ||
| 217 | memcpy(__get_dynamic_array(cmnd), cmd->cmnd, cmd->cmd_len); | 230 | memcpy(__get_dynamic_array(cmnd), cmd->cmnd, cmd->cmd_len); |
| 218 | ), | 231 | ), |
| 219 | 232 | ||
| 220 | TP_printk("host_no=%u channel=%u id=%u lun=%u data_sgl=%u prot_sgl=%u" \ | 233 | TP_printk("host_no=%u channel=%u id=%u lun=%u data_sgl=%u prot_sgl=%u" \ |
| 221 | " cmnd=(%s %s raw=%s)", | 234 | " prot_op=%s cmnd=(%s %s raw=%s)", |
| 222 | __entry->host_no, __entry->channel, __entry->id, | 235 | __entry->host_no, __entry->channel, __entry->id, |
| 223 | __entry->lun, __entry->data_sglen, __entry->prot_sglen, | 236 | __entry->lun, __entry->data_sglen, __entry->prot_sglen, |
| 237 | show_prot_op_name(__entry->prot_op), | ||
| 224 | show_opcode_name(__entry->opcode), | 238 | show_opcode_name(__entry->opcode), |
| 225 | __parse_cdb(__get_dynamic_array(cmnd), __entry->cmd_len), | 239 | __parse_cdb(__get_dynamic_array(cmnd), __entry->cmd_len), |
| 226 | __print_hex(__get_dynamic_array(cmnd), __entry->cmd_len)) | 240 | __print_hex(__get_dynamic_array(cmnd), __entry->cmd_len)) |
| @@ -242,6 +256,7 @@ TRACE_EVENT(scsi_dispatch_cmd_error, | |||
| 242 | __field( unsigned int, cmd_len ) | 256 | __field( unsigned int, cmd_len ) |
| 243 | __field( unsigned int, data_sglen ) | 257 | __field( unsigned int, data_sglen ) |
| 244 | __field( unsigned int, prot_sglen ) | 258 | __field( unsigned int, prot_sglen ) |
| 259 | __field( unsigned char, prot_op ) | ||
| 245 | __dynamic_array(unsigned char, cmnd, cmd->cmd_len) | 260 | __dynamic_array(unsigned char, cmnd, cmd->cmd_len) |
| 246 | ), | 261 | ), |
| 247 | 262 | ||
| @@ -255,13 +270,15 @@ TRACE_EVENT(scsi_dispatch_cmd_error, | |||
| 255 | __entry->cmd_len = cmd->cmd_len; | 270 | __entry->cmd_len = cmd->cmd_len; |
| 256 | __entry->data_sglen = scsi_sg_count(cmd); | 271 | __entry->data_sglen = scsi_sg_count(cmd); |
| 257 | __entry->prot_sglen = scsi_prot_sg_count(cmd); | 272 | __entry->prot_sglen = scsi_prot_sg_count(cmd); |
| 273 | __entry->prot_op = scsi_get_prot_op(cmd); | ||
| 258 | memcpy(__get_dynamic_array(cmnd), cmd->cmnd, cmd->cmd_len); | 274 | memcpy(__get_dynamic_array(cmnd), cmd->cmnd, cmd->cmd_len); |
| 259 | ), | 275 | ), |
| 260 | 276 | ||
| 261 | TP_printk("host_no=%u channel=%u id=%u lun=%u data_sgl=%u prot_sgl=%u" \ | 277 | TP_printk("host_no=%u channel=%u id=%u lun=%u data_sgl=%u prot_sgl=%u" \ |
| 262 | " cmnd=(%s %s raw=%s) rtn=%d", | 278 | " prot_op=%s cmnd=(%s %s raw=%s) rtn=%d", |
| 263 | __entry->host_no, __entry->channel, __entry->id, | 279 | __entry->host_no, __entry->channel, __entry->id, |
| 264 | __entry->lun, __entry->data_sglen, __entry->prot_sglen, | 280 | __entry->lun, __entry->data_sglen, __entry->prot_sglen, |
| 281 | show_prot_op_name(__entry->prot_op), | ||
| 265 | show_opcode_name(__entry->opcode), | 282 | show_opcode_name(__entry->opcode), |
| 266 | __parse_cdb(__get_dynamic_array(cmnd), __entry->cmd_len), | 283 | __parse_cdb(__get_dynamic_array(cmnd), __entry->cmd_len), |
| 267 | __print_hex(__get_dynamic_array(cmnd), __entry->cmd_len), | 284 | __print_hex(__get_dynamic_array(cmnd), __entry->cmd_len), |
| @@ -284,6 +301,7 @@ DECLARE_EVENT_CLASS(scsi_cmd_done_timeout_template, | |||
| 284 | __field( unsigned int, cmd_len ) | 301 | __field( unsigned int, cmd_len ) |
| 285 | __field( unsigned int, data_sglen ) | 302 | __field( unsigned int, data_sglen ) |
| 286 | __field( unsigned int, prot_sglen ) | 303 | __field( unsigned int, prot_sglen ) |
| 304 | __field( unsigned char, prot_op ) | ||
| 287 | __dynamic_array(unsigned char, cmnd, cmd->cmd_len) | 305 | __dynamic_array(unsigned char, cmnd, cmd->cmd_len) |
| 288 | ), | 306 | ), |
| 289 | 307 | ||
| @@ -297,14 +315,16 @@ DECLARE_EVENT_CLASS(scsi_cmd_done_timeout_template, | |||
| 297 | __entry->cmd_len = cmd->cmd_len; | 315 | __entry->cmd_len = cmd->cmd_len; |
| 298 | __entry->data_sglen = scsi_sg_count(cmd); | 316 | __entry->data_sglen = scsi_sg_count(cmd); |
| 299 | __entry->prot_sglen = scsi_prot_sg_count(cmd); | 317 | __entry->prot_sglen = scsi_prot_sg_count(cmd); |
| 318 | __entry->prot_op = scsi_get_prot_op(cmd); | ||
| 300 | memcpy(__get_dynamic_array(cmnd), cmd->cmnd, cmd->cmd_len); | 319 | memcpy(__get_dynamic_array(cmnd), cmd->cmnd, cmd->cmd_len); |
| 301 | ), | 320 | ), |
| 302 | 321 | ||
| 303 | TP_printk("host_no=%u channel=%u id=%u lun=%u data_sgl=%u " \ | 322 | TP_printk("host_no=%u channel=%u id=%u lun=%u data_sgl=%u " \ |
| 304 | "prot_sgl=%u cmnd=(%s %s raw=%s) result=(driver=%s host=%s " \ | 323 | "prot_sgl=%u prot_op=%s cmnd=(%s %s raw=%s) result=(driver=" \ |
| 305 | "message=%s status=%s)", | 324 | "%s host=%s message=%s status=%s)", |
| 306 | __entry->host_no, __entry->channel, __entry->id, | 325 | __entry->host_no, __entry->channel, __entry->id, |
| 307 | __entry->lun, __entry->data_sglen, __entry->prot_sglen, | 326 | __entry->lun, __entry->data_sglen, __entry->prot_sglen, |
| 327 | show_prot_op_name(__entry->prot_op), | ||
| 308 | show_opcode_name(__entry->opcode), | 328 | show_opcode_name(__entry->opcode), |
| 309 | __parse_cdb(__get_dynamic_array(cmnd), __entry->cmd_len), | 329 | __parse_cdb(__get_dynamic_array(cmnd), __entry->cmd_len), |
| 310 | __print_hex(__get_dynamic_array(cmnd), __entry->cmd_len), | 330 | __print_hex(__get_dynamic_array(cmnd), __entry->cmd_len), |
