diff options
author | Bart Van Assche <bart.vanassche@wdc.com> | 2017-08-30 19:58:41 -0400 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2017-08-31 23:09:11 -0400 |
commit | cad8cf20a65f3d6cd70719bd0fec2d54546b12ef (patch) | |
tree | 8f327d9d1636fa5f49b2b6f25cfd4905d90ceab4 | |
parent | 832889f5ed45ec90c76f6eb97e64baf845929007 (diff) |
scsi: Show .retries and .jiffies_at_alloc in debugfs
Make these two member variables available in debugfs such that their
value can be verified by kernel developers. An example of the new
output:
ffff8804a513d480 {.op=READ, .cmd_flags=META|PRIO, .rq_flags=MQ_INFLIGHT|DONTPREP|IO_STAT|STATS, .atomic_flags=STARTED, .tag=17, .internal_tag=-1, .cmd=Read(10) 28 00 08 81 32 38 00 00 08 00, .retries=0, allocated 0.010 s ago}
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Hannes Reinecke <hare@suse.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r-- | drivers/scsi/scsi_debugfs.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/scsi/scsi_debugfs.c b/drivers/scsi/scsi_debugfs.c index a97c9507103d..5e9755008aed 100644 --- a/drivers/scsi/scsi_debugfs.c +++ b/drivers/scsi/scsi_debugfs.c | |||
@@ -6,8 +6,10 @@ | |||
6 | void scsi_show_rq(struct seq_file *m, struct request *rq) | 6 | void scsi_show_rq(struct seq_file *m, struct request *rq) |
7 | { | 7 | { |
8 | struct scsi_cmnd *cmd = container_of(scsi_req(rq), typeof(*cmd), req); | 8 | struct scsi_cmnd *cmd = container_of(scsi_req(rq), typeof(*cmd), req); |
9 | int msecs = jiffies_to_msecs(jiffies - cmd->jiffies_at_alloc); | ||
9 | char buf[80]; | 10 | char buf[80]; |
10 | 11 | ||
11 | __scsi_format_command(buf, sizeof(buf), cmd->cmnd, cmd->cmd_len); | 12 | __scsi_format_command(buf, sizeof(buf), cmd->cmnd, cmd->cmd_len); |
12 | seq_printf(m, ", .cmd=%s", buf); | 13 | seq_printf(m, ", .cmd=%s, .retries=%d, allocated %d.%03d s ago", buf, |
14 | cmd->retries, msecs / 1000, msecs % 1000); | ||
13 | } | 15 | } |