From owner-freebsd-arch@FreeBSD.ORG Fri Jun 24 00:39:12 2005 Return-Path: X-Original-To: freebsd-arch@freebsd.org 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 4D06D16A420 for ; Fri, 24 Jun 2005 00:39:12 +0000 (GMT) (envelope-from howardsue@gmail.com) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id F162343D55 for ; Fri, 24 Jun 2005 00:39:11 +0000 (GMT) (envelope-from howardsue@gmail.com) Received: by wproxy.gmail.com with SMTP id 69so64183wri for ; Thu, 23 Jun 2005 17:39:11 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:references; b=aoopP2088fyvZtXfdtmB+U8ds2nkR4ybnXdT212K3R7xWngUbaPJN0oWUq59wxeVOjRkpAbETv/fYswf4gaiQKYWksbL570gjTJ049aIjw6ddayIomUa/3dOSx6CUMcpQzogEXQpzGDTlj2CmHyxe95HFztvtm6rz6wq7hgmHcY= Received: by 10.54.86.1 with SMTP id j1mr1477541wrb; Thu, 23 Jun 2005 17:39:10 -0700 (PDT) Received: by 10.54.124.4 with HTTP; Thu, 23 Jun 2005 17:39:04 -0700 (PDT) Message-ID: <1e89cd5105062317397399075e@mail.gmail.com> Date: Fri, 24 Jun 2005 08:39:04 +0800 From: Howard To: Marcel Moolenaar In-Reply-To: Mime-Version: 1.0 References: <20050623102024.GA89874@frontfree.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-arch@freebsd.org Subject: Re: How to get stack from every thread when doing crash dump? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Howard List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2005 00:39:12 -0000 2005/6/24, Marcel Moolenaar :=20 >=20 > On Jun 23, 2005, at 3:20 AM, Xin LI wrote: >=20 > > One problem with the mini-dump is that, since the mini-dump utilizes:= =20 > > dump_write((char *)curthread->td_kstack, curthread->td_kstack_pages * > > PAGE_SIZE); > > > > To write out the stack, and at the point before exception.S, curthread > > has > > been changed, we can only obtain the stack from the current thread,=20 > > which > > may not be enough for analyzing the backtrace. What can we do to > > improve > > this situation? >=20 > You can iterate over all the threads. Take a look at > src/sys/kern/subr_kdb.c=20 > or > src/gnu/usr.bin/gdb/kgdb/kthr.c >=20 > In particular: > Use the list of all processes (allproc) to iterate over the > processeses and for each process walk the list of threads > and for each thread dump the stack, registers and other data.=20 However is dumping the td_kstack_pages enough to get one thread's stack? W= e=20 found the stack is not completed. Thanks, =20 -- > Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net=20 >=20 >