From: David van Moolenbroek Date: Tue, 29 Dec 2009 21:35:12 +0000 (+0000) Subject: suppress kernel/VM memory debugging information X-Git-Tag: v3.1.6~127 X-Git-Url: http://zhaoyanbai.com/repos/?a=commitdiff_plain;h=ac9a5829a2339e7cebba48704d8e0373eac2baed;p=minix.git suppress kernel/VM memory debugging information --- diff --git a/kernel/arch/i386/memory.c b/kernel/arch/i386/memory.c index 330cb9338..7aafa6bf9 100644 --- a/kernel/arch/i386/memory.c +++ b/kernel/arch/i386/memory.c @@ -889,8 +889,10 @@ int vmcheck; /* if nonzero, can return VMSUSPEND */ vmassert(caller->p_vmrequest.vmresult != VMSUSPEND); RTS_LOCK_UNSET(caller, RTS_VMREQUEST); if(caller->p_vmrequest.vmresult != OK) { +#if DEBUG_VMASSERT printf("virtual_copy: returning VM error %d\n", caller->p_vmrequest.vmresult); +#endif NOREC_RETURN(virtualcopy, caller->p_vmrequest.vmresult); } } diff --git a/kernel/system/do_vmctl.c b/kernel/system/do_vmctl.c index 6f7f9f426..9ab157895 100644 --- a/kernel/system/do_vmctl.c +++ b/kernel/system/do_vmctl.c @@ -83,12 +83,11 @@ register message *m_ptr; /* pointer to request message */ target = proc_addr(proc_nr); p->p_vmrequest.vmresult = m_ptr->SVMCTL_VALUE; vmassert(p->p_vmrequest.vmresult != VMSUSPEND); +#if DEBUG_VMASSERT if(p->p_vmrequest.vmresult != OK) kprintf("SYSTEM: VM replied %d to mem request\n", p->p_vmrequest.vmresult); - -#if 0 printf("memreq reply: vm request sent by: %s / %d about %d; 0x%lx-0x%lx, wr %d, stack: %s ", p->p_name, p->p_endpoint, p->p_vmrequest.who, p->p_vmrequest.start, diff --git a/servers/vm/pagefaults.c b/servers/vm/pagefaults.c index c6ce4dd72..6c5fc4755 100644 --- a/servers/vm/pagefaults.c +++ b/servers/vm/pagefaults.c @@ -169,11 +169,15 @@ int handle_memory(struct vmproc *vmp, vir_bytes mem, vir_bytes len, int wrflag) while(len > 0) { int r; if(!(region = map_lookup(vmp, mem))) { +#if VERBOSE map_printmap(vmp); printf("VM: do_memory: memory doesn't exist\n"); +#endif r = EFAULT; } else if(!(region->flags & VR_WRITABLE) && wrflag) { +#if VERBOSE printf("VM: do_memory: write to unwritable map\n"); +#endif r = EFAULT; } else { vir_bytes offset, sublen; @@ -193,9 +197,11 @@ int handle_memory(struct vmproc *vmp, vir_bytes mem, vir_bytes len, int wrflag) } if(r != OK) { +#if VERBOSE printf("VM: memory range 0x%lx-0x%lx not available in %d\n", arch_map2vir(vmp, mem), arch_map2vir(vmp, mem+len), vmp->vm_endpoint); +#endif return r; } } diff --git a/servers/vm/vm.h b/servers/vm/vm.h index c29610c5b..71298e389 100644 --- a/servers/vm/vm.h +++ b/servers/vm/vm.h @@ -18,6 +18,9 @@ #define SANITYCHECKS 0 #define VMSTATS 0 +/* How noisy are we supposed to be? */ +#define VERBOSE 0 + /* Minimum stack region size - 64MB. */ #define MINSTACKREGION (64*1024*1024)