From: Yi Zou Date: Wed, 1 Dec 2010 00:19:15 +0000 (-0800) Subject: [SCSI] libfc: add print of exchange id for debugging fc_fcp X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=9b90dc80ba2e566a48585174b1e5ab00e16f0456;p=openwrt%2Fstaging%2Fblogic.git [SCSI] libfc: add print of exchange id for debugging fc_fcp This is very helpful to match up the corresponding exchange to the actual I/O described by the fsp, particularly when you do a side-by-side comparison of the syslog with your trace. Signed-off-by: Yi Zou Signed-off-by: Robert Love Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/libfc/fc_libfc.h b/drivers/scsi/libfc/fc_libfc.h index 16d2162dda1f..eea0c3541b71 100644 --- a/drivers/scsi/libfc/fc_libfc.h +++ b/drivers/scsi/libfc/fc_libfc.h @@ -66,9 +66,21 @@ extern unsigned int fc_debug_logging; #define FC_FCP_DBG(pkt, fmt, args...) \ FC_CHECK_LOGGING(FC_FCP_LOGGING, \ - printk(KERN_INFO "host%u: fcp: %6.6x: " fmt, \ + { \ + if ((pkt)->seq_ptr) { \ + struct fc_exch *_ep = NULL; \ + _ep = fc_seq_exch((pkt)->seq_ptr); \ + printk(KERN_INFO "host%u: fcp: %6.6x: " \ + "xid %04x-%04x: " fmt, \ (pkt)->lp->host->host_no, \ - pkt->rport->port_id, ##args)) + (pkt)->rport->port_id, \ + (_ep)->oxid, (_ep)->rxid, ##args); \ + } else { \ + printk(KERN_INFO "host%u: fcp: %6.6x: " fmt, \ + (pkt)->lp->host->host_no, \ + (pkt)->rport->port_id, ##args); \ + } \ + }) #define FC_EXCH_DBG(exch, fmt, args...) \ FC_CHECK_LOGGING(FC_EXCH_LOGGING, \