From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 09:45:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4698B1065670; Tue, 5 Jun 2012 09:45:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 30BAA8FC1C; Tue, 5 Jun 2012 09:45:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q559jhIf002588; Tue, 5 Jun 2012 09:45:43 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q559jgKT002582; Tue, 5 Jun 2012 09:45:42 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206050945.q559jgKT002582@svn.freebsd.org> From: Alexander Motin Date: Tue, 5 Jun 2012 09:45:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236602 - in head/sys/cam: ata scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 09:45:43 -0000 Author: mav Date: Tue Jun 5 09:45:42 2012 New Revision: 236602 URL: http://svn.freebsd.org/changeset/base/236602 Log: Tune and add some missing CAM_DEBUG() points for better consistency. Modified: head/sys/cam/ata/ata_da.c head/sys/cam/ata/ata_pmp.c head/sys/cam/scsi/scsi_cd.c head/sys/cam/scsi/scsi_da.c head/sys/cam/scsi/scsi_pt.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Tue Jun 5 06:43:45 2012 (r236601) +++ head/sys/cam/ata/ata_da.c Tue Jun 5 09:45:42 2012 (r236602) @@ -436,9 +436,8 @@ adaopen(struct disk *dp) softc = (struct ada_softc *)periph->softc; softc->flags |= ADA_FLAG_OPEN; - CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, - ("adaopen: disk=%s%d (unit %d)\n", dp->d_name, dp->d_unit, - periph->unit_number)); + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE | CAM_DEBUG_PERIPH, + ("adaopen\n")); if ((softc->flags & ADA_FLAG_PACK_INVALID) != 0) { /* Invalidate our pack information. */ @@ -469,6 +468,10 @@ adaclose(struct disk *dp) } softc = (struct ada_softc *)periph->softc; + + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE | CAM_DEBUG_PERIPH, + ("adaclose\n")); + /* We only sync the cache if the drive is capable of it. */ if ((softc->flags & ADA_FLAG_CAN_FLUSHCACHE) != 0 && (softc->flags & ADA_FLAG_PACK_INVALID) == 0) { @@ -542,6 +545,8 @@ adastrategy(struct bio *bp) cam_periph_lock(periph); + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("adastrategy(%p)\n", bp)); + /* * If the device has been made invalid, error out */ @@ -1167,6 +1172,8 @@ adastart(struct cam_periph *periph, unio struct ada_softc *softc = (struct ada_softc *)periph->softc; struct ccb_ataio *ataio = &start_ccb->ataio; + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("adastart\n")); + switch (softc->state) { case ADA_STATE_NORMAL: { @@ -1175,7 +1182,7 @@ adastart(struct cam_periph *periph, unio /* Execute immediate CCB if waiting. */ if (periph->immediate_priority <= periph->pinfo.priority) { - CAM_DEBUG_PRINT(CAM_DEBUG_SUBTRACE, + CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, ("queuing for immediate ccb\n")); start_ccb->ccb_h.ccb_state = ADA_CCB_WAITING; SLIST_INSERT_HEAD(&periph->ccb_list, &start_ccb->ccb_h, @@ -1467,6 +1474,9 @@ adadone(struct cam_periph *periph, union softc = (struct ada_softc *)periph->softc; ataio = &done_ccb->ataio; + + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("adadone\n")); + switch (ataio->ccb_h.ccb_state & ADA_CCB_TYPE_MASK) { case ADA_CCB_BUFFER_IO: case ADA_CCB_TRIM: Modified: head/sys/cam/ata/ata_pmp.c ============================================================================== --- head/sys/cam/ata/ata_pmp.c Tue Jun 5 06:43:45 2012 (r236601) +++ head/sys/cam/ata/ata_pmp.c Tue Jun 5 09:45:42 2012 (r236602) @@ -429,7 +429,9 @@ pmpstart(struct cam_periph *periph, unio softc = (struct pmp_softc *)periph->softc; ataio = &start_ccb->ataio; - + + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("pmpstart\n")); + if (softc->restart) { softc->restart = 0; softc->state = min(softc->state, PMP_STATE_PRECONFIG); @@ -560,7 +562,7 @@ pmpdone(struct cam_periph *periph, union softc = (struct pmp_softc *)periph->softc; ataio = &done_ccb->ataio; - CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_TRACE, ("pmpdone\n")); + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("pmpdone\n")); priority = done_ccb->ccb_h.pinfo.priority; Modified: head/sys/cam/scsi/scsi_cd.c ============================================================================== --- head/sys/cam/scsi/scsi_cd.c Tue Jun 5 06:43:45 2012 (r236601) +++ head/sys/cam/scsi/scsi_cd.c Tue Jun 5 09:45:42 2012 (r236602) @@ -1014,6 +1014,9 @@ cdopen(struct disk *dp) return (error); } + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE | CAM_DEBUG_PERIPH, + ("cdopen\n")); + /* * Check for media, and set the appropriate flags. We don't bail * if we don't have media, but then we don't allow anything but the @@ -1051,6 +1054,9 @@ cdclose(struct disk *dp) cam_periph_lock(periph); cam_periph_hold(periph, PRIBIO); + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE | CAM_DEBUG_PERIPH, + ("cdclose\n")); + if ((softc->flags & CD_FLAG_DISC_REMOVABLE) != 0) cdprevent(periph, PR_ALLOW); @@ -1395,7 +1401,8 @@ cdstrategy(struct bio *bp) } cam_periph_lock(periph); - CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("entering cdstrategy\n")); + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, + ("cdstrategy(%p)\n", bp)); softc = (struct cd_softc *)periph->softc; @@ -1861,12 +1868,11 @@ cdioctl(struct disk *dp, u_long cmd, voi return(ENXIO); cam_periph_lock(periph); - CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("entering cdioctl\n")); softc = (struct cd_softc *)periph->softc; - CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, - ("trying to do ioctl %#lx\n", cmd)); + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, + ("cdioctl(%#lx)\n", cmd)); if ((error = cam_periph_hold(periph, PRIBIO | PCATCH)) != 0) { cam_periph_unlock(periph); Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Tue Jun 5 06:43:45 2012 (r236601) +++ head/sys/cam/scsi/scsi_da.c Tue Jun 5 09:45:42 2012 (r236602) @@ -942,9 +942,8 @@ daopen(struct disk *dp) softc = (struct da_softc *)periph->softc; softc->flags |= DA_FLAG_OPEN; - CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, - ("daopen: disk=%s%d (unit %d)\n", dp->d_name, dp->d_unit, - unit)); + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE | CAM_DEBUG_PERIPH, + ("daopen\n")); if ((softc->flags & DA_FLAG_PACK_INVALID) != 0) { /* Invalidate our pack information. */ @@ -999,6 +998,9 @@ daclose(struct disk *dp) softc = (struct da_softc *)periph->softc; + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE | CAM_DEBUG_PERIPH, + ("daclose\n")); + if ((softc->quirks & DA_Q_NO_SYNC_CACHE) == 0 && (softc->flags & DA_FLAG_PACK_INVALID) == 0) { union ccb *ccb; @@ -1108,7 +1110,9 @@ dastrategy(struct bio *bp) biofinish(bp, NULL, ENXIO); return; } - + + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("dastrategy(%p)\n", bp)); + /* * Place it in the queue of disk activities for this disk */ @@ -1724,6 +1728,8 @@ dastart(struct cam_periph *periph, union softc = (struct da_softc *)periph->softc; + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("dastart\n")); + switch (softc->state) { case DA_STATE_NORMAL: { @@ -1732,7 +1738,7 @@ dastart(struct cam_periph *periph, union /* Execute immediate CCB if waiting. */ if (periph->immediate_priority <= periph->pinfo.priority) { - CAM_DEBUG_PRINT(CAM_DEBUG_SUBTRACE, + CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, ("queuing for immediate ccb\n")); start_ccb->ccb_h.ccb_state = DA_CCB_WAITING; SLIST_INSERT_HEAD(&periph->ccb_list, &start_ccb->ccb_h, @@ -2064,6 +2070,9 @@ dadone(struct cam_periph *periph, union softc = (struct da_softc *)periph->softc; priority = done_ccb->ccb_h.pinfo.priority; + + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("dadone\n")); + csio = &done_ccb->csio; switch (csio->ccb_h.ccb_state & DA_CCB_TYPE_MASK) { case DA_CCB_BUFFER_IO: Modified: head/sys/cam/scsi/scsi_pt.c ============================================================================== --- head/sys/cam/scsi/scsi_pt.c Tue Jun 5 06:43:45 2012 (r236601) +++ head/sys/cam/scsi/scsi_pt.c Tue Jun 5 09:45:42 2012 (r236602) @@ -425,12 +425,14 @@ ptstart(struct cam_periph *periph, union softc = (struct pt_softc *)periph->softc; + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("ptstart\n")); + /* * See if there is a buf with work for us to do.. */ bp = bioq_first(&softc->bio_queue); if (periph->immediate_priority <= periph->pinfo.priority) { - CAM_DEBUG_PRINT(CAM_DEBUG_SUBTRACE, + CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, ("queuing for immediate ccb\n")); start_ccb->ccb_h.ccb_state = PT_CCB_WAITING; SLIST_INSERT_HEAD(&periph->ccb_list, &start_ccb->ccb_h, @@ -483,6 +485,9 @@ ptdone(struct cam_periph *periph, union struct ccb_scsiio *csio; softc = (struct pt_softc *)periph->softc; + + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("ptdone\n")); + csio = &done_ccb->csio; switch (csio->ccb_h.ccb_state) { case PT_CCB_BUFFER_IO: