From owner-freebsd-hackers@freebsd.org Wed Aug 26 20:25:36 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 982E09C33EB for ; Wed, 26 Aug 2015 20:25:36 +0000 (UTC) (envelope-from stas@freebsd.org) Received: from mx0.deglitch.com (cl-414.sto-01.se.sixxs.net [IPv6:2001:16d8:ff00:19d::2]) by mx1.freebsd.org (Postfix) with ESMTP id 583F3DC1 for ; Wed, 26 Aug 2015 20:25:36 +0000 (UTC) (envelope-from stas@freebsd.org) Received: from [172.27.138.58] (unknown [199.201.64.131]) by mx0.deglitch.com (Postfix) with ESMTPSA id 0D3B28FC27; Thu, 27 Aug 2015 00:25:29 +0400 (MSK) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: How to application sample profiling? From: Stanislav Sedov In-Reply-To: <20150823221312.GD21849@zxy.spb.ru> Date: Wed, 26 Aug 2015 13:25:25 -0700 Cc: freebsd-hackers@FreeBSD.org Content-Transfer-Encoding: 7bit Message-Id: <9BFE7A4D-CCA3-4B44-9E2D-F6F7DAB78F07@freebsd.org> References: <20150823221312.GD21849@zxy.spb.ru> To: Slawa Olhovchenkov X-Mailer: Apple Mail (2.2104) 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:25:36 -0000 > 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. Which FreeBSD version are you using by the way? -- Stanislav Sedov ST4096-RIPE