From owner-freebsd-current@FreeBSD.ORG Sun Jan 28 12:39:03 2007 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5CDD716A401 for ; Sun, 28 Jan 2007 12:39:03 +0000 (UTC) (envelope-from rrs@cisco.com) Received: from sj-iport-2.cisco.com (sj-iport-2-in.cisco.com [171.71.176.71]) by mx1.freebsd.org (Postfix) with ESMTP id 371B113C48D for ; Sun, 28 Jan 2007 12:39:03 +0000 (UTC) (envelope-from rrs@cisco.com) Received: from sj-dkim-4.cisco.com ([171.71.179.196]) by sj-iport-2.cisco.com with ESMTP; 28 Jan 2007 04:39:02 -0800 X-IronPort-AV: i="4.13,247,1167638400"; d="scan'208"; a="358176997:sNHT55746656" Received: from sj-core-1.cisco.com (sj-core-1.cisco.com [171.71.177.237]) by sj-dkim-4.cisco.com (8.12.11/8.12.11) with ESMTP id l0SCd2FB015268 for ; Sun, 28 Jan 2007 04:39:02 -0800 Received: from xbh-sjc-231.amer.cisco.com (xbh-sjc-231.cisco.com [128.107.191.100]) by sj-core-1.cisco.com (8.12.10/8.12.6) with ESMTP id l0SCd2Dm014628 for ; Sun, 28 Jan 2007 04:39:02 -0800 (PST) Received: from xfe-sjc-212.amer.cisco.com ([171.70.151.187]) by xbh-sjc-231.amer.cisco.com with Microsoft SMTPSVC(6.0.3790.1830); Sun, 28 Jan 2007 04:39:01 -0800 Received: from [127.0.0.1] ([171.68.225.134]) by xfe-sjc-212.amer.cisco.com with Microsoft SMTPSVC(6.0.3790.1830); Sun, 28 Jan 2007 04:39:01 -0800 Message-ID: <45BC9943.9010300@cisco.com> Date: Sun, 28 Jan 2007 07:38:27 -0500 From: Randall Stewart User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.8) Gecko/20061029 FreeBSD/i386 SeaMonkey/1.0.6 MIME-Version: 1.0 To: current@freebsd.org References: <45A533F6.7030405@cisco.com> In-Reply-To: <45A533F6.7030405@cisco.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 28 Jan 2007 12:39:01.0497 (UTC) FILETIME=[49B03690:01C742D9] DKIM-Signature: v=0.5; a=rsa-sha256; q=dns/txt; l=1667; t=1169987942; x=1170851942; c=relaxed/simple; s=sjdkim4002; h=Content-Type:From:Subject:Content-Transfer-Encoding:MIME-Version; d=cisco.com; i=rrs@cisco.com; z=From:=20Randall=20Stewart=20 |Subject:=20Re=3A=20how=20to=20find=20out=20what=20the=20other=20CPU=20is =20doing |Sender:=20; bh=PBbKSSfIlIcOoXfTKljKpgQZDFBQsTtAGOrfQcE7n3E=; b=pgsrY2nglT33fs3BqNM5S498VjCiQxWPppg8PEiFAvaGzRqWykQGg3NxDHf5Ag/1qLQhSIGv /LSiVRtqig6Y8li9GA4f7zooPiHZ6/GP2oujmHkzfkb6b2nNIJv2Kc9J; Authentication-Results: sj-dkim-4; header.From=rrs@cisco.com; dkim=pass (sig from cisco.com/sjdkim4002 verified; ); Cc: Subject: Re: how to find out what the other CPU is doing X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jan 2007 12:39:03 -0000 All: Ok, I did not get an answer to this.. and of course I hit the bug again (which I now figured out how to fix :-D) So let me explain what I did.. so that way I can come back and find this email later when it someday happens again ;-) (and for anyone else curious). 1) I had to do this from DDB ... I could not find a way in kgdb. 2) When you stop the machine in ddb (at least in i386) it dumps BOTH CPU's info in something called stoppcbs[num-cpus] 3) Its an array of struct pcb .. which has all the info you need to get started. 4) With a trusty x/ stoppcbs you can work your way through and gather the info you need.. For x86 the second CPU started at stoppcbs+0x270 .. if you don't want to look at all those 0's (of course the offset could change and will vary from CPU type to CPU type :-D) 5) Dig out the ebp from here. You can look at the IP but it will be in some NMI stop CPU routine. 6) You can use the bp to trace backward through the stack and figure out the running stack trace... I went back to kgdb after getting the ebp (with CPU still spinning away). 7) You have to go several frames back to get by all the NMI stuff before you find your guilty party :-) There might be a better way to do this.. and I am thinking about adding a machine dependent trace that can take a ebp argument (if one does not already exist in kgdb.. I suppose I need to poke around in the macro's a bit).. anyway its primitive .. but it allows you to find that spinning kernel routine :-) R -- Randall Stewart NSSTG - Cisco Systems Inc. 803-345-0369 803-317-4952 (cell)