From owner-freebsd-hackers@freebsd.org Wed Aug 26 20:41:28 2015 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A164C9C39AC for ; Wed, 26 Aug 2015 20:41:28 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F059862; Wed, 26 Aug 2015 20:41:28 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1ZUhVd-000Cg5-RV; Wed, 26 Aug 2015 23:41:25 +0300 Date: Wed, 26 Aug 2015 23:41:25 +0300 From: Slawa Olhovchenkov To: Stanislav Sedov Cc: freebsd-hackers@FreeBSD.org Subject: Re: How to application sample profiling? Message-ID: <20150826204125.GK21849@zxy.spb.ru> References: <20150823221312.GD21849@zxy.spb.ru> <9BFE7A4D-CCA3-4B44-9E2D-F6F7DAB78F07@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9BFE7A4D-CCA3-4B44-9E2D-F6F7DAB78F07@freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2015 20:41:28 -0000 On Wed, Aug 26, 2015 at 01:25:25PM -0700, Stanislav Sedov wrote: > > > On Aug 23, 2015, at 3:13 PM, Slawa Olhovchenkov wrote: > > > > I have multi-thread application fully utilise all CPU cores. > > I am need to determine lines give mostly CPU loads. > > How I can do this? > > > > `pmcstat -P BU_CPU_CLK_UNHALTED -t application_pid -n 500000 -O sample.out` > > consume to many CPU (performance drop x100 times) and mostly show > > himself in kernel and pmc locks and none for application. > > pmcstat -S BU_CPU_CLK_UNHALTED -- same here. > > > > Did you try something like `pmcstat -S instructions -T` by any chance? > That should give some quick clues as to which functions are being hot > at least. I am try '-S instructions' w/o -T, no difference. > Which FreeBSD version are you using by the way? 10-STABLE