From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 9 21:25:15 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 419C110656B2 for ; Fri, 9 Oct 2009 21:25:15 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-bw0-f223.google.com (mail-bw0-f223.google.com [209.85.218.223]) by mx1.freebsd.org (Postfix) with ESMTP id 88CA68FC12 for ; Fri, 9 Oct 2009 21:25:14 +0000 (UTC) Received: by bwz23 with SMTP id 23so921802bwz.43 for ; Fri, 09 Oct 2009 14:25:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:to:cc:subject:references :organization:from:date:in-reply-to:message-id:user-agent :mime-version:content-type; bh=wQo9LcnMSRfxSZwdIsshiPGzMUTy98plBygVYXftdcQ=; b=Ht13z/ZHwHEZcHrElnr5lH6lTH7xEuph1D75rVAVLqfWmi2uUti7Wr05kO8C3OvLzk UgL+j92rprvkTvjXpo9NFxH0X83P18bdjnWfCqtY6rBHrTZnq7n9nxgYzmJWk1m+quCh pr56m4W2UfvNpBvEoXoNjs80lRwAoaYlaFgCs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=to:cc:subject:references:organization:from:date:in-reply-to :message-id:user-agent:mime-version:content-type; b=c9UimtYffPutxcHQxMEDHVHYE4z0e7/tcY9VXiYXV7Z01c8n9rxYX1OnipR+Ei9idv xLtCle7+i34gjVb+IaEP4jk+0jaKPA+akH/bEcDHD3C7TejuwjwOZ09KErVFIckVQvmo k1ksk/XdNalSQRlK/IHddXJMSurB+fXhqprC0= Received: by 10.204.25.152 with SMTP id z24mr2616928bkb.44.1255123512854; Fri, 09 Oct 2009 14:25:12 -0700 (PDT) Received: from localhost ([95.69.172.150]) by mx.google.com with ESMTPS id d13sm2376815fka.52.2009.10.09.14.25.11 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 09 Oct 2009 14:25:11 -0700 (PDT) To: John Baldwin References: <81ws3a1je1.fsf@zhuzha.ua1> <200910091128.11513.jhb@freebsd.org> Organization: TOA Ukraine From: Mikolaj Golub Date: Sat, 10 Oct 2009 00:25:09 +0300 In-Reply-To: <200910091128.11513.jhb@freebsd.org> (John Baldwin's message of "Fri\, 9 Oct 2009 11\:28\:11 -0400") Message-ID: <86r5tcmf9m.fsf@kopusha.onet> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: freebsd-hackers@freebsd.org, Robert Watson Subject: Re: crashinfo: print the content of ddb capture budder X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Oct 2009 21:25:15 -0000 On Fri, 9 Oct 2009 11:28:11 -0400 John Baldwin wrote: JB> On Monday 05 October 2009 1:48:06 am Mikolaj Golub wrote: >> Hi, >> >> It would be nice if crashinfo(8) were also trying to output the content of ddb >> capture buffer. Something like in this patch: >> >> --- crashinfo.sh.orig 2009-10-05 08:26:26.000000000 +0300 >> +++ crashinfo.sh 2009-10-05 08:43:56.000000000 +0300 >> @@ -304,3 +304,18 @@ >> echo "kernel config" >> echo >> config -x $KERNEL >> + >> +file=`mktemp /tmp/crashinfo.XXXXXX` >> +if [ $? -eq 0 ]; then >> + ddb capture -M $VMCORE -N $KERNEL print > $file 2>/dev/null >> + if [ -s $file ]; then >> + echo "------------------------------------------------------------------------" >> + echo "ddb capture buffer" >> + echo >> + cat $file | >> + sed -e 's/p\{10\}p*//' # XXX: this removes the unfilled part of a capture buffer >> + echo >> + fi >> + rm -f $file >> +fi >> + >> JB> I'm definitely in favor of this. I assume you have tested it locally? Do you have a sample JB> crash.X.txt file with it enabled? I have tested it on 8.0. zhuzha:~% ls -l /var/crash/vmcore.23 -rw------- 1 root wheel 166703104 2009-10-05 08:03 /var/crash/vmcore.23 zhuzha:~% sudo crashinfo Writing crash summary to /var/crash/core.txt.23. zhuzha:~% grep -B5 -A30 'ddb capture buffer' /var/crash/core.txt.23 ------------------------------------------------------------------------ kernel config config: File /boot/kernel.old/kernel doesn't contain configuration file. Either unsupported, or not compiled with INCLUDE_CONFIG_FILE ------------------------------------------------------------------------ ddb capture buffer db:0:kdb.enter.panic> show pcpu cpuid = 0 dynamic pcpu = 0x68ee80 curthread = 0xc4a1ad80: pid 2276 "sysctl" curpcb = 0xe6d44d90 fpcurthread = none idlethread = 0xc4576900: pid 11 "idle: cpu0" APIC ID = 0 currentldt = 0x50 spin locks held: db:0:kdb.enter.panic> show allpcpu Current CPU: 0 cpuid = 0 dynamic pcpu = 0x68ee80 curthread = 0xc4a1ad80: pid 2276 "sysctl" curpcb = 0xe6d44d90 fpcurthread = none idlethread = 0xc4576900: pid 11 "idle: cpu0" APIC ID = 0 currentldt = 0x50 spin locks held: cpuid = 1 dynamic pcpu = 0x34ffe80 curthread = 0xc5837480: pid 2191 "screen" curpcb = 0xe6e5ed90 fpcurthread = none idlethread = 0xc4576b40: pid 11 "idle: cpu1" zhuzha:~% tail /var/crash/core.txt.23 mi_switch(104,0,c0c798d3,1d6,44,...) at mi_switch+0x200 sleepq_switch(c0dc8190,0,c0c798d3,26e,0,...) at sleepq_switch+0x15f sleepq_timedwait(c0dc7ee0,44,c0c7793c,0,0,...) at sleepq_timedwait+0x6b _sleep(c0dc7ee0,0,44,c0c7793c,2710,...) at _sleep+0x339 scheduler(0,141ec00,141ec00,141e000,1425000,...) at scheduler+0x23e mi_startup() at mi_startup+0x96 begin() at begin+0x2c db:0:kdb.enter.panic> call doadump zhuzha:~% Actually the last echo in the patch looks like is not necessary. Do you want the whole crash.23.txt file for review? Also, I remember I tested it on crashdump of a kernel without ddb support and no issues were noticed too. -- Mikolaj Golub