From owner-svn-src-stable-9@FreeBSD.ORG Thu Apr 18 10:01:44 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8D2491EA; Thu, 18 Apr 2013 10:01:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 640209A6; Thu, 18 Apr 2013 10:01:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3IA1iwv099991; Thu, 18 Apr 2013 10:01:44 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3IA1i77099990; Thu, 18 Apr 2013 10:01:44 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304181001.r3IA1i77099990@svn.freebsd.org> From: Alexander Motin Date: Thu, 18 Apr 2013 10:01:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249613 - stable/9/sys/cam X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 10:01:44 -0000 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