From owner-freebsd-current@FreeBSD.ORG Fri Jan 14 04:05:49 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 CA4C71065670 for ; Fri, 14 Jan 2011 04:05:49 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.208.78.105]) by mx1.freebsd.org (Postfix) with ESMTP id AB08D8FC18 for ; Fri, 14 Jan 2011 04:05:49 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.4/8.14.4) with ESMTP id p0E45nFd036440; Thu, 13 Jan 2011 20:05:49 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.4/8.14.4/Submit) id p0E45nH8036439; Thu, 13 Jan 2011 20:05:49 -0800 (PST) (envelope-from sgk) Date: Thu, 13 Jan 2011 20:05:49 -0800 From: Steve Kargl To: Ryan Stone Message-ID: <20110114040549.GA36430@troutmask.apl.washington.edu> References: <20110113171139.GA32250@troutmask.apl.washington.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: freebsd-current@freebsd.org 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: Fri, 14 Jan 2011 04:05:49 -0000 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. I > think that you have to run gprof on the output or something, but don't > hold me to that. Thanks. I'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 ../penetration pmcstat: ERROR: Cannot allocate system-mode pmc with specification "unhalted-cycles": Operation not permitted -- Steve