Author: mav
Date: Thu Apr 18 10:01:43 2013
New Revision: 249613
URL: http://svnweb.freebsd.org/changeset/base/249613

Log:
  MFC r249104:
  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.

Modified:
  stable/9/sys/cam/cam_xpt.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/cam/cam_xpt.c
==============================================================================
--- stable/9/sys/cam/cam_xpt.c  Thu Apr 18 09:58:30 2013        (r249612)
+++ stable/9/sys/cam/cam_xpt.c  Thu Apr 18 10:01:43 2013        (r249613)
@@ -2462,7 +2462,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;
@@ -2498,11 +2497,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:
@@ -2511,13 +2505,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:
@@ -3260,6 +3249,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"));
 
@@ -3341,6 +3331,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
_______________________________________________
svn-src-stable-9@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-stable-9
To unsubscribe, send any mail to "svn-src-stable-9-unsubscr...@freebsd.org"

Reply via email to