Whamcloud - gitweb
land portals part of b_hd_sec on HEAD.
[fs/lustre-release.git] / lnet / utils / debug.c
index 2931321..df78d08 100644 (file)
@@ -41,7 +41,6 @@
 #include <sys/ioctl.h>
 #include <sys/stat.h>
 #include <sys/mman.h>
-
 #include <sys/utsname.h>
 
 #include <portals/api-support.h>
@@ -67,7 +66,7 @@ static const char *portal_debug_subsystems[] =
          "pinger", "filter", "ptlbd", "echo", 
          "ldlm", "lov", "router", "cobd", 
          "sm", "asobd", "confobd", "lmv", 
-         "cmobd", NULL};
+         "cmobd", "sec", NULL};
 static const char *portal_debug_masks[] =
         {"trace", "inode", "super", "ext2", 
          "malloc", "cache", "info", "ioctl",
@@ -75,7 +74,7 @@ static const char *portal_debug_masks[] =
          "other", "dentry", "portals", "page", 
          "dlmtrace", "error", "emerg", "ha", 
          "rpctrace", "vfstrace", "reada", "mmap",
-         "config", NULL};
+         "config", "console", "quota", "sec", NULL};
 
 struct debug_daemon_cmd {
         char *cmd;
@@ -446,8 +445,12 @@ int jt_dbg_debug_kernel(int argc, char **argv)
 
 int jt_dbg_debug_file(int argc, char **argv)
 {
-        int fdin,fdout;
-        FILE *in, *out = stdout;
+        int    fdin;
+        int    fdout;
+        FILE  *in;
+        FILE  *out = stdout;
+        int    rc;
+
         if (argc > 3 || argc < 2) {
                 fprintf(stderr, "usage: %s <input> [output]\n", argv[0]);
                 return 0;
@@ -467,7 +470,9 @@ int jt_dbg_debug_file(int argc, char **argv)
                 return 1;
         }
         if (argc > 2) {
-                fdout = open(argv[2], O_CREAT | O_WRONLY | O_LARGEFILE);
+                fdout = open(argv[2], 
+                             O_CREAT | O_TRUNC | O_WRONLY | O_LARGEFILE, 
+                             0600);
                 if (fdout == -1) {
                         fprintf(stderr, "open(%s) failed: %s\n", argv[2],
                                 strerror(errno));
@@ -484,7 +489,13 @@ int jt_dbg_debug_file(int argc, char **argv)
                 }
         }
 
-        return parse_buffer(in, out);
+        rc = parse_buffer(in, out);
+
+        fclose(in);
+        if (out != stdout)
+                fclose(out);
+
+        return rc;
 }
 
 static int
@@ -654,6 +665,8 @@ static struct mod_paths {
         {"lvfs", "lustre/lvfs"},
         {"obdclass", "lustre/obdclass"},
         {"llog_test", "lustre/obdclass"},
+        {"ptlrpcs", "lustre/sec"},
+        {"ptlrpcs_gss", "lustre/sec/gss"},
         {"ptlrpc", "lustre/ptlrpc"},
         {"obdext2", "lustre/obdext2"},
         {"ost", "lustre/ost"},
@@ -724,8 +737,8 @@ static int jt_dbg_modules_2_4(int argc, char **argv)
         }
 
         return 0;
-#endif /* Headers are 2.6-only */
-#endif /* !HAVE_LINUX_VERSION_H */
+#endif // Headers are 2.6-only
+#endif // !HAVE_LINUX_VERSION_H
         return -EINVAL;
 }