Re: Profiling code execution on amd64?

From: Steve Kargl <sgk_at_troutmask.apl.washington.edu>
Date: Thu, 13 Jan 2011 20:05:49 -0800
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
Received on Fri Jan 14 2011 - 03:05:49 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:10 UTC