From: Jack Lange Date: Thu, 16 Oct 2008 21:37:15 +0000 (-0500) Subject: added more selective debugging directives X-Git-Tag: 1.0^2~47 X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=commitdiff_plain;h=c2e660b41f69c603b0c47f7c7572a22a2f601a51 added more selective debugging directives --- diff --git a/build/Makefile b/build/Makefile index cae3ceb..65a0aa3 100644 --- a/build/Makefile +++ b/build/Makefile @@ -168,6 +168,14 @@ DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_HALT=0 endif endif +ifeq ($(DEBUG_DEV_MGR),1) +DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_DEV_MGR=1 +else +ifeq ($(DEBUG_DEV_MGR),0) +DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_DEV_MGR=0 +endif +endif + # ---------------------------------------------------------------------- # Targets - @@ -187,6 +195,10 @@ palacios-full: (cd $(PALACIOS_BUILD_DIR) && make $(DEBUG_SECTIONS) world) +palacios-lean: + (cd $(PALACIOS_BUILD_DIR) && make LEAN_AND_MEAN=1 world) + + geekos: cp $(PALACIOS_BUILD_DIR)/libv3vee.a $(GEEKOS_BUILD_DIR)/palacios/ cp $(PALACIOS_BUILD_DIR)/../lib/xed/libxed.a $(GEEKOS_BUILD_DIR)/palacios/ @@ -203,6 +215,8 @@ geekos-full: world: palacios-full geekos-full +lean-and-mean: palacios-lean geekos-full + # make ready to boot over PXE diff --git a/palacios/build/Makefile b/palacios/build/Makefile index 51d0096..40593da 100644 --- a/palacios/build/Makefile +++ b/palacios/build/Makefile @@ -52,11 +52,18 @@ VPATH := $(PROJECT_ROOT)/src # DEBUG=1 means VMM_DEBUG, VMM_INFO, and VMM_TRACE are enabled # as are SERIAL_PRINT_DEBUG # + +ifeq ($(LEAN_AND_MEAN),1) +DEBUG=0 +DEBUG_SECTIONS= +else DEBUG=1 DEBUG_SECTIONS= +endif + ifeq ($(DEBUG_ALL),1) - DEBUG_SECTIONS:= $(DEBUG_SECTIONS) -DDEBUG_SHADOW_PAGING -DDEBUG_CTRL_REGS -DDEBUG_INTERRUPTS -DDEBUG_IO -DDEBUG_KEYBOARD -DDEBUG_PIC -DDEBUG_PIT -DDEBUG_NVRAM -DDEBUG_EMULATOR -DDEBUG_GENERIC -DDEBUG_RAMDISK + DEBUG_SECTIONS:= $(DEBUG_SECTIONS) -DDEBUG_SHADOW_PAGING -DDEBUG_CTRL_REGS -DDEBUG_INTERRUPTS -DDEBUG_IO -DDEBUG_KEYBOARD -DDEBUG_PIC -DDEBUG_PIT -DDEBUG_NVRAM -DDEBUG_EMULATOR -DDEBUG_GENERIC -DDEBUG_RAMDISK -DDEBUG_XED -DDEBUG_HALT -DDEBUG_DEV_MGR endif ifeq ($(DEBUG_SHADOW_PAGING),1) @@ -171,14 +178,20 @@ DEBUG_SECTIONS := $(DEBUG_SECTIONS) -UDEBUG_HALT endif endif +ifeq ($(DEBUG_DEV_MGR),1) +DEBUG_SECTIONS := $(DEBUG_SECTIONS) -DDEBUG_DEV_MGR +else +ifeq ($(DEBUG_DEV_MGR),0) +DEBUG_SECTIONS := $(DEBUG_SECTIONS) -UDEBUG_DEV_MGR +endif +endif #DEBUG_SECTIONS := $(DEBUG_SECTIONS) -DTEST_NE2K ifeq ($(DEBUG),1) - JRLDEBUG= -DSERIAL_PRINT_DEBUG=1 -DSERIAL_PRINT_DEBUG_LEVEL=10 -DSERIAL_PRINT=1 -DVMM_DEBUG=1 -DVMM_INFO=1 -DVMM_TRACE=1 $(DEBUG_SECTIONS) - + JRLDEBUG= -DVMM_DEBUG -DVMM_INFO -DVMM_TRACE $(DEBUG_SECTIONS) else - JRLDEBUG= -DSERIAL_PRINT_DEBUG=0 -DSERIAL_PRINT_DEBUG_LEVEL=999999 -DSERIAL_PRINT=0 -DVMM_DEBUG=0 -DVMM_INFO=0 -DVMM_TRACE=0 + endif diff --git a/palacios/include/palacios/vmm.h b/palacios/include/palacios/vmm.h index ecad47f..ebd0d90 100644 --- a/palacios/include/palacios/vmm.h +++ b/palacios/include/palacios/vmm.h @@ -34,7 +34,7 @@ /* utility definitions */ -#if VMM_DEBUG +#ifdef VMM_DEBUG #define PrintDebug(fmt, args...) \ do { \ extern struct vmm_os_hooks * os_hooks; \ @@ -58,7 +58,7 @@ -#if VMM_INFO +#ifdef VMM_INFO #define PrintInfo(fmt, args...) \ do { \ extern struct vmm_os_hooks * os_hooks; \ @@ -71,7 +71,7 @@ #endif -#if VMM_TRACE +#ifdef VMM_TRACE #define PrintTrace(fmt, args...) \ do { \ extern struct vmm_os_hooks * os_hooks; \ diff --git a/palacios/src/devices/ramdisk.c b/palacios/src/devices/ramdisk.c index 1eef6d6..0ae7d0a 100644 --- a/palacios/src/devices/ramdisk.c +++ b/palacios/src/devices/ramdisk.c @@ -1361,7 +1361,7 @@ static void rd_raise_interrupt(struct vm_device * dev, struct channel_t * channe v3_raise_irq(dev->vm, channel->irq); } else { - PrintError("\t\tRaising irq but irq is disabled\n"); + PrintDebug("\t\tRaising irq but irq is disabled\n"); } return; diff --git a/palacios/src/palacios/svm_handler.c b/palacios/src/palacios/svm_handler.c index 159cb53..74c397c 100644 --- a/palacios/src/palacios/svm_handler.c +++ b/palacios/src/palacios/svm_handler.c @@ -236,7 +236,9 @@ int handle_svm_exit(struct guest_info * info) { break; case VMEXIT_HLT: { +#ifdef DEBUG_HALT PrintDebug("Guest halted\n"); +#endif if (handle_svm_halt(info) == -1) { return -1; } @@ -244,7 +246,7 @@ int handle_svm_exit(struct guest_info * info) { break; case VMEXIT_PAUSE: { - PrintDebug("Guest paused\n"); + //PrintDebug("Guest paused\n"); if (handle_svm_pause(info) == -1) { return -1; } diff --git a/palacios/src/palacios/vmm_dev_mgr.c b/palacios/src/palacios/vmm_dev_mgr.c index 258e858..df66d27 100644 --- a/palacios/src/palacios/vmm_dev_mgr.c +++ b/palacios/src/palacios/vmm_dev_mgr.c @@ -24,11 +24,13 @@ #include - -#ifndef NULL -#define NULL 0 +#ifndef DEBUG_DEV_MGR +#undef PrintDebug +#define PrintDebug(fmt, args...) #endif + + int dev_mgr_init(struct guest_info * info) { struct vmm_dev_mgr * mgr = &(info->dev_mgr); INIT_LIST_HEAD(&(mgr->dev_list)); @@ -264,6 +266,7 @@ int dev_mgr_unhook_mem(struct vm_device *dev, +#ifdef DEBUG_DEV_MGR void PrintDebugDevMgr(struct guest_info * info) { struct vmm_dev_mgr * mgr = &(info->dev_mgr); @@ -300,3 +303,10 @@ void PrintDebugDevIO(struct vm_device * dev) { return; } + +#else +void PrintDebugDevMgr(struct guest_info * info) {} +void PrintDebugDev(struct vm_device * dev) {} +void PrintDebugDevMgrIO(struct vmm_dev_mgr * mgr) {} +void PrintDebugDevIO(struct vm_device * dev) {} +#endif