-#define MAX_MARK_SIZE 100
-
-static const char *portal_debug_subsystems[] =
- {"undefined", "mdc", "mds", "osc", "ost", "class", "log", "llite",
- "rpc", "mgmt", "portals", "libcfs", "socknal", "qswnal", "pinger",
- "filter", "ptlbd", "echo", "ldlm", "lov", "gmnal", "router", "cobd",
- "ibnal", "lmv", "cmobd", "smfs", NULL};
-static const char *portal_debug_masks[] =
- {"trace", "inode", "super", "ext2", "malloc", "cache", "info", "ioctl",
- "blocks", "net", "warning", "buffs", "other", "dentry", "portals",
- "page", "dlmtrace", "error", "emerg", "ha", "rpctrace", "vfstrace",
- "reada", "mmap", NULL};
-
-struct debug_daemon_cmd {
- char *cmd;
- unsigned int cmdv;
-};
+#define MAX_MARK_SIZE 256
+
+static const char *libcfs_debug_subsystems[] =
+ {"undefined", "mdc", "mds", "osc",
+ "ost", "class", "log", "llite",
+ "rpc", "mgmt", "lnet", "lnd",
+ "pinger", "filter", "", "echo",
+ "ldlm", "lov", "lquota", "",
+ "", "", "", "lmv",
+ "", "sec", "gss", "",
+ "mgc", "mgs", "fid", "fld", NULL};
+static const char *libcfs_debug_masks[] =
+ {"trace", "inode", "super", "ext2",
+ "malloc", "cache", "info", "ioctl",
+ "neterror", "net", "warning", "buffs",
+ "other", "dentry", "nettrace", "page",
+ "dlmtrace", "error", "emerg", "ha",
+ "rpctrace", "vfstrace", "reada", "mmap",
+ "config", "console", "quota", "sec", NULL};
+
+#ifdef __linux__
+
+#define DAEMON_CTL_NAME "/proc/sys/lnet/daemon_file"
+#define SUBSYS_DEBUG_CTL_NAME "/proc/sys/lnet/subsystem_debug"
+#define DEBUG_CTL_NAME "/proc/sys/lnet/debug"
+#define DUMP_KERNEL_CTL_NAME "/proc/sys/lnet/dump_kernel"
+
+static int
+dbg_open_ctlhandle(const char *str)
+{
+ int fd;
+ fd = open(str, O_WRONLY);
+ if (fd < 0) {
+ fprintf(stderr, "open %s failed: %s\n", str,
+ strerror(errno));
+ return -1;
+ }
+ return fd;
+}