From owner-freebsd-current@FreeBSD.ORG Sat Jan 15 06:15:43 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 DBB2610656A4 for ; Sat, 15 Jan 2011 06:15:43 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 43E828FC14 for ; Sat, 15 Jan 2011 06:15:42 +0000 (UTC) Received: by wwf26 with SMTP id 26so3661803wwf.31 for ; Fri, 14 Jan 2011 22:15:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=BGLBS5uMY2cjPmNuKqqP7OtGtvN7fFs6r8Pf47m/t4k=; b=r65Furx8OSOYPEq02HgiKWOQr3yf8UAGhthWb50dA1y7AsjsQr5eEgkL7icJjJ0jQy 8iwoY3Jb93aHBWLosmU9+lvMmJYFtks2jFvci0eIGhl6GbbnkW717DF5NX1WX2/YeQyS 6Iqb63gIvAmrSF4aQ5mDE7IFOLKUlPR6BLDb8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=mcWh/hJVOL/FYXonxb8pgf+BtFb4dIqarx6QZJBJOJEnhmQsX0ZJN9v4i9XXww/6wN 02tUnnDZHW6LeWLUtFnCNoDlGbHDHed9IAdmlQTSPC/sMYBCEB5HjaRdB58AqtTcVl4K tC8SyRQjEBlpO1hj6iMYk8adzkF9WNcN48QPQ= MIME-Version: 1.0 Received: by 10.216.191.215 with SMTP id g65mr319804wen.16.1295072139278; Fri, 14 Jan 2011 22:15:39 -0800 (PST) Sender: yanegomi@gmail.com Received: by 10.216.254.226 with HTTP; Fri, 14 Jan 2011 22:15:39 -0800 (PST) In-Reply-To: <20110115061023.GA41547@troutmask.apl.washington.edu> 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> Date: Fri, 14 Jan 2011 22:15:39 -0800 X-Google-Sender-Auth: 4eBWPnPGg06wetJbRrX7KN5_NNU Message-ID: From: Garrett Cooper To: Steve Kargl Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: George Neville-Neil , freebsd-current@freebsd.org, Ryan Stone 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: Sat, 15 Jan 2011 06:15:43 -0000 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: >> >> On Jan 13, 2011, at 23:05 , Steve Kargl wrote: >> >> > On Thu, Jan 13, 2011 at 10:08:30PM -0500, Ryan Stone wrote: >> >> I would suggest using hwpmc for profiling: >> >> >> >> # kldload hwpmc >> >> # pmcstat -S unhalted-cycles -O /tmp/samples.out ../penetration >> >> # pmcstat -R /tmp/samples.out -G /tmp/penetration.txt >> >> >> >> >> >> 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. = =A0I >> >> think that you have to run gprof on the output or something, but don'= t >> >> hold me to that. >> > >> > >> > Thanks. =A0I'll give it a try, but my initial attempt seems to >> > indicate that one needs to be root to use hwpmc. >> > >> > laptop:kargl[210] pmcstat -S unhalted-cycles -O /tmp/samples.out ../pe= netration >> > pmcstat: ERROR: Cannot allocate system-mode pmc with specification >> > "unhalted-cycles": Operation not permitted >> > >> >> You only need to be root to profile the kernel or someone else's process= . >> >> This tutorial might help: >> >> www.dcbsdcon.org/speakers/slides/neville-neil_dcbsdcon2009.pdf >> > > Thanks. =A0I'll look at the tutorial. =A0Meanwhile, should gprof > be removed from the base system because it appears broken? Instead of just removing things, why not determine why things are broken and try to fix them? -Garrett