[linux-audio-user] profiling

Noah Roberts roberts.noah at gmail.com
Thu Dec 8 11:44:32 EST 2005


On 12/8/05, Steve Harris <S.W.Harris at ecs.soton.ac.uk> wrote:
> On Wed, Dec 07, 2005 at 07:13:30 -0800, Noah Roberts wrote:
> > Could the RT patch be interfearing with my ability to run gprof?
> > AFAICT I did everything right to use it, used the -pg on compile for
> > instance, but my profiles have no time at all in them:
>
> IIRC gprof works by sampling program activity at some interval. My
> experience with realtime code is that it doesnt spend long enough doing
> anything in particular to get meaningful results.

Well, _my_ code is not realtime.  Basically all I am doing is a
benchmark of std::string vs. char*.

>
> I think you will get better results by using cachegrind et al and running
> in freewheel mode so it doesn't get kicked off.

Hmmm...never heard of those things.  Will have to google them later.
>
> Failing that you can write your own profiling code reasonably easily, just
> use gettimeofday before and after ciritcal sections, and sum the results
> from each run.

Yeah, eventually I did that but it isn't nearly as accurate as a
profile.  Would certainly like to know how to make gprof work and why
it isn't at any rate for future development.  I don't often find the
need to profile, but sometimes I do and not being able to is a big
bummer.




More information about the Linux-audio-user mailing list