summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorken <ken@FreeBSD.org>1998-10-02 21:00:58 +0000
committerken <ken@FreeBSD.org>1998-10-02 21:00:58 +0000
commit1ad65369755d2b6446c378c73f956c9a73ac5281 (patch)
treea06ca2b59d1188c2dcf0139dae03f582c82a0fe3 /sbin
parent6d472197ec99beea28652e8ef0c17a6f72b25fea (diff)
downloadFreeBSD-src-1ad65369755d2b6446c378c73f956c9a73ac5281.zip
FreeBSD-src-1ad65369755d2b6446c378c73f956c9a73ac5281.tar.gz
Add a new CAM debugging mode, CAM_DEBUG_CDB. This causes the kernel to
print out a one line description/dump of every SCSI CDB sent to a particular debugging target or targets. This is a good bit more useful than the other debugging modes, I think. Change some things in LINT to note the availability of this new option. Fix an erroneous argument to scsi_cdb_string() in scsi_all.c Reviewed by: gibbs
Diffstat (limited to 'sbin')
-rw-r--r--sbin/camcontrol/camcontrol.85
-rw-r--r--sbin/camcontrol/camcontrol.c14
2 files changed, 14 insertions, 5 deletions
diff --git a/sbin/camcontrol/camcontrol.8 b/sbin/camcontrol/camcontrol.8
index ff53b83..9337e72 100644
--- a/sbin/camcontrol/camcontrol.8
+++ b/sbin/camcontrol/camcontrol.8
@@ -25,7 +25,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $Id: camcontrol.8,v 1.3 1998/09/17 16:12:30 ken Exp $
+.\" $Id: camcontrol.8,v 1.4 1998/09/21 20:44:39 ken Exp $
.\"
.Dd September 14, 1998
.Dt CAMCONTROL 8
@@ -292,6 +292,9 @@ Enable CAM_DEBUG_INFO printfs.
Enable CAM_DEBUG_TRACE printfs.
.It Fl S
Enable CAM_DEBUG_SUBTRACE printfs.
+.It Fl c
+Enable CAM_DEBUG_CDB printfs. This will cause the kernel to print out the
+SCSI CDBs sent to the specified device(s).
.It all
Enable debugging for all devices.
.It off
diff --git a/sbin/camcontrol/camcontrol.c b/sbin/camcontrol/camcontrol.c
index 6f17f8d..c4b5dc9 100644
--- a/sbin/camcontrol/camcontrol.c
+++ b/sbin/camcontrol/camcontrol.c
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: camcontrol.c,v 1.1 1998/09/15 06:43:02 gibbs Exp $
*/
#include <sys/ioctl.h>
@@ -93,6 +93,7 @@ typedef enum {
CAM_ARG_DEBUG_INFO = 0x10000000,
CAM_ARG_DEBUG_TRACE = 0x20000000,
CAM_ARG_DEBUG_SUBTRACE = 0x40000000,
+ CAM_ARG_DEBUG_CDB = 0x80000000,
CAM_ARG_FLAG_MASK = 0xfffffff0
} cam_argmask;
@@ -121,7 +122,7 @@ struct camcontrol_opts option_table[] = {
{"devlist", CAM_ARG_DEVTREE, NULL},
{"periphlist", CAM_ARG_DEVLIST, NULL},
{"modepage", CAM_ARG_MODE_PAGE, "dem:P:"},
- {"debug", CAM_ARG_DEBUG, "ITS"},
+ {"debug", CAM_ARG_DEBUG, "ITSc"},
{"help", CAM_ARG_USAGE, NULL},
{"-?", CAM_ARG_USAGE, NULL},
{"-h", CAM_ARG_USAGE, NULL},
@@ -1676,6 +1677,10 @@ camdebug(int argc, char **argv, char *combinedopt)
arglist |= CAM_ARG_DEBUG_SUBTRACE;
ccb.cdbg.flags |= CAM_DEBUG_SUBTRACE;
break;
+ case 'c':
+ arglist |= CAM_ARG_DEBUG_CDB;
+ ccb.cdbg.flags |= CAM_DEBUG_CDB;
+ break;
default:
break;
}
@@ -1763,7 +1768,7 @@ camdebug(int argc, char **argv, char *combinedopt)
}
}
}
- close(fd);
+ close(fd);
}
return(error);
@@ -1826,7 +1831,8 @@ usage(void)
"debug arguments:\n"
"-I CAM_DEBUG_INFO -- scsi commands, errors, data\n"
"-T CAM_DEBUG_TRACE -- routine flow tracking\n"
-"-S CAM_DEBUG_SUBTRACE -- internal routine command flow\n",
+"-S CAM_DEBUG_SUBTRACE -- internal routine command flow\n"
+"-c CAM_DEBUG_CDB -- print out SCSI CDBs only\n",
DEFAULT_DEVICE, DEFAULT_UNIT);
}
OpenPOWER on IntegriCloud