• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Examining kernel thread state at run-time
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Examining kernel thread state at run-time


  • Subject: Re: Examining kernel thread state at run-time
  • From: Sam Vaughan <email@hidden>
  • Date: Thu, 8 Feb 2007 10:35:38 +1100

On 08/02/2007, at 7:03 AM, Allen Briggs <email@hidden> wrote:

I'm working on a port of a driver to OS X 10.4.  This driver has
several threads in it and several different locked regions.  I
would like to examine the state of the threads at run-time from
an application--just to see which thread might be blocked on which
IOLock (or something else).  Is it possible to do this without
resorting to kgdb?

In BSD, I'm used to using ps to show the "wait channel" for a
process/thread.  But 'ps' in OS X just shows '-' for everyone.
I've also looked at 'top' and Activity Monitor to no avail.

Any suggestions?

Hi Allen,

I wrote some code to do this on 10.3 by walking the thread list and manually generating backtraces. It was never going to work through the KPIs on 10.4 and I didn't ever get around to porting it.

I remember being told by an Apple engineer quite some time back that there was an internal tool that only worked on Intel that did just this. I asked about it at WWDC last year and was told to look for "stackshot". I distinctly remember the guy suggesting I "man stackshot". Now that I try it I can't find it, so hopefully someone can reply with more details.

Being able to get run-time backtraces of all your kernel threads is _really_ useful.

Sam
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Examining kernel thread state at run-time
      • From: Quinn <email@hidden>
  • Prev by Date: Re: Sleeping in nanos
  • Next by Date: Re: Sleeping in nanos
  • Previous by thread: Examining kernel thread state at run-time
  • Next by thread: Re: Examining kernel thread state at run-time
  • Index(es):
    • Date
    • Thread