summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authornjl <njl@FreeBSD.org>2002-12-17 06:05:21 +0000
committernjl <njl@FreeBSD.org>2002-12-17 06:05:21 +0000
commit66134cacfa0f0b08a299886e514cacff3c0f0be4 (patch)
treeec703576fafca767bf3d4274934002fb2617243b /sbin
parentb41b7d707e21873276d7eefc231ecee1f5767c58 (diff)
downloadFreeBSD-src-66134cacfa0f0b08a299886e514cacff3c0f0be4.zip
FreeBSD-src-66134cacfa0f0b08a299886e514cacff3c0f0be4.tar.gz
Add PERIPH and XPT debug options to camcontrol. This makes all CAM debug
options tunable from userland. Approved by: ken MFC after: 3 days
Diffstat (limited to 'sbin')
-rw-r--r--sbin/camcontrol/camcontrol.86
-rw-r--r--sbin/camcontrol/camcontrol.c20
2 files changed, 22 insertions, 4 deletions
diff --git a/sbin/camcontrol/camcontrol.8 b/sbin/camcontrol/camcontrol.8
index c732db5..84c3bf9 100644
--- a/sbin/camcontrol/camcontrol.8
+++ b/sbin/camcontrol/camcontrol.8
@@ -107,8 +107,10 @@
.Nm
.Ic debug
.Op Fl I
+.Op Fl P
.Op Fl T
.Op Fl S
+.Op Fl X
.Op Fl c
.Aq all|off|bus Ns Op :target Ns Op :lun
.Nm
@@ -406,10 +408,14 @@ function takes a number of arguments:
.Bl -tag -width 18n
.It Fl I
Enable CAM_DEBUG_INFO printfs.
+.It Fl P
+Enable CAM_DEBUG_PERIPH printfs.
.It Fl T
Enable CAM_DEBUG_TRACE printfs.
.It Fl S
Enable CAM_DEBUG_SUBTRACE printfs.
+.It Fl X
+Enable CAM_DEBUG_XPT 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).
diff --git a/sbin/camcontrol/camcontrol.c b/sbin/camcontrol/camcontrol.c
index eccd1d8..a048442 100644
--- a/sbin/camcontrol/camcontrol.c
+++ b/sbin/camcontrol/camcontrol.c
@@ -99,6 +99,8 @@ typedef enum {
CAM_ARG_DEBUG_TRACE = 0x02000000,
CAM_ARG_DEBUG_SUBTRACE = 0x04000000,
CAM_ARG_DEBUG_CDB = 0x08000000,
+ CAM_ARG_DEBUG_XPT = 0x10000000,
+ CAM_ARG_DEBUG_PERIPH = 0x20000000,
} cam_argmask;
struct camcontrol_opts {
@@ -138,7 +140,7 @@ struct camcontrol_opts option_table[] = {
{"tags", CAM_CMD_TAG, CAM_ARG_NONE, "N:q"},
{"negotiate", CAM_CMD_RATE, CAM_ARG_NONE, negotiate_opts},
{"rate", CAM_CMD_RATE, CAM_ARG_NONE, negotiate_opts},
- {"debug", CAM_CMD_DEBUG, CAM_ARG_NONE, "ITSc"},
+ {"debug", CAM_CMD_DEBUG, CAM_ARG_NONE, "IPTSXc"},
{"format", CAM_CMD_FORMAT, CAM_ARG_NONE, "qwy"},
#endif /* MINIMALISTIC */
{"help", CAM_CMD_USAGE, CAM_ARG_NONE, NULL},
@@ -2009,6 +2011,10 @@ camdebug(int argc, char **argv, char *combinedopt)
arglist |= CAM_ARG_DEBUG_INFO;
ccb.cdbg.flags |= CAM_DEBUG_INFO;
break;
+ case 'P':
+ arglist |= CAM_ARG_DEBUG_PERIPH;
+ ccb.cdbg.flags |= CAM_DEBUG_PERIPH;
+ break;
case 'S':
arglist |= CAM_ARG_DEBUG_SUBTRACE;
ccb.cdbg.flags |= CAM_DEBUG_SUBTRACE;
@@ -2017,6 +2023,10 @@ camdebug(int argc, char **argv, char *combinedopt)
arglist |= CAM_ARG_DEBUG_TRACE;
ccb.cdbg.flags |= CAM_DEBUG_TRACE;
break;
+ case 'X':
+ arglist |= CAM_ARG_DEBUG_XPT;
+ ccb.cdbg.flags |= CAM_DEBUG_XPT;
+ break;
case 'c':
arglist |= CAM_ARG_DEBUG_CDB;
ccb.cdbg.flags |= CAM_DEBUG_CDB;
@@ -2048,8 +2058,9 @@ camdebug(int argc, char **argv, char *combinedopt)
if (strncmp(tstr, "off", 3) == 0) {
ccb.cdbg.flags = CAM_DEBUG_NONE;
- arglist &= ~(CAM_ARG_DEBUG_INFO|CAM_ARG_DEBUG_TRACE|
- CAM_ARG_DEBUG_SUBTRACE);
+ arglist &= ~(CAM_ARG_DEBUG_INFO|CAM_ARG_DEBUG_PERIPH|
+ CAM_ARG_DEBUG_TRACE|CAM_ARG_DEBUG_SUBTRACE|
+ CAM_ARG_DEBUG_XPT);
} else if (strncmp(tstr, "all", 3) != 0) {
tmpstr = (char *)strtok(tstr, ":");
if ((tmpstr != NULL) && (*tmpstr != '\0')){
@@ -3148,7 +3159,8 @@ usage(int verbose)
" [-P pagectl][-e | -b][-d]\n"
" camcontrol cmd [dev_id][generic args] <-c cmd [args]>\n"
" [-i len fmt|-o len fmt [args]]\n"
-" camcontrol debug [-I][-T][-S][-c] <all|bus[:target[:lun]]|off>\n"
+" camcontrol debug [-I][-P][-T][-S][-X][-c]\n"
+" <all|bus[:target[:lun]]|off>\n"
" camcontrol tags [dev_id][generic args] [-N tags] [-q] [-v]\n"
" camcontrol negotiate [dev_id][generic args] [-a][-c]\n"
" [-D <enable|disable>][-O offset][-q]\n"
OpenPOWER on IntegriCloud