From owner-freebsd-questions@FreeBSD.ORG Thu Jun 25 06:24:54 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C8DD1065670 for ; Thu, 25 Jun 2009 06:24:54 +0000 (UTC) (envelope-from mel.flynn+fbsd.questions@mailing.thruhere.net) Received: from mailhub.rachie.is-a-geek.net (rachie.is-a-geek.net [66.230.99.27]) by mx1.freebsd.org (Postfix) with ESMTP id DFAA08FC18 for ; Thu, 25 Jun 2009 06:24:53 +0000 (UTC) (envelope-from mel.flynn+fbsd.questions@mailing.thruhere.net) Received: from smoochies.rachie.is-a-geek.net (mailhub.lan.rachie.is-a-geek.net [192.168.2.11]) by mailhub.rachie.is-a-geek.net (Postfix) with ESMTP id C13177E837; Wed, 24 Jun 2009 22:24:52 -0800 (AKDT) From: Mel Flynn To: freebsd-questions@freebsd.org Date: Wed, 24 Jun 2009 22:24:51 -0800 User-Agent: KMail/1.11.4 (FreeBSD/8.0-CURRENT; KDE/4.2.4; i386; ; ) References: <70C0964126D66F458E688618E1CD008A0793F0AC@WADPEXV0.waddell.com> In-Reply-To: <70C0964126D66F458E688618E1CD008A0793F0AC@WADPEXV0.waddell.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200906242224.51785.mel.flynn+fbsd.questions@mailing.thruhere.net> Cc: Gary Gatten Subject: Re: Isolating high cpu load at function level X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jun 2009 06:24:54 -0000 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 information. libwp[1] has some support for reporting that you could extend with values you're interested in. [1] http://www.garypennington.net/libwp/docs/html/ -- Mel