Tune and add some missing CAM_DEBUG() points for better consistency.

This commit is contained in:
Alexander Motin 2012-06-05 09:45:42 +00:00
parent 9f95609828
commit fddde2b8ef
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=236602
5 changed files with 48 additions and 16 deletions

View File

@ -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, union ccb *start_ccb)
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, union ccb *start_ccb)
/* 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 ccb *done_ccb)
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:

View File

@ -429,7 +429,9 @@ pmpstart(struct cam_periph *periph, union ccb *start_ccb)
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 ccb *done_ccb)
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;

View File

@ -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, void *addr, int flag, struct thread *td)
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);

View File

@ -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 ccb *start_ccb)
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 ccb *start_ccb)
/* 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 ccb *done_ccb)
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:

View File

@ -425,12 +425,14 @@ ptstart(struct cam_periph *periph, union ccb *start_ccb)
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 ccb *done_ccb)
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: