1 Oct 2003 02:21
[PATCH] consolidate and log scsi command on send and completion
Patrick Mansfield <patmans <at> us.ibm.com>
2003-10-01 00:21:34 GMT
2003-10-01 00:21:34 GMT
Hi -
Patch against 2.6.0-test6.
Consolidate and nicely log the scsi_device and scsi command before sending
and after completing a command to an adapter driver.
diff -uprN -X /home/patman/dontdiff bl-25/drivers/scsi/scsi.c bl-25-scmd-log/drivers/scsi/scsi.c
--- bl-25/drivers/scsi/scsi.c Mon Sep 29 12:21:09 2003
+++ bl-25-scmd-log/drivers/scsi/scsi.c Tue Sep 30 14:24:17 2003
<at> <at> -351,6 +351,124 <at> <at> void scsi_destroy_command_freelist(struc
up(&host_cmd_pool_mutex);
}
+#ifdef CONFIG_SCSI_LOGGING
+void scsi_log_send(struct scsi_cmnd *cmd)
+{
+ unsigned int level;
+ struct scsi_device *sdev;
+
+ /*
+ * If ML QUEUE log level is greater than or equal to:
+ *
+ * 1: nothing (match completion)
+ *
+ * 2: log opcode + command of all commands
+ *
+ * 3: same as 2 plus dump cmd address
+ *
+ * 4: same as 3 plus dump extra junk
(Continue reading)
And with scsi logging for ml queue of 2 and ml complete of 2 via:
sysctl -w dev.scsi.logging_level=0x2400
FYI, if you want both ml queue and ml complete both set:
to use scsi_logging_level
1 0x1200
2 0x2400
3 0x3600
4 0x4800
Output for scanning host3 id 0, a0 is REPORT LUNS, interspersed with writes
to the root disk <0:0:0:0>, and partition information:
scsi <3:0:0:0> send UNKNOWN(0xa0) 00 00 00 00 00 00 00 04 08 00 00
scsi <3:0:0:0> done SUCCESS 0 UNKNOWN(0xa0) 00 00 00 00 00 00 00 04 08 00 00
scsi <3:0:0:1> send Inquiry 00 00 00 24 00
scsi <3:0:0:1> done SUCCESS 0 Inquiry 00 00 00 24 00
Vendor: IBM Model: 3542 Rev: 0520
Type: Direct-Access ANSI SCSI revision: 03
scsi(3:0:0:1): Enabled tagged queuing, queue depth 64.
scsi <3:0:0:1> send Test Unit Ready 00 00 00 00 00
scsi <3:0:0:1> done SUCCESS 0 Test Unit Ready 00 00 00 00 00
scsi <3:0:0:1> send Read Capacity 00 00 00 00 00 00 00 00 00


RSS Feed