Whamcloud - gitweb
b=5667
[fs/lustre-release.git] / lnet / utils / debug.c
index 16186ee..418fdbc 100644 (file)
 #endif
 #include <stdlib.h>
 #include <string.h>
+#ifdef HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
+#endif
+#ifndef _IOWR
+#include "ioctl.h"
+#endif
 #include <fcntl.h>
 #include <errno.h>
 #include <unistd.h>
@@ -41,7 +47,6 @@
 #include <sys/ioctl.h>
 #include <sys/stat.h>
 #include <sys/mman.h>
-
 #include <sys/utsname.h>
 
 #include <portals/api-support.h>
@@ -67,7 +72,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 +80,7 @@ static const char *portal_debug_masks[] =
          "other", "dentry", "portals", "page", 
          "dlmtrace", "error", "emerg", "ha", 
          "rpctrace", "vfstrace", "reada", "mmap",
-         "config", "console", NULL};
+         "config", "console", "quota", "sec", NULL};
 
 struct debug_daemon_cmd {
         char *cmd;
@@ -666,6 +671,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"},
@@ -703,7 +710,7 @@ static int jt_dbg_modules_2_4(int argc, char **argv)
 #ifdef HAVE_LINUX_VERSION_H
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
         struct mod_paths *mp;
-        char *path = "..";
+        char *path = "";
         char *kernel = "linux";
 
         if (argc >= 2)
@@ -729,22 +736,22 @@ static int jt_dbg_modules_2_4(int argc, char **argv)
                                 printf("query_module(%s) failed: %s\n",
                                        mp->name, strerror(errno));
                 } else {
-                        printf("add-symbol-file %s/%s/%s.o 0x%0lx\n", path,
-                               mp->path, mp->name,
+                        printf("add-symbol-file %s%s%s/%s.o 0x%0lx\n", path,
+                               path[0] ? "/" : "", mp->path, mp->name,
                                info.addr + sizeof(struct module));
                 }
         }
 
         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;
 }
 
 static int jt_dbg_modules_2_5(int argc, char **argv)
 {
         struct mod_paths *mp;
-        char *path = "..";
+        char *path = "";
         char *kernel = "linux";
         const char *proc = "/proc/modules";
         char modname[128], others[128];
@@ -774,8 +781,8 @@ static int jt_dbg_modules_2_5(int argc, char **argv)
                                 break;
                 }
                 if (mp->name) {
-                        printf("add-symbol-file %s/%s/%s.o 0x%0lx\n", path,
-                               mp->path, mp->name, modaddr);
+                        printf("add-symbol-file %s%s%s/%s.o 0x%0lx\n", path,
+                               path[0] ? "/" : "", mp->path, mp->name, modaddr);
                 }
         }