From owner-svn-src-user@FreeBSD.ORG Thu Apr 8 06:42:20 2010 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38BAF106566B; Thu, 8 Apr 2010 06:42:20 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0DA288FC08; Thu, 8 Apr 2010 06:42:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o386gJBw040699; Thu, 8 Apr 2010 06:42:19 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o386gJSR040697; Thu, 8 Apr 2010 06:42:19 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201004080642.o386gJSR040697@svn.freebsd.org> From: Juli Mallett Date: Thu, 8 Apr 2010 06:42:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206391 - user/jmallett/octeon/sys/mips/mips X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Apr 2010 06:42:20 -0000 Author: jmallett Date: Thu Apr 8 06:42:19 2010 New Revision: 206391 URL: http://svn.freebsd.org/changeset/base/206391 Log: o) Print pointers in vm_fault tracing more nicely. o) Add a SYSCALL_TRACING mode which shows more human-readable syscall traces. XXX It'd be nice to just modify the ktrace hooks to have truss-like output to the kernel console if some option is set. o) When logging a bad page fault, log the PDE and PTE of the bad address as well as the pc at exception time. Modified: user/jmallett/octeon/sys/mips/mips/trap.c Modified: user/jmallett/octeon/sys/mips/mips/trap.c ============================================================================== --- user/jmallett/octeon/sys/mips/mips/trap.c Thu Apr 8 00:55:08 2010 (r206390) +++ user/jmallett/octeon/sys/mips/mips/trap.c Thu Apr 8 06:42:19 2010 (r206391) @@ -525,9 +525,9 @@ dofault: --p->p_lock; PROC_UNLOCK(p); #ifdef VMFAULT_TRACE - printf("vm_fault(%p (pmap %p), %x (%x), %x, %d) -> %x at pc %x\n", - map, &vm->vm_pmap, va, trapframe->badvaddr, ftype, VM_FAULT_NORMAL, - rv, trapframe->pc); + printf("vm_fault(%p (pmap %p), %p (%p), %x, %d) -> %x at pc %p\n", + map, &vm->vm_pmap, (void *)va, (void *)(intptr_t)trapframe->badvaddr, + ftype, VM_FAULT_NORMAL, rv, (void *)(intptr_t)trapframe->pc); #endif if (rv == KERN_SUCCESS) { @@ -729,6 +729,13 @@ dofault: printf("args[%d] = %#jx\n", i, (intmax_t)args[i]); } #endif +#ifdef SYSCALL_TRACING + printf("%s(", syscallnames[code]); + for (i = 0; i < nargs; i++) { + printf("%s%#jx", i == 0 ? "" : ", ", (intmax_t)args[i]); + } + printf(")\n"); +#endif #ifdef KTRACE if (KTRPOINT(td, KTR_SYSCALL)) ktrsyscall(code, nargs, args); @@ -1414,7 +1421,10 @@ log_bad_page_fault(char *msg, struct tra log(LOG_ERR, "pc address %#jx is inaccessible, pde = %p, pte = %#x\n", (intmax_t)pc, (void *)(intptr_t)*pdep, ptep ? *ptep : 0); } - /* panic("Bad trap");*/ + + get_mapping_info((vm_offset_t)frame->badvaddr, &pdep, &ptep); + log(LOG_ERR, "Page table info for bad address %#jx: pde = %p, pte = %#x\n", + (intmax_t)frame->badvaddr, (void *)(intptr_t)*pdep, ptep ? *ptep : 0); }