Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 06 Apr 2001 11:55:56 -0700 (PDT)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Boris Popov <bp@butya.kz>
Cc:        hackers@FreeBSD.org
Subject:   Re: New DDB commands
Message-ID:  <XFMail.010406115556.jhb@FreeBSD.org>
In-Reply-To: <Pine.BSF.4.21.0104061559100.43674-100000@lion.butya.kz>

next in thread | previous in thread | raw e-mail | index | archive | help

On 06-Apr-01 Boris Popov wrote:
> On Fri, 6 Apr 2001, John Baldwin wrote:
> 
>> I have two new ddb commands for the i386.  Porting them to other platforms
>> shouldn't be overly difficult.  Both of them are "show" commands.  The first
>> is
>> a 'show ptrace XX' command which displays a backtrace of the process with
>> the
>> decimal pid XX.  Since ddb always assumes any address (i.e. parameter) is in
>> hex, I had to do some funky shifting to make it more intuitive.  As a
>> result,
>> both 'show ptrace 15' and 'show ptrace 0x15' will give a backtrace for
>> process
>> 15.  If no pid is specified, then it acts just like 'show trace' and
>> displays
>> the current process' trace.
> 
>       Thats exactly what doctor ordered! This significantly simplifies
> amount of work needs to be done when there is a need to trace where
> process is hung.

If one can figure out where it is hung... :)

>> The second command is 'show pcpu xx' which displays some of the per-cpu data
>> for the cpu with the cpuid xx.  If an id is not specified, then the current
>> CPU's info is displayed.  Currently the only fields displayed are the cpuid,
>> curproc, curpcb, and npxproc fields.  In addition, if witness is compiled
>> into
>> the kernel, then a list of spinlocks held by the CPU in question is listed.
> 
>       Well, when I manage my kernel to boot with witness, spinlock list
> will be a big help.

Also, witness provides a command 'show locks' that lists all locks held by the
current process and the current cpu.  I think I may add a command 'show pinfo
xxx' that takes a pid and lists process information such as name, pid, locks
held, etc.

-- 

John Baldwin <jhb@FreeBSD.org> -- http://www.FreeBSD.org/~jhb/
PGP Key: http://www.baldwin.cx/~john/pgpkey.asc
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.010406115556.jhb>