[Crash-utility] [PATCH v2 7/7] Add support for non-live remote.

Don Slutz dslutz at verizon.com
Wed Nov 20 01:33:43 UTC 2013


From: Don Slutz <dslutz at 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 at verizon.com>
---
 kernel.c |  3 +++
 memory.c |  2 +-
 remote.c | 11 ++++++++---
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/kernel.c b/kernel.c
index 9c181ee..822094a 100755
--- a/kernel.c
+++ b/kernel.c
@@ -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_PAUSED())
+			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 707e784..cf8da2c 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_PAUSED())
 		return remote_page_size();
 
 	switch (pc->flags & MEMORY_SOURCES)
diff --git a/remote.c b/remote.c
index 621942e..5dc88ad 100755
--- a/remote.c
+++ b/remote.c
@@ -1947,8 +1947,13 @@ is_remote_daemon(char *dp)
 	sprintf(sendbuf, "NIL");
 	remote_tcp_write_string(pc->sockfd, sendbuf);
 	remote_tcp_read_string(pc->sockfd, recvbuf, BUFSIZE-1, 0);
-	if (!strstr(recvbuf, "<FAIL>"))
+	if (!strstr(recvbuf, "<FAIL>")) {
 		rc->flags |= NIL_FLAG;
+		p1 = strtok(recvbuf, " ");  /* NIL */
+		p1 = strtok(NULL, " ");     /* remote type */
+		if (p1 && p1[0] != 'L')
+			pc->flags2 |= REM_PAUSED_F;
+	}
         /*
          *  Get the remote machine type and verify a match.  The daemon pid
          *  is also used as a live system initial context.
@@ -3212,6 +3217,8 @@ remote_page_size(void)
 
 	if (REMOTE_ACTIVE())
         	sprintf(sendbuf, "PAGESIZE LIVE");
+	else if (REMOTE_PAUSED())
+		sprintf(sendbuf, "PAGESIZE NIL");
 	else if (pc->flags & REM_NETDUMP)
         	sprintf(sendbuf, "PAGESIZE NETDUMP");
 	else if (pc->flags & REM_MCLXCD)
@@ -3242,8 +3249,6 @@ remote_page_size(void)
         if (p2) {
                 strncpy(rc->remote_type, p2, sizeof(rc->remote_type) - 1);
                 rc->remote_type[sizeof(rc->remote_type) - 1] = 0;
-		if (rc->remote_type[0] != 'L')
-			pc->flags2 |= REM_PAUSED_F;
         }
         if (p3)
                 rc->n_cpus = atoi(p3);
-- 
1.8.4




More information about the Crash-utility mailing list