mirror of
https://github.com/torvalds/linux.git
synced 2026-11-26 16:33:17 +00:00
Show the SCSI CDB for pending SCSI commands in
/sys/kernel/debug/block/*/mq/*/dispatch and */rq_list. An example
of how SCSI commands are displayed by this code:
ffff8801703245c0 {.op=READ, .cmd_flags=META PRIO, .rq_flags=DONTPREP IO_STAT STATS, .tag=14, .internal_tag=-1, .cmd=Read(10) 28 00 2a 81 1b 30 00 00 08 00}
Signed-off-by: Bart Van Assche <[email protected]>
Reviewed-by: Omar Sandoval <[email protected]>
Cc: Martin K. Petersen <[email protected]>
Cc: James Bottomley <[email protected]>
Cc: Hannes Reinecke <[email protected]>
Cc: <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
14 lines
361 B
C
14 lines
361 B
C
#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);
|
|
char buf[80];
|
|
|
|
__scsi_format_command(buf, sizeof(buf), cmd->cmnd, cmd->cmd_len);
|
|
seq_printf(m, ", .cmd=%s", buf);
|
|
}
|