gprof - annotate source, profile directed compiling
I would like to use the annotated source output of gprof (activity of code by line number).
I am compiling the code using gcc 3.4.2 as:
gcc -pg program_name -o program
When program is run, I get the gmon.out file just fine. I then run gprof as
gprof program > LOG
The flat listing ouptut works fine.
The gprof man page says that I can get the annotated source output by running it as:
gprof -A program
gprof accepts this option (no errors or warnings) but produces no ouput. Am I doing something wrong or is this an unimplemented option?
I would also like to use profile outputs as an input for recompliling. The gcc man page lists some options such as -fprofile-arcs for this purpse. Can someone give me a sketch on how to use the profiling into for this purpose?
- Ian
|