[Crash-utility] [PATCH v2 02/10] introduce the LOCAL_ACTIVE() helper

Oleg Nesterov oleg at redhat.com
Fri Apr 29 16:22:23 UTC 2016


Add the new simple helper, LOCAL_ACTIVE(). True if crash examines the live kernel
on the same machine.

Signed-off-by: Oleg Nesterov <oleg at redhat.com>
---
 defs.h    | 1 +
 filesys.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/defs.h b/defs.h
index cc5db51..f31d7f6 100644
--- a/defs.h
+++ b/defs.h
@@ -250,6 +250,7 @@ struct number_option {
 #define PROC_KCORE   (0x8000000000000000ULL)
 
 #define ACTIVE()            (pc->flags & LIVE_SYSTEM)
+#define LOCAL_ACTIVE()      ((pc->flags & LIVE_SYSTEM) && (pc->flags2 & MEMSRC_LOCAL))
 #define DUMPFILE()          (!(pc->flags & LIVE_SYSTEM))
 #define LIVE()              (pc->flags2 & LIVE_DUMP || pc->flags & LIVE_SYSTEM)
 #define MEMORY_SOURCES (NETDUMP|KDUMP|MCLXCD|LKCD|DEVMEM|S390D|MEMMOD|DISKDUMP|XENDUMP|CRASHBUILTIN|KVMDUMP|PROC_KCORE|SADUMP|VMWARE_VMSS)
diff --git a/filesys.c b/filesys.c
index f05a8cd..9ea8f7e 100644
--- a/filesys.c
+++ b/filesys.c
@@ -124,6 +124,7 @@ fd_init(void)
 	
 		if (!pc->dumpfile) {
 			pc->flags |= LIVE_SYSTEM;
+			pc->flags2 |= MEMSRC_LOCAL;
 			get_live_memory_source();
 		}
 	
-- 
2.5.0




More information about the Crash-utility mailing list