Skip to content

Commit cad8cf2

Browse files
KAGA-KOKOmartinkpetersen
authored andcommitted
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 <[email protected]> Cc: Hannes Reinecke <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Johannes Thumshirn <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 832889f commit cad8cf2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/scsi/scsi_debugfs.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@
66
void scsi_show_rq(struct seq_file *m, struct request *rq)
77
{
88
struct scsi_cmnd *cmd = container_of(scsi_req(rq), typeof(*cmd), req);
9+
int msecs = jiffies_to_msecs(jiffies - cmd->jiffies_at_alloc);
910
char buf[80];
1011

1112
__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);
1315
}

0 commit comments

Comments
 (0)