From owner-freebsd-current@FreeBSD.ORG Mon Jan 17 09:01:13 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1BAB5106566B; Mon, 17 Jan 2011 09:01:13 +0000 (UTC) (envelope-from fabien.thomas@netasq.com) Received: from work.netasq.com (mars.netasq.com [91.212.116.3]) by mx1.freebsd.org (Postfix) with ESMTP id 283458FC15; Mon, 17 Jan 2011 09:01:11 +0000 (UTC) Received: from [192.168.248.213] (unknown [192.168.248.213]) by work.netasq.com (Postfix) with ESMTPSA id 51AE1740011; Mon, 17 Jan 2011 09:45:20 +0100 (CET) Mime-Version: 1.0 (Apple Message framework v1082) Content-Type: text/plain; charset=us-ascii From: Fabien Thomas In-Reply-To: Date: Mon, 17 Jan 2011 09:45:44 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <88A95F5C-FDE9-425C-AC1B-D90B66A51B9C@netasq.com> References: <20110113171139.GA32250@troutmask.apl.washington.edu> <20110114040549.GA36430@troutmask.apl.washington.edu> <1D4725BB-0A0A-44FB-9FF1-23969C469AA6@freebsd.org> <20110115061023.GA41547@troutmask.apl.washington.edu> To: Garrett Cooper X-Mailer: Apple Mail (2.1082) Cc: George Neville-Neil , freebsd-current@freebsd.org, Ryan Stone , Steve Kargl Subject: Re: Profiling code execution on amd64? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jan 2011 09:01:13 -0000 Last time i've used it it was working but I dont think it is really = useful now (from my POV) because you cant have a global view of the system with it and all other reports = overlap. With the current state you have: - top mode for fast lookup - text output (replace gprof for me) - kcachegrind (calltree) for in depth analysis - gprof=20 Fabien > On Fri, Jan 14, 2011 at 10:10 PM, Steve Kargl > wrote: >> On Fri, Jan 14, 2011 at 03:40:46PM -0500, George Neville-Neil wrote: >>>=20 >>> On Jan 13, 2011, at 23:05 , Steve Kargl wrote: >>>=20 >>>> On Thu, Jan 13, 2011 at 10:08:30PM -0500, Ryan Stone wrote: >>>>> I would suggest using hwpmc for profiling: >>>>>=20 >>>>> # kldload hwpmc >>>>> # pmcstat -S unhalted-cycles -O /tmp/samples.out ../penetration >>>>> # pmcstat -R /tmp/samples.out -G /tmp/penetration.txt >>>>>=20 >>>>>=20 >>>>> You can also get pmcstat to generate gprof-compatible output with = -g, >>>>> but I never use the mode so I'm really not sure what it gives you. = I >>>>> think that you have to run gprof on the output or something, but = don't >>>>> hold me to that. >>>>=20 >>>>=20 >>>> Thanks. I'll give it a try, but my initial attempt seems to >>>> indicate that one needs to be root to use hwpmc. >>>>=20 >>>> laptop:kargl[210] pmcstat -S unhalted-cycles -O /tmp/samples.out = ../penetration >>>> pmcstat: ERROR: Cannot allocate system-mode pmc with specification >>>> "unhalted-cycles": Operation not permitted >>>>=20 >>>=20 >>> You only need to be root to profile the kernel or someone else's = process. >>>=20 >>> This tutorial might help: >>>=20 >>> www.dcbsdcon.org/speakers/slides/neville-neil_dcbsdcon2009.pdf >>>=20 >>=20 >> Thanks. I'll look at the tutorial. Meanwhile, should gprof >> be removed from the base system because it appears broken? >=20 > Instead of just removing things, why not determine why things are > broken and try to fix them? > -Garrett > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to = "freebsd-current-unsubscribe@freebsd.org"