Isolating high cpu load at function level

Mel Flynn mel.flynn+fbsd.questions at
Thu Jun 25 06:24:54 UTC 2009

On Wednesday 24 June 2009 07:42:06 Gary Gatten wrote:

> I have a process with several threads - the main "worker" threads
> typically use < 20% CPU - but after upgrading to a new version they're
> now using > 90% cpu.  I'm trying to determine what function these
> threads are performing that's requiring so much more cpu.  Is it bad
> code? I bug in a library I linked against?  What?
> I've tried gdb with list, info threads, info stack, bt full.  I can make
> sense of some of it.  I guess what I'm hoping for is something like
> "top" at the thread level, such that functions that thread perform are
> sorted highest util (time/whatever).

You'd typically turn on profiling, but sometimes less information is good, so 
you might be able to get the info you need by having your workers report the 

libwp[1] has some support for reporting that you could extend with values 
you're interested in.


More information about the freebsd-questions mailing list