From owner-freebsd-hackers@FreeBSD.ORG Mon Nov 26 14:55:41 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 13B4E1F5 for ; Mon, 26 Nov 2012 14:55:41 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-ie0-f182.google.com (mail-ie0-f182.google.com [209.85.223.182]) by mx1.freebsd.org (Postfix) with ESMTP id C8F708FC12 for ; Mon, 26 Nov 2012 14:55:40 +0000 (UTC) Received: by mail-ie0-f182.google.com with SMTP id s9so12609417iec.13 for ; Mon, 26 Nov 2012 06:55:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=m4i7/jAH8dvrKfCNA1lB/fI5S3Y6rkJEJLUefDqy978=; b=XZY5LpCLsBmpcuLgUmsUqH4/YUqCcwzVb7TN7YrLwXQU9TIdhw034Q3A4/dHxjKmg4 umSPBFFJCYMx/sGRUX217vWxunLnP/6ACsQ/s+EF+mskp6zucYpwv2q+tu6fUPKWl0uB OafRHuKjM53Af0fRfENKyuQqQYWSVJQ4fEX1elTRHw1tIlLVT+HwVFHCoTe5fKBzjpJk vzqXjAivygyK+/p/G1vCOtDWasr5F9G1ZUBAiULmT8uiVY7VzJmgiUR5440kmxLZ5lc2 w55H/9lPuM8++IXK6cu73l6xO+S9AxrFPyloqMWaS79elnN/biRSbLE2tHwb75sjz9RM 3noQ== MIME-Version: 1.0 Received: by 10.50.95.161 with SMTP id dl1mr14919875igb.0.1353941740235; Mon, 26 Nov 2012 06:55:40 -0800 (PST) Sender: carpeddiem@gmail.com Received: by 10.50.151.135 with HTTP; Mon, 26 Nov 2012 06:55:40 -0800 (PST) In-Reply-To: <1353910892.62730.YahooMailClassic@web181702.mail.ne1.yahoo.com> References: <1353910892.62730.YahooMailClassic@web181702.mail.ne1.yahoo.com> Date: Mon, 26 Nov 2012 09:55:40 -0500 X-Google-Sender-Auth: T66q_OdtSFOg3-NF8zGm4yh3ty4 Message-ID: Subject: Re: Running kgdb in batch mode. From: Ed Maste To: Sushanth Rai Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 14:55:41 -0000 On 26 November 2012 01:21, Sushanth Rai wrote: > Basically I would like to get kernel backtrace of a bunch of threads from= the live kernel under some conditions. When the condition is seen I would = like to run kgdb, collect kernel backtrace of specific threads and exit. Is= there a way run kgdb in batch mode ? Or any other way to get the stack tra= ce. Have a look at /usr/sbin/crashinfo for an example of how to do so - basically just run kgdb $KERNEL $VMCORE < commands_file. -Ed