X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lnet%2Futils%2Fdebug.c;h=857be97cdc084151c54ff1b8e132be1be9f47760;hb=8483950e2edce4eee194f44f99da09fc839de3a2;hp=16186ee66f1b5b788ba36b6af4bea9ce7100f6d5;hpb=314eba9db4e70a4c4131d96bbbc76a8ccc6d0b0d;p=fs%2Flustre-release.git diff --git a/lnet/utils/debug.c b/lnet/utils/debug.c index 16186ee..857be97 100644 --- a/lnet/utils/debug.c +++ b/lnet/utils/debug.c @@ -32,6 +32,12 @@ #endif #include #include +#ifdef HAVE_SYS_IOCTL_H +#include +#endif +#ifndef _IOWR +#include "ioctl.h" +#endif #include #include #include @@ -41,7 +47,6 @@ #include #include #include - #include #include @@ -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; @@ -270,7 +275,7 @@ static void print_saved_records(struct list_head *list, FILE *out) list_del(&line->chain); hdr = line->hdr; - fprintf(out, "%06x:%06x:%u:%u.%06Lu:%u:%u:%u:(%s:%u:%s()) %s", + fprintf(out, "%07x:%06x:%u:%u.%06Lu:%u:%u:%u:(%s:%u:%s()) %s", hdr->ph_subsys, hdr->ph_mask, hdr->ph_cpu_id, hdr->ph_sec, (unsigned long long)hdr->ph_usec, hdr->ph_stack, hdr->ph_pid, hdr->ph_extern_pid, @@ -666,6 +671,10 @@ static struct mod_paths { {"lvfs", "lustre/lvfs"}, {"obdclass", "lustre/obdclass"}, {"llog_test", "lustre/obdclass"}, + {"ptlrpcs", "lustre/sec"}, + {"ptlrpcs_gss", "lustre/sec/gss"}, + {"gks", "lustre/sec/gks"}, + {"gkc", "lustre/sec/gks"}, {"ptlrpc", "lustre/ptlrpc"}, {"obdext2", "lustre/obdext2"}, {"ost", "lustre/ost"}, @@ -703,7 +712,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) @@ -715,6 +724,7 @@ static int jt_dbg_modules_2_4(int argc, char **argv) return 0; } + printf("dir\n"); for (mp = mod_paths; mp->name != NULL; mp++) { struct module_info info; int rc; @@ -729,22 +739,24 @@ 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)); + printf("dir %s%s%s\n", path, + path[0] ? "/" : "", mp->path); } } 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]; @@ -767,6 +779,7 @@ static int jt_dbg_modules_2_5(int argc, char **argv) return 0; } + printf("dir\n"); while ((rc = fscanf(file, "%s %s %s %s %s %lx\n", modname, others, others, others, others, &modaddr)) == 6) { for (mp = mod_paths; mp->name != NULL; mp++) { @@ -774,8 +787,10 @@ 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); + printf("dir %s%s%s\n", path, + path[0] ? "/" : "", mp->path); } }