From owner-freebsd-arch@FreeBSD.ORG Sat May 17 23:04:52 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6551B37B401 for ; Sat, 17 May 2003 23:04:52 -0700 (PDT) Received: from rootlabs.com (root.org [67.118.192.226]) by mx1.FreeBSD.org (Postfix) with SMTP id 0911643F85 for ; Sat, 17 May 2003 23:04:52 -0700 (PDT) (envelope-from nate@rootlabs.com) Received: (qmail 87929 invoked by uid 1000); 18 May 2003 06:04:54 -0000 Date: Sat, 17 May 2003 23:04:54 -0700 (PDT) From: Nate Lawson To: arch@freebsd.org Message-ID: <20030517230020.B87908@root.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: backtrace() not printing to kernel log X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 May 2003 06:04:52 -0000 I've found an annoyance when tracking down a new LoR. Since db_print_backtrace() uses db_printf() instead of printf(), the backtrace doesn't make it to the kernel buffer but is printed directly to the console. dmesg: lock order reversal 1st 0xc35d5098 vm object (vm object) @ /usr/src/sys/vm/vm_object.c:512 2nd 0xc082f110 system map (system map) @ /usr/src/sys/vm/vm_kern.c:325 Stack backtrace: I looked into how to fix this but couldn't come up with a good idea. The most obvious thing to do is use a function pointer and check if the debugger is active. If so, use db_printf(), otherwise use printf(). But there doesn't seem to be an architecturally clean way to do this. Ideas? -Nate