mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-21 06:01:23 +00:00
[SCSI] scsi_trace: Enhance SCSI command tracing
Various SCSI trace enhancements: - Display data and protection information scatterlist lengths in the trace output - Add support for VERIFY and WRITE SAME commands and decode the UNMAP bit if applicable - Add decoding of the PROTECT field for READ/VERIFY/WRITE/WRITE SAME commands as well as the EXPECTED INITIAL REFERENCE TAG field for their 32-byte variants - Decode READ CAPACITY(16), GET LBA STATUS, and UNMAP Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
This commit is contained in:
parent
bf81623542
commit
c446c1f990
2 changed files with 136 additions and 20 deletions
|
@ -200,6 +200,8 @@ TRACE_EVENT(scsi_dispatch_cmd_start,
|
|||
__field( unsigned int, lun )
|
||||
__field( unsigned int, opcode )
|
||||
__field( unsigned int, cmd_len )
|
||||
__field( unsigned int, data_sglen )
|
||||
__field( unsigned int, prot_sglen )
|
||||
__dynamic_array(unsigned char, cmnd, cmd->cmd_len)
|
||||
),
|
||||
|
||||
|
@ -210,12 +212,16 @@ TRACE_EVENT(scsi_dispatch_cmd_start,
|
|||
__entry->lun = cmd->device->lun;
|
||||
__entry->opcode = cmd->cmnd[0];
|
||||
__entry->cmd_len = cmd->cmd_len;
|
||||
__entry->data_sglen = scsi_sg_count(cmd);
|
||||
__entry->prot_sglen = scsi_prot_sg_count(cmd);
|
||||
memcpy(__get_dynamic_array(cmnd), cmd->cmnd, cmd->cmd_len);
|
||||
),
|
||||
|
||||
TP_printk("host_no=%u channel=%u id=%u lun=%u cmnd=(%s %s raw=%s)",
|
||||
TP_printk("host_no=%u channel=%u id=%u lun=%u data_sgl=%u prot_sgl=%u" \
|
||||
" cmnd=(%s %s raw=%s)",
|
||||
__entry->host_no, __entry->channel, __entry->id,
|
||||
__entry->lun, show_opcode_name(__entry->opcode),
|
||||
__entry->lun, __entry->data_sglen, __entry->prot_sglen,
|
||||
show_opcode_name(__entry->opcode),
|
||||
__parse_cdb(__get_dynamic_array(cmnd), __entry->cmd_len),
|
||||
__print_hex(__get_dynamic_array(cmnd), __entry->cmd_len))
|
||||
);
|
||||
|
@ -234,6 +240,8 @@ TRACE_EVENT(scsi_dispatch_cmd_error,
|
|||
__field( int, rtn )
|
||||
__field( unsigned int, opcode )
|
||||
__field( unsigned int, cmd_len )
|
||||
__field( unsigned int, data_sglen )
|
||||
__field( unsigned int, prot_sglen )
|
||||
__dynamic_array(unsigned char, cmnd, cmd->cmd_len)
|
||||
),
|
||||
|
||||
|
@ -245,13 +253,16 @@ TRACE_EVENT(scsi_dispatch_cmd_error,
|
|||
__entry->rtn = rtn;
|
||||
__entry->opcode = cmd->cmnd[0];
|
||||
__entry->cmd_len = cmd->cmd_len;
|
||||
__entry->data_sglen = scsi_sg_count(cmd);
|
||||
__entry->prot_sglen = scsi_prot_sg_count(cmd);
|
||||
memcpy(__get_dynamic_array(cmnd), cmd->cmnd, cmd->cmd_len);
|
||||
),
|
||||
|
||||
TP_printk("host_no=%u channel=%u id=%u lun=%u cmnd=(%s %s raw=%s)"
|
||||
" rtn=%d",
|
||||
TP_printk("host_no=%u channel=%u id=%u lun=%u data_sgl=%u prot_sgl=%u" \
|
||||
" cmnd=(%s %s raw=%s) rtn=%d",
|
||||
__entry->host_no, __entry->channel, __entry->id,
|
||||
__entry->lun, show_opcode_name(__entry->opcode),
|
||||
__entry->lun, __entry->data_sglen, __entry->prot_sglen,
|
||||
show_opcode_name(__entry->opcode),
|
||||
__parse_cdb(__get_dynamic_array(cmnd), __entry->cmd_len),
|
||||
__print_hex(__get_dynamic_array(cmnd), __entry->cmd_len),
|
||||
__entry->rtn)
|
||||
|
@ -271,6 +282,8 @@ DECLARE_EVENT_CLASS(scsi_cmd_done_timeout_template,
|
|||
__field( int, result )
|
||||
__field( unsigned int, opcode )
|
||||
__field( unsigned int, cmd_len )
|
||||
__field( unsigned int, data_sglen )
|
||||
__field( unsigned int, prot_sglen )
|
||||
__dynamic_array(unsigned char, cmnd, cmd->cmd_len)
|
||||
),
|
||||
|
||||
|
@ -282,13 +295,17 @@ DECLARE_EVENT_CLASS(scsi_cmd_done_timeout_template,
|
|||
__entry->result = cmd->result;
|
||||
__entry->opcode = cmd->cmnd[0];
|
||||
__entry->cmd_len = cmd->cmd_len;
|
||||
__entry->data_sglen = scsi_sg_count(cmd);
|
||||
__entry->prot_sglen = scsi_prot_sg_count(cmd);
|
||||
memcpy(__get_dynamic_array(cmnd), cmd->cmnd, cmd->cmd_len);
|
||||
),
|
||||
|
||||
TP_printk("host_no=%u channel=%u id=%u lun=%u cmnd=(%s %s raw=%s) "
|
||||
"result=(driver=%s host=%s message=%s status=%s)",
|
||||
TP_printk("host_no=%u channel=%u id=%u lun=%u data_sgl=%u " \
|
||||
"prot_sgl=%u cmnd=(%s %s raw=%s) result=(driver=%s host=%s " \
|
||||
"message=%s status=%s)",
|
||||
__entry->host_no, __entry->channel, __entry->id,
|
||||
__entry->lun, show_opcode_name(__entry->opcode),
|
||||
__entry->lun, __entry->data_sglen, __entry->prot_sglen,
|
||||
show_opcode_name(__entry->opcode),
|
||||
__parse_cdb(__get_dynamic_array(cmnd), __entry->cmd_len),
|
||||
__print_hex(__get_dynamic_array(cmnd), __entry->cmd_len),
|
||||
show_driverbyte_name(((__entry->result) >> 24) & 0xff),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue