2017-04-26 23:47:57 +03: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-31 02:58:41 +03:00
|
|
|
int msecs = jiffies_to_msecs(jiffies - cmd->jiffies_at_alloc);
|
2017-04-26 23:47:57 +03:00
|
|
|
char buf[80];
|
|
|
|
|
|
|
|
__scsi_format_command(buf, sizeof(buf), cmd->cmnd, cmd->cmd_len);
|
2017-08-31 02:58:41 +03:00
|
|
|
seq_printf(m, ", .cmd=%s, .retries=%d, allocated %d.%03d s ago", buf,
|
|
|
|
cmd->retries, msecs / 1000, msecs % 1000);
|
2017-04-26 23:47:57 +03:00
|
|
|
}
|