From: Don Slutz <dslutz(a)verizon.com>
This is accessed via:
crash localhost:5991,/dev/xenmem /usr/lib/debug/lib/modules/2.6.18-128.el5/vmlinux
Signed-off-by: Don Slutz <dslutz(a)verizon.com>
---
defs.h | 3 ++-
kernel.c | 5 ++++-
memory.c | 2 +-
remote.c | 44 +++++++++++++++++++++++---------------------
4 files changed, 30 insertions(+), 24 deletions(-)
diff --git a/defs.h b/defs.h
index 7a77dab..d964e33 100755
--- a/defs.h
+++ b/defs.h
@@ -504,7 +504,8 @@ struct program_context {
#define GET_LOG (0x200ULL)
#define VMCOREINFO (0x400ULL)
#define ALLOW_FP (0x800ULL)
-#define REMOTE_NIL (0x1000ULL)
+#define REMOTE_NILF (0x1000ULL)
+#define REMOTE_NIL() (pc->flags2 & REMOTE_NILF)
char *cleanup;
char *namelist_orig;
char *namelist_debug_orig;
diff --git a/kernel.c b/kernel.c
index ab50361..02d3ca0 100755
--- a/kernel.c
+++ b/kernel.c
@@ -2489,7 +2489,7 @@ back_trace(struct bt_info *bt)
get_xendump_regs(bt, &eip, &esp);
else if (SADUMP_DUMPFILE())
get_sadump_regs(bt, &eip, &esp);
- else if (REMOTE_ACTIVE() && ((bt->task == tt->this_task) ||
is_task_active(bt->task))) {
+ else if (REMOTE_NIL() && ((bt->task == tt->this_task) ||
is_task_active(bt->task))) {
if (get_remote_regs(bt, &eip, &esp))
machdep->get_stack_frame(bt, &eip, &esp);
} else
@@ -4677,6 +4677,9 @@ display_sys_stats(void)
if (REMOTE_DUMPFILE())
fprintf(fp, "%s@%s (remote dumpfile)",
pc->server_memsrc, pc->server);
+ else if (REMOTE_NIL())
+ fprintf(fp, "%s@%s (remote paused system)\n",
+ pc->server_memsrc, pc->server);
else {
if (dumpfile_is_split())
show_split_dumpfiles();
diff --git a/memory.c b/memory.c
index d995f4d..9b76c9f 100755
--- a/memory.c
+++ b/memory.c
@@ -14903,7 +14903,7 @@ memory_page_size(void)
if (machdep->pagesize)
return machdep->pagesize;
- if (REMOTE_MEMSRC())
+ if (REMOTE_MEMSRC() || REMOTE_NIL())
return remote_page_size();
switch (pc->flags & MEMORY_SOURCES)
diff --git a/remote.c b/remote.c
index 67e5ba8..c75a006 100755
--- a/remote.c
+++ b/remote.c
@@ -1943,7 +1943,7 @@ is_remote_daemon(char *dp)
remote_tcp_write_string(pc->sockfd, sendbuf);
remote_tcp_read_string(pc->sockfd, recvbuf, BUFSIZE-1, 0);
if (!strstr(recvbuf, "<FAIL>"))
- pc->flags2 |= REMOTE_NIL;
+ pc->flags2 |= REMOTE_NILF;
/*
* Get the remote machine type and verify a match. The daemon pid
* is also used as a live system initial context.
@@ -1952,7 +1952,7 @@ is_remote_daemon(char *dp)
BZERO(recvbuf, BUFSIZE);
sprintf(sendbuf, "MACHINE_PID");
remote_tcp_write_string(pc->sockfd, sendbuf);
- remote_tcp_read_string(pc->sockfd, recvbuf, BUFSIZE-1, pc->flags2 &
REMOTE_NIL);
+ remote_tcp_read_string(pc->sockfd, recvbuf, BUFSIZE-1, REMOTE_NIL());
p1 = strtok(recvbuf, " "); /* MACHINE */
p1 = strtok(NULL, " "); /* machine type */
if (CRASHDEBUG(1))
@@ -2056,7 +2056,7 @@ remote_file_type(char *file)
BZERO(recvbuf, BUFSIZE);
sprintf(sendbuf, "TYPE %s", file);
remote_tcp_write_string(pc->sockfd, sendbuf);
- remote_tcp_read_string(pc->sockfd, recvbuf, BUFSIZE-1, pc->flags2 &
REMOTE_NIL);
+ remote_tcp_read_string(pc->sockfd, recvbuf, BUFSIZE-1, REMOTE_NIL());
if (strstr(recvbuf, "<FAIL>"))
error(FATAL, "invalid remote file name: %s\n", file);
@@ -2226,7 +2226,7 @@ remote_file_open(struct remote_file *rfp)
BZERO(recvbuf, BUFSIZE);
sprintf(sendbuf, "OPEN %s", rfp->filename);
remote_tcp_write_string(pc->sockfd, sendbuf);
- remote_tcp_read_string(pc->sockfd, recvbuf, BUFSIZE-1, pc->flags2 &
REMOTE_NIL);
+ remote_tcp_read_string(pc->sockfd, recvbuf, BUFSIZE-1, REMOTE_NIL());
if (CRASHDEBUG(1))
fprintf(fp, "remote_file_open: [%s]\n", recvbuf);
@@ -2261,7 +2261,7 @@ remote_file_close(struct remote_file *rfp)
BZERO(recvbuf, BUFSIZE);
sprintf(sendbuf, "CLOSE %d", rfp->fd);
remote_tcp_write_string(pc->sockfd, sendbuf);
- remote_tcp_read_string(pc->sockfd, recvbuf, BUFSIZE-1, pc->flags2 &
REMOTE_NIL);
+ remote_tcp_read_string(pc->sockfd, recvbuf, BUFSIZE-1, REMOTE_NIL());
return (strstr(recvbuf, "OK") ? TRUE : FALSE);
}
@@ -2279,7 +2279,7 @@ remote_proc_version(char *buf)
BZERO(recvbuf, BUFSIZE);
sprintf(sendbuf, "PROC_VERSION");
remote_tcp_write_string(pc->sockfd, sendbuf);
- remote_tcp_read_string(pc->sockfd, recvbuf, BUFSIZE-1, pc->flags2 &
REMOTE_NIL);
+ remote_tcp_read_string(pc->sockfd, recvbuf, BUFSIZE-1, REMOTE_NIL());
if (STREQ(recvbuf, "<FAIL>")) {
buf[0] = 0;
return FALSE;
@@ -2360,7 +2360,7 @@ remote_vtop(int cpu, physaddr_t virt_addr)
BZERO(recvbuf, BUFSIZE);
sprintf(sendbuf, "VTOP %d %llx", cpu, virt_addr);
remote_tcp_write_string(pc->sockfd, sendbuf);
- remote_tcp_read_string(pc->sockfd, recvbuf, BUFSIZE-1, pc->flags2 &
REMOTE_NIL);
+ remote_tcp_read_string(pc->sockfd, recvbuf, BUFSIZE-1, REMOTE_NIL());
if (CRASHDEBUG(2))
fprintf(fp, "remote_vtop(%d,%llx): [%s]\n",
@@ -2404,7 +2404,7 @@ get_remote_regs(struct bt_info *bt, ulong *eip, ulong *esp)
sprintf(sendbuf, "FETCH_LIVE_IP_SP_BP %d", bt->tc->processor);
if (remote_tcp_write_string(pc->sockfd, sendbuf))
return 1;
- errflag = remote_tcp_read_string(pc->sockfd, recvbuf, BUFSIZE-1, pc->flags2 &
REMOTE_NIL);
+ errflag = remote_tcp_read_string(pc->sockfd, recvbuf, BUFSIZE-1, REMOTE_NIL());
if (errflag <= 0)
return 1;
@@ -2458,7 +2458,7 @@ get_remote_cr3(int cpu)
sprintf(sendbuf, "FETCH_LIVE_CR3 %d", cpu);
if (remote_tcp_write_string(pc->sockfd, sendbuf))
return 0;
- remote_tcp_read_string(pc->sockfd, recvbuf, BUFSIZE-1, pc->flags2 &
REMOTE_NIL);
+ remote_tcp_read_string(pc->sockfd, recvbuf, BUFSIZE-1, REMOTE_NIL());
if (CRASHDEBUG(1))
fprintf(fp, "get_remote_cr3: [%s]\n", recvbuf);
@@ -2652,7 +2652,7 @@ copy_to_local_namelist(struct remote_file *rfp)
BZERO(recvbuf, BUFSIZE);
sprintf(sendbuf, "DEBUGGING_SYMBOLS %s", rfp->filename);
remote_tcp_write_string(pc->sockfd, sendbuf);
- remote_tcp_read_string(pc->sockfd, recvbuf, BUFSIZE-1, pc->flags2 &
REMOTE_NIL);
+ remote_tcp_read_string(pc->sockfd, recvbuf, BUFSIZE-1, REMOTE_NIL());
if (strstr(recvbuf, "NO_DEBUG")) {
sprintf(readbuf, "%s@%s", rfp->filename, pc->server);
pc->namelist = readbuf;
@@ -2765,7 +2765,7 @@ identical_namelist(char *file, struct remote_file *rfp)
sprintf(sendbuf, "LINUX_VERSION %s", rfp->filename);
remote_tcp_write_string(pc->sockfd, sendbuf);
- remote_tcp_read_string(pc->sockfd, recvbuf, BUFSIZE-1, pc->flags2 &
REMOTE_NIL);
+ remote_tcp_read_string(pc->sockfd, recvbuf, BUFSIZE-1, REMOTE_NIL());
if (strstr(recvbuf, "<FAIL>"))
return FALSE;
@@ -2808,7 +2808,7 @@ remote_file_checksum(struct remote_file *rfp)
BZERO(recvbuf, BUFSIZE);
sprintf(sendbuf, "SUM %s", rfp->filename);
remote_tcp_write_string(pc->sockfd, sendbuf);
- remote_tcp_read_string(pc->sockfd, recvbuf, BUFSIZE-1, pc->flags2 &
REMOTE_NIL);
+ remote_tcp_read_string(pc->sockfd, recvbuf, BUFSIZE-1, REMOTE_NIL());
if (strstr(recvbuf, "<FAIL>")) {
error(INFO, "%s: does not exist on server %s\n",
rfp->filename, pc->server);
@@ -3078,7 +3078,7 @@ remote_find_booted_kernel(struct remote_file *rfp)
BZERO(recvbuf, BUFSIZE);
sprintf(sendbuf, "FIND_BOOTED_KERNEL");
remote_tcp_write_string(pc->sockfd, sendbuf);
- remote_tcp_read_string(pc->sockfd, recvbuf, BUFSIZE-1, pc->flags2 &
REMOTE_NIL);
+ remote_tcp_read_string(pc->sockfd, recvbuf, BUFSIZE-1, REMOTE_NIL());
strtok(recvbuf, " "); /* FIND_BOOTED_KERNEL */
p1 = strtok(NULL, " "); /* filename */
if (STREQ(p1, "<FAIL>"))
@@ -3099,7 +3099,7 @@ remote_lkcd_dump_init(void)
BZERO(recvbuf, BUFSIZE);
sprintf(sendbuf, "LKCD_DUMP_INIT %d %s", pc->rmfd,
pc->server_memsrc);
remote_tcp_write_string(pc->sockfd, sendbuf);
- remote_tcp_read_string(pc->sockfd, recvbuf, BUFSIZE-1, pc->flags2 &
REMOTE_NIL);
+ remote_tcp_read_string(pc->sockfd, recvbuf, BUFSIZE-1, REMOTE_NIL());
if (strstr(recvbuf, "<FAIL>"))
return FALSE;
@@ -3137,7 +3137,7 @@ remote_s390_dump_init(void)
BZERO(recvbuf, BUFSIZE);
sprintf(sendbuf, "S390_DUMP_INIT %d %s", pc->rmfd,
pc->server_memsrc);
remote_tcp_write_string(pc->sockfd, sendbuf);
- remote_tcp_read_string(pc->sockfd, recvbuf, BUFSIZE-1, pc->flags2 &
REMOTE_NIL);
+ remote_tcp_read_string(pc->sockfd, recvbuf, BUFSIZE-1, REMOTE_NIL());
if (strstr(recvbuf, "<FAIL>"))
return FALSE;
@@ -3173,7 +3173,7 @@ remote_netdump_init(void)
BZERO(recvbuf, BUFSIZE);
sprintf(sendbuf, "NETDUMP_INIT %d %s", pc->rmfd,
pc->server_memsrc);
remote_tcp_write_string(pc->sockfd, sendbuf);
- remote_tcp_read_string(pc->sockfd, recvbuf, BUFSIZE-1, pc->flags2 &
REMOTE_NIL);
+ remote_tcp_read_string(pc->sockfd, recvbuf, BUFSIZE-1, REMOTE_NIL());
if (strstr(recvbuf, "<FAIL>"))
return FALSE;
@@ -3205,6 +3205,8 @@ remote_page_size(void)
if (REMOTE_ACTIVE())
sprintf(sendbuf, "PAGESIZE LIVE");
+ else if (REMOTE_NIL())
+ sprintf(sendbuf, "PAGESIZE NIL");
else if (pc->flags & REM_NETDUMP)
sprintf(sendbuf, "PAGESIZE NETDUMP");
else if (pc->flags & REM_MCLXCD)
@@ -3218,7 +3220,7 @@ remote_page_size(void)
"cannot determine remote page size (unknown memory source)\n");
remote_tcp_write_string(pc->sockfd, sendbuf);
- remote_tcp_read_string(pc->sockfd, recvbuf, BUFSIZE-1, pc->flags2 &
REMOTE_NIL);
+ remote_tcp_read_string(pc->sockfd, recvbuf, BUFSIZE-1, REMOTE_NIL());
if (strstr(recvbuf, "FAIL"))
error(FATAL, "cannot determine remote page size\n");
strtok(recvbuf, " "); /* PAGESIZE */
@@ -3472,7 +3474,7 @@ find_remote_module_objfile(struct load_module *lm, char *module,
char *retbuf)
sprintf(sendbuf, "FIND_MODULE %s %s",
kt->utsname.release, module);
remote_tcp_write_string(pc->sockfd, sendbuf);
- remote_tcp_read_string(pc->sockfd, recvbuf, BUFSIZE-1, pc->flags2 &
REMOTE_NIL);
+ remote_tcp_read_string(pc->sockfd, recvbuf, BUFSIZE-1, REMOTE_NIL());
if (strstr(recvbuf, "<FAIL>")) {
fprintf(fp, "find_remote_module_objfile: [%s]\n",
recvbuf);
@@ -3533,7 +3535,7 @@ remote_free_memory(void)
BZERO(recvbuf, BUFSIZE);
sprintf(sendbuf, "MEMORY FREE %s", type);
remote_tcp_write_string(pc->sockfd, sendbuf);
- remote_tcp_read_string(pc->sockfd, recvbuf, BUFSIZE-1, pc->flags2 &
REMOTE_NIL);
+ remote_tcp_read_string(pc->sockfd, recvbuf, BUFSIZE-1, REMOTE_NIL());
p1 = strtok(recvbuf, " "); /* MEMORY */
p1 = strtok(NULL, " "); /* FREE */
p1 = strtok(NULL, " "); /* MCLXCD, LKCD etc. */
@@ -3569,7 +3571,7 @@ remote_memory_used(void)
BZERO(recvbuf, BUFSIZE);
sprintf(sendbuf, "MEMORY USED %s", type);
remote_tcp_write_string(pc->sockfd, sendbuf);
- remote_tcp_read_string(pc->sockfd, recvbuf, BUFSIZE-1, pc->flags2 &
REMOTE_NIL);
+ remote_tcp_read_string(pc->sockfd, recvbuf, BUFSIZE-1, REMOTE_NIL());
p1 = strtok(recvbuf, " "); /* MEMORY */
p1 = strtok(NULL, " "); /* FREE */
p1 = strtok(NULL, " "); /* MCLXCD, LKCD, etc. */
@@ -3868,7 +3870,7 @@ remote_exit(void)
/*
* Read but ignore the return status -- we don't really care...
*/
- remote_tcp_read_string(pc->sockfd, buf, BUFSIZE-1, pc->flags2 &
REMOTE_NIL);
+ remote_tcp_read_string(pc->sockfd, buf, BUFSIZE-1, REMOTE_NIL());
}
#endif /* !DAEMON */
--
1.8.4