summaryrefslogtreecommitdiffstats
path: root/sys/cam/cam_xpt.c
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2013-04-04 18:59:29 +0000
committermav <mav@FreeBSD.org>2013-04-04 18:59:29 +0000
commitb1edc598e7f99b67fab83d62ca8c62bbc07dc489 (patch)
treef149db4e7db8ff59f51416deb4f42cdeaec3f805 /sys/cam/cam_xpt.c
parentffaf63001477f46860b790809cc707e4fe518656 (diff)
downloadFreeBSD-src-b1edc598e7f99b67fab83d62ca8c62bbc07dc489.zip
FreeBSD-src-b1edc598e7f99b67fab83d62ca8c62bbc07dc489.tar.gz
MFprojects/camlock r248928:
Move CAM_DEBUG_CDB messages from the point of queuing to the point of sending to SIM. That allows to inspect real requests execution order, respecting priorities, freezing, etc. MFC after: 2 weeks
Diffstat (limited to 'sys/cam/cam_xpt.c')
-rw-r--r--sys/cam/cam_xpt.c34
1 files changed, 22 insertions, 12 deletions
diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c
index 068e26a..a754a5b 100644
--- a/sys/cam/cam_xpt.c
+++ b/sys/cam/cam_xpt.c
@@ -2430,7 +2430,6 @@ xpt_action(union ccb *start_ccb)
void
xpt_action_default(union ccb *start_ccb)
{
- char cdb_str[(SCSI_MAX_CDBLEN * 3) + 1];
struct cam_path *path;
path = start_ccb->ccb_h.path;
@@ -2466,11 +2465,6 @@ xpt_action_default(union ccb *start_ccb)
start_ccb->ccb_h.target_lun << 5;
}
start_ccb->csio.scsi_status = SCSI_STATUS_OK;
- CAM_DEBUG(path, CAM_DEBUG_CDB,("%s. CDB: %s\n",
- scsi_op_desc(start_ccb->csio.cdb_io.cdb_bytes[0],
- &path->device->inq_data),
- scsi_cdb_string(start_ccb->csio.cdb_io.cdb_bytes,
- cdb_str, sizeof(cdb_str))));
}
/* FALLTHROUGH */
case XPT_TARGET_IO:
@@ -2479,13 +2473,8 @@ xpt_action_default(union ccb *start_ccb)
start_ccb->csio.resid = 0;
/* FALLTHROUGH */
case XPT_ATA_IO:
- if (start_ccb->ccb_h.func_code == XPT_ATA_IO) {
+ if (start_ccb->ccb_h.func_code == XPT_ATA_IO)
start_ccb->ataio.resid = 0;
- CAM_DEBUG(path, CAM_DEBUG_CDB,("%s. ACB: %s\n",
- ata_op_string(&start_ccb->ataio.cmd),
- ata_cmd_string(&start_ccb->ataio.cmd,
- cdb_str, sizeof(cdb_str))));
- }
/* FALLTHROUGH */
case XPT_RESET_DEV:
case XPT_ENG_EXEC:
@@ -3228,6 +3217,7 @@ static void
xpt_run_dev_sendq(struct cam_eb *bus)
{
struct cam_devq *devq;
+ char cdb_str[(SCSI_MAX_CDBLEN * 3) + 1];
CAM_DEBUG_PRINT(CAM_DEBUG_XPT, ("xpt_run_dev_sendq\n"));
@@ -3309,6 +3299,26 @@ xpt_run_dev_sendq(struct cam_eb *bus)
work_ccb->ccb_h.flags &= ~CAM_TAG_ACTION_VALID;
}
+ switch (work_ccb->ccb_h.func_code) {
+ case XPT_SCSI_IO:
+ CAM_DEBUG(work_ccb->ccb_h.path,
+ CAM_DEBUG_CDB,("%s. CDB: %s\n",
+ scsi_op_desc(work_ccb->csio.cdb_io.cdb_bytes[0],
+ &device->inq_data),
+ scsi_cdb_string(work_ccb->csio.cdb_io.cdb_bytes,
+ cdb_str, sizeof(cdb_str))));
+ break;
+ case XPT_ATA_IO:
+ CAM_DEBUG(work_ccb->ccb_h.path,
+ CAM_DEBUG_CDB,("%s. ACB: %s\n",
+ ata_op_string(&work_ccb->ataio.cmd),
+ ata_cmd_string(&work_ccb->ataio.cmd,
+ cdb_str, sizeof(cdb_str))));
+ break;
+ default:
+ break;
+ }
+
/*
* Device queues can be shared among multiple sim instances
* that reside on different busses. Use the SIM in the queue
OpenPOWER on IntegriCloud