Date: Fri, 14 Jan 2011 22:15:39 -0800 From: Garrett Cooper <gcooper@FreeBSD.org> To: Steve Kargl <sgk@troutmask.apl.washington.edu> Cc: George Neville-Neil <gnn@freebsd.org>, freebsd-current@freebsd.org, Ryan Stone <rysto32@gmail.com> Subject: Re: Profiling code execution on amd64? Message-ID: <AANLkTikYk0MP=gBnxz3%2BkjF_nRKyqQQO5VK2wUUnRQyM@mail.gmail.com> In-Reply-To: <20110115061023.GA41547@troutmask.apl.washington.edu> References: <20110113171139.GA32250@troutmask.apl.washington.edu> <AANLkTi=C4L9fn7q8PfJgY=8c24BQnZTC9s7BubsrUYxv@mail.gmail.com> <20110114040549.GA36430@troutmask.apl.washington.edu> <1D4725BB-0A0A-44FB-9FF1-23969C469AA6@freebsd.org> <20110115061023.GA41547@troutmask.apl.washington.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Jan 14, 2011 at 10:10 PM, Steve Kargl <sgk@troutmask.apl.washington.edu> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTikYk0MP=gBnxz3%2BkjF_nRKyqQQO5VK2wUUnRQyM>