diff options
author | Martin K. Petersen <martin.petersen@oracle.com> | 2010-03-23 01:16:57 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-04-30 13:52:08 -0400 |
commit | c446c1f9907e84d014edb0bf3501f30cb512e06a (patch) | |
tree | b4271bbcfb1ecaedb99428461bd22f56a5121366 /include/trace | |
parent | bf81623542332bc2cedf3db49cbb2edb724780d2 (diff) |
[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>
Diffstat (limited to 'include/trace')
-rw-r--r-- | include/trace/events/scsi.h | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/include/trace/events/scsi.h b/include/trace/events/scsi.h index 76cbf828eb86..25fbefdf2f2e 100644 --- a/include/trace/events/scsi.h +++ b/include/trace/events/scsi.h | |||
@@ -200,6 +200,8 @@ TRACE_EVENT(scsi_dispatch_cmd_start, | |||
200 | __field( unsigned int, lun ) | 200 | __field( unsigned int, lun ) |
201 | __field( unsigned int, opcode ) | 201 | __field( unsigned int, opcode ) |
202 | __field( unsigned int, cmd_len ) | 202 | __field( unsigned int, cmd_len ) |
203 | __field( unsigned int, data_sglen ) | ||
204 | __field( unsigned int, prot_sglen ) | ||
203 | __dynamic_array(unsigned char, cmnd, cmd->cmd_len) | 205 | __dynamic_array(unsigned char, cmnd, cmd->cmd_len) |
204 | ), | 206 | ), |
205 | 207 | ||
@@ -210,12 +212,16 @@ TRACE_EVENT(scsi_dispatch_cmd_start, | |||
210 | __entry->lun = cmd->device->lun; | 212 | __entry->lun = cmd->device->lun; |
211 | __entry->opcode = cmd->cmnd[0]; | 213 | __entry->opcode = cmd->cmnd[0]; |
212 | __entry->cmd_len = cmd->cmd_len; | 214 | __entry->cmd_len = cmd->cmd_len; |
215 | __entry->data_sglen = scsi_sg_count(cmd); | ||
216 | __entry->prot_sglen = scsi_prot_sg_count(cmd); | ||
213 | memcpy(__get_dynamic_array(cmnd), cmd->cmnd, cmd->cmd_len); | 217 | memcpy(__get_dynamic_array(cmnd), cmd->cmnd, cmd->cmd_len); |
214 | ), | 218 | ), |
215 | 219 | ||
216 | TP_printk("host_no=%u channel=%u id=%u lun=%u cmnd=(%s %s raw=%s)", | 220 | TP_printk("host_no=%u channel=%u id=%u lun=%u data_sgl=%u prot_sgl=%u" \ |
221 | " cmnd=(%s %s raw=%s)", | ||
217 | __entry->host_no, __entry->channel, __entry->id, | 222 | __entry->host_no, __entry->channel, __entry->id, |
218 | __entry->lun, show_opcode_name(__entry->opcode), | 223 | __entry->lun, __entry->data_sglen, __entry->prot_sglen, |
224 | show_opcode_name(__entry->opcode), | ||
219 | __parse_cdb(__get_dynamic_array(cmnd), __entry->cmd_len), | 225 | __parse_cdb(__get_dynamic_array(cmnd), __entry->cmd_len), |
220 | __print_hex(__get_dynamic_array(cmnd), __entry->cmd_len)) | 226 | __print_hex(__get_dynamic_array(cmnd), __entry->cmd_len)) |
221 | ); | 227 | ); |
@@ -234,6 +240,8 @@ TRACE_EVENT(scsi_dispatch_cmd_error, | |||
234 | __field( int, rtn ) | 240 | __field( int, rtn ) |
235 | __field( unsigned int, opcode ) | 241 | __field( unsigned int, opcode ) |
236 | __field( unsigned int, cmd_len ) | 242 | __field( unsigned int, cmd_len ) |
243 | __field( unsigned int, data_sglen ) | ||
244 | __field( unsigned int, prot_sglen ) | ||
237 | __dynamic_array(unsigned char, cmnd, cmd->cmd_len) | 245 | __dynamic_array(unsigned char, cmnd, cmd->cmd_len) |
238 | ), | 246 | ), |
239 | 247 | ||
@@ -245,13 +253,16 @@ TRACE_EVENT(scsi_dispatch_cmd_error, | |||
245 | __entry->rtn = rtn; | 253 | __entry->rtn = rtn; |
246 | __entry->opcode = cmd->cmnd[0]; | 254 | __entry->opcode = cmd->cmnd[0]; |
247 | __entry->cmd_len = cmd->cmd_len; | 255 | __entry->cmd_len = cmd->cmd_len; |
256 | __entry->data_sglen = scsi_sg_count(cmd); | ||
257 | __entry->prot_sglen = scsi_prot_sg_count(cmd); | ||
248 | memcpy(__get_dynamic_array(cmnd), cmd->cmnd, cmd->cmd_len); | 258 | memcpy(__get_dynamic_array(cmnd), cmd->cmnd, cmd->cmd_len); |
249 | ), | 259 | ), |
250 | 260 | ||
251 | TP_printk("host_no=%u channel=%u id=%u lun=%u cmnd=(%s %s raw=%s)" | 261 | TP_printk("host_no=%u channel=%u id=%u lun=%u data_sgl=%u prot_sgl=%u" \ |
252 | " rtn=%d", | 262 | " cmnd=(%s %s raw=%s) rtn=%d", |
253 | __entry->host_no, __entry->channel, __entry->id, | 263 | __entry->host_no, __entry->channel, __entry->id, |
254 | __entry->lun, show_opcode_name(__entry->opcode), | 264 | __entry->lun, __entry->data_sglen, __entry->prot_sglen, |
265 | show_opcode_name(__entry->opcode), | ||
255 | __parse_cdb(__get_dynamic_array(cmnd), __entry->cmd_len), | 266 | __parse_cdb(__get_dynamic_array(cmnd), __entry->cmd_len), |
256 | __print_hex(__get_dynamic_array(cmnd), __entry->cmd_len), | 267 | __print_hex(__get_dynamic_array(cmnd), __entry->cmd_len), |
257 | __entry->rtn) | 268 | __entry->rtn) |
@@ -271,6 +282,8 @@ DECLARE_EVENT_CLASS(scsi_cmd_done_timeout_template, | |||
271 | __field( int, result ) | 282 | __field( int, result ) |
272 | __field( unsigned int, opcode ) | 283 | __field( unsigned int, opcode ) |
273 | __field( unsigned int, cmd_len ) | 284 | __field( unsigned int, cmd_len ) |
285 | __field( unsigned int, data_sglen ) | ||
286 | __field( unsigned int, prot_sglen ) | ||
274 | __dynamic_array(unsigned char, cmnd, cmd->cmd_len) | 287 | __dynamic_array(unsigned char, cmnd, cmd->cmd_len) |
275 | ), | 288 | ), |
276 | 289 | ||
@@ -282,13 +295,17 @@ DECLARE_EVENT_CLASS(scsi_cmd_done_timeout_template, | |||
282 | __entry->result = cmd->result; | 295 | __entry->result = cmd->result; |
283 | __entry->opcode = cmd->cmnd[0]; | 296 | __entry->opcode = cmd->cmnd[0]; |
284 | __entry->cmd_len = cmd->cmd_len; | 297 | __entry->cmd_len = cmd->cmd_len; |
298 | __entry->data_sglen = scsi_sg_count(cmd); | ||
299 | __entry->prot_sglen = scsi_prot_sg_count(cmd); | ||
285 | memcpy(__get_dynamic_array(cmnd), cmd->cmnd, cmd->cmd_len); | 300 | memcpy(__get_dynamic_array(cmnd), cmd->cmnd, cmd->cmd_len); |
286 | ), | 301 | ), |
287 | 302 | ||
288 | TP_printk("host_no=%u channel=%u id=%u lun=%u cmnd=(%s %s raw=%s) " | 303 | TP_printk("host_no=%u channel=%u id=%u lun=%u data_sgl=%u " \ |
289 | "result=(driver=%s host=%s message=%s status=%s)", | 304 | "prot_sgl=%u cmnd=(%s %s raw=%s) result=(driver=%s host=%s " \ |
305 | "message=%s status=%s)", | ||
290 | __entry->host_no, __entry->channel, __entry->id, | 306 | __entry->host_no, __entry->channel, __entry->id, |
291 | __entry->lun, show_opcode_name(__entry->opcode), | 307 | __entry->lun, __entry->data_sglen, __entry->prot_sglen, |
308 | show_opcode_name(__entry->opcode), | ||
292 | __parse_cdb(__get_dynamic_array(cmnd), __entry->cmd_len), | 309 | __parse_cdb(__get_dynamic_array(cmnd), __entry->cmd_len), |
293 | __print_hex(__get_dynamic_array(cmnd), __entry->cmd_len), | 310 | __print_hex(__get_dynamic_array(cmnd), __entry->cmd_len), |
294 | show_driverbyte_name(((__entry->result) >> 24) & 0xff), | 311 | show_driverbyte_name(((__entry->result) >> 24) & 0xff), |