#define __USE_FILE_OFFSET64
#define _GNU_SOURCE
-#include <portals/list.h>
-
#include <stdio.h>
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif
#include <stdlib.h>
#include <string.h>
+#ifdef HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
+#else
#include "ioctl.h"
+#endif
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>
-#ifndef __CYGWIN__
-# include <syscall.h>
-#endif
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/mman.h>
-
-#ifdef HAVE_LINUX_VERSION_H
-#include <linux/version.h>
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
-#define BUG() /* workaround for module.h includes */
-#include <linux/module.h>
-#endif
-#endif /* !HAVE_LINUX_VERSION_H */
-
#include <sys/utsname.h>
#include <portals/api-support.h>
#include <portals/ptlctl.h>
+#include <libcfs/portals_utils.h>
#include "parser.h"
#include <time.h>
"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",
"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;
unsigned long dropped = 0, kept = 0;
struct list_head chunk_list;
- INIT_LIST_HEAD(&chunk_list);
+ CFS_INIT_LIST_HEAD(&chunk_list);
while (1) {
rc = fread(buf, sizeof(hdr->ph_len), 1, in);
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;
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));
}
}
- return parse_buffer(in, out);
+ rc = parse_buffer(in, out);
+
+ fclose(in);
+ if (out != stdout)
+ fclose(out);
+
+ return rc;
}
static int
{"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"},
#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)
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];
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);
}
}