2017-04-26 14:47:57 -06:00
|
|
|
#include <linux/seq_file.h>
|
|
|
|
#include <scsi/scsi_cmnd.h>
|
|
|
|
#include <scsi/scsi_dbg.h>
|
|
|
|
#include "scsi_debugfs.h"
|
|
|
|
|
|
|
|
void scsi_show_rq(struct seq_file *m, struct request *rq)
|
|
|
|
{
|
|
|
|
struct scsi_cmnd *cmd = container_of(scsi_req(rq), typeof(*cmd), req);
|
2017-08-30 17:58:41 -06:00
|
|
|
int msecs = jiffies_to_msecs(jiffies - cmd->jiffies_at_alloc);
|
2017-04-26 14:47:57 -06:00
|
|
|
char buf[80];
|
|
|
|
|
|
|
|
__scsi_format_command(buf, sizeof(buf), cmd->cmnd, cmd->cmd_len);
|
2017-08-30 17:58:41 -06:00
|
|
|
seq_printf(m, ", .cmd=%s, .retries=%d, allocated %d.%03d s ago", buf,
|
|
|
|
cmd->retries, msecs / 1000, msecs % 1000);
|
2017-04-26 14:47:57 -06:00
|
|
|
}
|