From owner-svn-src-all@FreeBSD.ORG Tue Sep 21 15:17:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B9B61065670; Tue, 21 Sep 2010 15:17:03 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id 1CDFE8FC12; Tue, 21 Sep 2010 15:17:02 +0000 (UTC) Received: by gxk8 with SMTP id 8so2091545gxk.13 for ; Tue, 21 Sep 2010 08:17:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=V2xc3q4X5C6vy8U1zbtLAnR8IigBbSsdBkoRvDQjmfM=; b=x62LCCJi6/KoB5I9SaeybeRTJWkRCOGfcD2vKgPnJLi2NnDbjeA64ZxOu5+VwX5upw goBLBoyIgq2umXcR4Wf+ZfFgkgevmlwSpJfWPXXaB9qv+kv/IG7kggnK5DS3bIRdeqhT i4H4RSYnnYkaJcseSm4sqkxOqgLGTR/kkRLsk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=J1CcG5bFpkhry1V93jDHU3t0CvYKlVVcH9DkUWisAbOEUW7zTcklTJ32nEfDelpd2r TL0ZDfgXKmGUwrY1KB648Up51WAUfgPHdael5ULitVoo4wNqqjgz7BtNLeCC0TkyLXjd d/uWnyw/nSxGvrVE+5Jcr5vqKNwiy00V06BUc= MIME-Version: 1.0 Received: by 10.100.42.13 with SMTP id p13mr11241781anp.54.1285082221776; Tue, 21 Sep 2010 08:17:01 -0700 (PDT) Sender: mdf356@gmail.com Received: by 10.231.187.71 with HTTP; Tue, 21 Sep 2010 08:17:01 -0700 (PDT) In-Reply-To: <201009211507.o8LF7iVv097676@svn.freebsd.org> References: <201009211507.o8LF7iVv097676@svn.freebsd.org> Date: Tue, 21 Sep 2010 08:17:01 -0700 X-Google-Sender-Auth: UQ1TutHYuhLihrRa0T4fJl2xZYk Message-ID: From: mdf@FreeBSD.org To: Andriy Gapon Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212964 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2010 15:17:03 -0000 On Tue, Sep 21, 2010 at 8:07 AM, Andriy Gapon wrote: > Author: avg > Date: Tue Sep 21 15:07:44 2010 > New Revision: 212964 > URL: http://svn.freebsd.org/changeset/base/212964 > > Log: > =A0kdb_backtrace: stack(9)-based code to print backtrace without any back= end > > =A0The idea is to add KDB and KDB_TRACE options to GENERIC kernels on > =A0stable branches, so that at least the minimal information is produced > =A0for non-specific panics like traps on page faults. > =A0The GENERICs in stable branches seem to already include STACK option. > > =A0Reviewed by: =A0attilio > =A0MFC after: =A0 =A02 weeks > > Modified: > =A0head/sys/kern/subr_kdb.c > > Modified: head/sys/kern/subr_kdb.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/kern/subr_kdb.c =A0 =A0Tue Sep 21 12:57:43 2010 =A0 =A0 =A0 = =A0(r212963) > +++ head/sys/kern/subr_kdb.c =A0 =A0Tue Sep 21 15:07:44 2010 =A0 =A0 =A0 = =A0(r212964) > @@ -28,6 +28,7 @@ > =A0__FBSDID("$FreeBSD$"); > > =A0#include "opt_kdb.h" > +#include "opt_stack.h" > > =A0#include > =A0#include > @@ -37,6 +38,7 @@ __FBSDID("$FreeBSD$"); > =A0#include > =A0#include > =A0#include > +#include > =A0#include > > =A0#include > @@ -300,6 +302,15 @@ kdb_backtrace(void) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0printf("KDB: stack backtrace:\n"); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0kdb_dbbe->dbbe_trace(); > =A0 =A0 =A0 =A0} > +#ifdef STACK > + =A0 =A0 =A0 else { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 struct stack st; > + > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 printf("KDB: stack backtrace:\n"); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 stack_save(&st); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 stack_print(&st); I'd recommend using stack_print_ddb(), as that avoids any locking which may hang depending on how the kernel panic'd. Thanks, matthew > + =A0 =A0 =A0 } > +#endif > =A0} > > =A0/* >