gprof not producing annotated source

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

gprof not producing annotated source

chrisstankevitz
Hello,

Facts:

a) 'gprof ./a.out' produces lots of profiling info

b) 'gprof --annotated-source ./a.out' produces no output

c) 'gprof --line --annotated-source ./a.out' produces no output but uses more CPU than b)

d) I'm compiling and linking with this command: g++ -Wall -O0 -march=native -fprofile-arcs -ftest-coverage *.cpp -lusrp -lpthread -lfftw3 -lfftw3f -pg


Questions:

1) Why does b) produce no output?

2) Why does c) use more CPU than b) when --line is documented as "This feature works with programs compiled by older versions of the "gcc" compiler."

Thank you!

Chris


     
Reply | Threaded
Open this post in threaded view
|

Re: gprof not producing annotated source

Brian Dessent
Chris Stankevitz wrote:

> d) I'm compiling and linking with this command: g++ -Wall -O0 -march=native -fprofile-arcs -ftest-coverage *.cpp -lusrp -lpthread -lfftw3 -lfftw3f -pg
>
> Questions:
>
> 1) Why does b) produce no output?

I think that gprof needs debug info from the compiler in order to show
annotated source, so try with -g.

Brian